Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2009-01-10 07:31:10 -0500
committerEike Stepper2009-01-10 07:31:10 -0500
commit07c186bae14ded6ef84d9610353549a5af085c1c (patch)
tree9fb605ff18843d47a0e0ee782d63732e91d6eede
parent028519bae395b3007e042fac9fe9a76afd79c9f6 (diff)
downloadcdo-07c186bae14ded6ef84d9610353549a5af085c1c.tar.gz
cdo-07c186bae14ded6ef84d9610353549a5af085c1c.tar.xz
cdo-07c186bae14ded6ef84d9610353549a5af085c1c.zip
*** empty log message ***
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDOProtocolConstants.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.defs/src/org/eclipse/emf/cdo/defs/impl/CDOClientProtocolFactoryDefImpl.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.defs/src/org/eclipse/emf/cdo/defs/impl/CDOSessionDefImpl.java8
-rw-r--r--plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/StandaloneManualExample.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOServerProtocol.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/SetPassiveUpdateIndication.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/SyncRevisionsIndication.java (renamed from plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/SyncRevisionIndication.java)10
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/StateMachineTest.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_241464_Test.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_246442_Test.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_258933_Test.java5
-rw-r--r--plugins/org.eclipse.emf.cdo/META-INF/MANIFEST.MF3
-rw-r--r--plugins/org.eclipse.emf.cdo/plugin.xml4
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/net4j/CDONet4jUtil.java8
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/net4j/CDOSession.java8
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/net4j/CDOSessionProtocol.java25
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/session/CDOSession.java25
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOUtil.java1
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java17
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/CDONet4jSessionConfigurationImpl.java82
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/CDONet4jSessionFactory.java60
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/CDONet4jSessionImpl.java97
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CDOClientIndication.java (renamed from plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CDOClientIndication.java)2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CDOClientProtocol.java300
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CDOClientProtocolFactory.java (renamed from plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CDOClientProtocolFactory.java)2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CDOClientRequest.java (renamed from plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CDOClientRequest.java)2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CDOTimeRequest.java (renamed from plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CDOTimeRequest.java)2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/ChangeSubscriptionRequest.java (renamed from plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/ChangeSubscriptionRequest.java)2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/ChannelInjector.java (renamed from plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/ChannelInjector.java)10
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitNotificationIndication.java (renamed from plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CommitNotificationIndication.java)2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitTransactionCancelRequest.java (renamed from plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CommitTransactionCancelRequest.java)2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitTransactionPhase1Request.java (renamed from plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CommitTransactionPhase1Request.java)2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitTransactionPhase2Request.java (renamed from plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CommitTransactionPhase2Request.java)2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitTransactionPhase3Request.java (renamed from plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CommitTransactionPhase3Request.java)2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitTransactionRequest.java (renamed from plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CommitTransactionRequest.java)2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitTransactionResult.java (renamed from plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CommitTransactionResult.java)2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadChunkRequest.java (renamed from plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadChunkRequest.java)2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadLibrariesRequest.java (renamed from plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadLibrariesRequest.java)2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadPackageRequest.java (renamed from plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadPackageRequest.java)2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadRevisionByTimeRequest.java (renamed from plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadRevisionByTimeRequest.java)2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadRevisionByVersionRequest.java (renamed from plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadRevisionByVersionRequest.java)2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadRevisionRequest.java (renamed from plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadRevisionRequest.java)2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LockObjectsRequest.java (renamed from plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LockObjectsRequest.java)2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/ObjectLockedRequest.java (renamed from plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/ObjectLockedRequest.java)2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/OpenSessionRequest.java (renamed from plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/OpenSessionRequest.java)2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/OpenSessionResult.java (renamed from plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/OpenSessionResult.java)2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/QueryCancelRequest.java (renamed from plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/QueryCancelRequest.java)6
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/QueryRequest.java (renamed from plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/QueryRequest.java)6
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/RepositoryTimeRequest.java (renamed from plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/RepositoryTimeRequest.java)2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/RepositoryTimeResult.java (renamed from plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/RepositoryTimeResult.java)2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/ResourceIDRequest.java (renamed from plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/ResourceIDRequest.java)2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/SetAuditRequest.java (renamed from plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/SetAuditRequest.java)2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/SetPassiveUpdateRequest.java (renamed from plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/SetPassiveUpdateRequest.java)12
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/SyncRevisionsRequest.java (renamed from plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/SyncRevisionRequest.java)22
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/UnlockObjectsRequest.java (renamed from plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/UnlockObjectsRequest.java)2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/VerifyRevisionRequest.java (renamed from plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/VerifyRevisionRequest.java)2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/ViewsChangedRequest.java (renamed from plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/ViewsChangedRequest.java)2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CDOClientProtocol.java57
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/query/CDOAbstractQueryIteratorImpl.java14
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/query/CDOQueryImpl.java17
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDORevisionManagerImpl.java96
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionConfigurationImpl.java86
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionFactory.java31
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java85
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionPackageManagerImpl.java37
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/SessionUtil.java5
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOSingleTransactionStrategy.java17
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXATransactionCommitContext.java2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXATransactionImpl.java39
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOAuditImpl.java19
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java82
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/PluginContainerViewProvider.java3
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/CDOSessionProtocol.java93
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/CDOTransactionStrategy.java7
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOCommitContext.java2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOSession.java3
77 files changed, 857 insertions, 633 deletions
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDOProtocolConstants.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDOProtocolConstants.java
index 18189ba5bd..a0e04b2ccf 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDOProtocolConstants.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDOProtocolConstants.java
@@ -61,7 +61,7 @@ public interface CDOProtocolConstants
public static final short SIGNAL_QUERY_CANCEL = 19;
- public static final short SIGNAL_SYNC = 20;
+ public static final short SIGNAL_SYNC_REVISIONS = 20;
public static final short SIGNAL_PASSIVE_UPDATE = 21;
diff --git a/plugins/org.eclipse.emf.cdo.defs/src/org/eclipse/emf/cdo/defs/impl/CDOClientProtocolFactoryDefImpl.java b/plugins/org.eclipse.emf.cdo.defs/src/org/eclipse/emf/cdo/defs/impl/CDOClientProtocolFactoryDefImpl.java
index 492c9b509b..f769a389c9 100644
--- a/plugins/org.eclipse.emf.cdo.defs/src/org/eclipse/emf/cdo/defs/impl/CDOClientProtocolFactoryDefImpl.java
+++ b/plugins/org.eclipse.emf.cdo.defs/src/org/eclipse/emf/cdo/defs/impl/CDOClientProtocolFactoryDefImpl.java
@@ -9,14 +9,14 @@
* Contributors:
* André Dietisheim - initial API and implementation
* </copyright> *
- * $Id: CDOClientProtocolFactoryDefImpl.java,v 1.1 2008-12-31 14:43:30 estepper Exp $
+ * $Id: CDOClientProtocolFactoryDefImpl.java,v 1.1.2.1 2009-01-10 12:31:08 estepper Exp $
*/
package org.eclipse.emf.cdo.defs.impl;
import org.eclipse.emf.cdo.defs.CDOClientProtocolFactoryDef;
import org.eclipse.emf.cdo.defs.CDODefsPackage;
-import org.eclipse.emf.internal.cdo.protocol.CDOClientProtocolFactory;
+import org.eclipse.emf.internal.cdo.net4j.protocol.CDOClientProtocolFactory;
import org.eclipse.net4j.defs.impl.ClientProtocolFactoryDefImpl;
diff --git a/plugins/org.eclipse.emf.cdo.defs/src/org/eclipse/emf/cdo/defs/impl/CDOSessionDefImpl.java b/plugins/org.eclipse.emf.cdo.defs/src/org/eclipse/emf/cdo/defs/impl/CDOSessionDefImpl.java
index b42a7cf482..7a43c0c76d 100644
--- a/plugins/org.eclipse.emf.cdo.defs/src/org/eclipse/emf/cdo/defs/impl/CDOSessionDefImpl.java
+++ b/plugins/org.eclipse.emf.cdo.defs/src/org/eclipse/emf/cdo/defs/impl/CDOSessionDefImpl.java
@@ -10,7 +10,7 @@
* André Dietisheim - initial API and implementation
* </copyright>
*
- * $Id: CDOSessionDefImpl.java,v 1.2.2.1 2009-01-10 08:37:30 estepper Exp $
+ * $Id: CDOSessionDefImpl.java,v 1.2.2.2 2009-01-10 12:31:08 estepper Exp $
*/
package org.eclipse.emf.cdo.defs.impl;
@@ -23,7 +23,7 @@ import org.eclipse.emf.cdo.session.CDOPackageRegistry;
import org.eclipse.emf.cdo.session.CDOSession;
import org.eclipse.emf.cdo.session.CDOSessionConfiguration;
-import org.eclipse.emf.internal.cdo.session.CDOSessionConfigurationImpl;
+import org.eclipse.emf.internal.cdo.net4j.CDONet4jSessionConfigurationImpl;
import org.eclipse.net4j.connector.IConnector;
import org.eclipse.net4j.defs.ConnectorDef;
@@ -200,7 +200,7 @@ public class CDOSessionDefImpl extends DefImpl implements CDOSessionDef
*
* @throws IllegalStateException
* if a {@link FailOverStrategyDef} was set before
- * @see CDOSessionConfigurationImpl#openSession() <!-- end-user-doc -->
+ * @see CDONet4jSessionConfigurationImpl#openSession() <!-- end-user-doc -->
* @generated NOT
*/
public void setConnectorDef(ConnectorDef newConnectorDef)
@@ -387,7 +387,7 @@ public class CDOSessionDefImpl extends DefImpl implements CDOSessionDef
*
* @throws IllegalStateException
* if a {@link FailOverStrategyDef} was set before
- * @see CDOSessionConfigurationImpl#openSession() <!-- end-user-doc -->
+ * @see CDONet4jSessionConfigurationImpl#openSession() <!-- end-user-doc -->
* @generated NOT
*/
public void setFailOverStrategyDef(FailOverStrategyDef newFailOverStrategyDef)
diff --git a/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/StandaloneManualExample.java b/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/StandaloneManualExample.java
index 71d8d44e2f..5229a8d9dc 100644
--- a/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/StandaloneManualExample.java
+++ b/plugins/org.eclipse.emf.cdo.examples/src/org/eclipse/emf/cdo/examples/StandaloneManualExample.java
@@ -62,7 +62,7 @@ public class StandaloneManualExample
LifecycleUtil.activate(bufferProvider);
IProtocolProvider protocolProvider = new FactoriesProtocolProvider(
- new org.eclipse.emf.internal.cdo.protocol.CDOClientProtocolFactory());
+ new org.eclipse.emf.internal.cdo.net4j.protocol.CDOClientProtocolFactory());
// Prepare selector
org.eclipse.net4j.internal.tcp.TCPSelector selector = new org.eclipse.net4j.internal.tcp.TCPSelector();
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOServerProtocol.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOServerProtocol.java
index e3c345384f..10992f2eb5 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOServerProtocol.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOServerProtocol.java
@@ -100,8 +100,8 @@ public class CDOServerProtocol extends CDOProtocolImpl
case CDOProtocolConstants.SIGNAL_QUERY_CANCEL:
return new QueryCancelIndication(this);
- case CDOProtocolConstants.SIGNAL_SYNC:
- return new SyncRevisionIndication(this);
+ case CDOProtocolConstants.SIGNAL_SYNC_REVISIONS:
+ return new SyncRevisionsIndication(this);
case CDOProtocolConstants.SIGNAL_PASSIVE_UPDATE:
return new SetPassiveUpdateIndication(this);
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/SetPassiveUpdateIndication.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/SetPassiveUpdateIndication.java
index ae3fc43e77..5b5505049a 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/SetPassiveUpdateIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/SetPassiveUpdateIndication.java
@@ -23,7 +23,7 @@ import java.io.IOException;
/**
* @author Simon McDuff
*/
-public class SetPassiveUpdateIndication extends SyncRevisionIndication
+public class SetPassiveUpdateIndication extends SyncRevisionsIndication
{
private static final ContextTracer PROTOCOL_TRACER = new ContextTracer(OM.DEBUG_PROTOCOL,
SetPassiveUpdateIndication.class);
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/SyncRevisionIndication.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/SyncRevisionsIndication.java
index 986319eb63..cc5f9ded66 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/SyncRevisionIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/SyncRevisionsIndication.java
@@ -31,10 +31,10 @@ import java.util.List;
/**
* @author Simon McDuff
*/
-public class SyncRevisionIndication extends CDOReadIndication
+public class SyncRevisionsIndication extends CDOReadIndication
{
private static final ContextTracer PROTOCOL_TRACER = new ContextTracer(OM.DEBUG_PROTOCOL,
- SyncRevisionIndication.class);
+ SyncRevisionsIndication.class);
private List<Pair<InternalCDORevision, Long>> dirtyObjects = new ArrayList<Pair<InternalCDORevision, Long>>();
@@ -42,12 +42,12 @@ public class SyncRevisionIndication extends CDOReadIndication
private int referenceChunk;
- public SyncRevisionIndication(CDOServerProtocol protocol)
+ public SyncRevisionsIndication(CDOServerProtocol protocol)
{
- super(protocol, CDOProtocolConstants.SIGNAL_SYNC);
+ super(protocol, CDOProtocolConstants.SIGNAL_SYNC_REVISIONS);
}
- public SyncRevisionIndication(CDOServerProtocol protocol, short signalID)
+ public SyncRevisionsIndication(CDOServerProtocol protocol, short signalID)
{
super(protocol, signalID);
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/StateMachineTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/StateMachineTest.java
index 0b516b6da6..b0769448b1 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/StateMachineTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/StateMachineTest.java
@@ -24,7 +24,7 @@ import org.eclipse.emf.cdo.transaction.CDOTransaction;
import org.eclipse.emf.cdo.util.CDOUtil;
import org.eclipse.emf.internal.cdo.CDOStateMachine;
-import org.eclipse.emf.internal.cdo.protocol.CommitTransactionResult;
+import org.eclipse.emf.internal.cdo.net4j.protocol.CommitTransactionResult;
import org.eclipse.net4j.util.io.IOUtil;
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_241464_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_241464_Test.java
index e3aa67436e..54774fddfb 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_241464_Test.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_241464_Test.java
@@ -44,7 +44,10 @@ public class Bugzilla_241464_Test extends AbstractCDOTest
}
CDOSession session = openModel1Session();
- session.getProtocol().setTimeout(2000L);
+ if (session instanceof org.eclipse.emf.cdo.net4j.CDOSession)
+ {
+ ((org.eclipse.emf.cdo.net4j.CDOSession)session).options().getProtocol().setTimeout(2000L);
+ }
CDOTransaction transaction = session.openTransaction();
CDOResource resource = transaction.getResource("/test1");
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_246442_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_246442_Test.java
index 38209c1e35..f67b92082b 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_246442_Test.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_246442_Test.java
@@ -66,7 +66,10 @@ public class Bugzilla_246442_Test extends AbstractCDOTest
}
CDOSession session = openSession();
- session.getProtocol().setTimeout(2000L);
+ if (session instanceof org.eclipse.emf.cdo.net4j.CDOSession)
+ {
+ ((org.eclipse.emf.cdo.net4j.CDOSession)session).options().getProtocol().setTimeout(2000L);
+ }
CDOTransaction transaction = session.openTransaction();
transaction.getObject(lookupObject);
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_258933_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_258933_Test.java
index 5b00823f3b..5c9d6ebece 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_258933_Test.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_258933_Test.java
@@ -123,7 +123,10 @@ public class Bugzilla_258933_Test extends AbstractCDOTest
CDOSession session = openSession();
session.getPackageRegistry().putEPackage(topPackage);
- session.getProtocol().setTimeout(2000L);
+ if (session instanceof org.eclipse.emf.cdo.net4j.CDOSession)
+ {
+ ((org.eclipse.emf.cdo.net4j.CDOSession)session).options().getProtocol().setTimeout(2000L);
+ }
CDOTransaction transaction = session.openTransaction();
CDOObject instance = (CDOObject)transaction.getResource("/test1").getContents().get(0);
diff --git a/plugins/org.eclipse.emf.cdo/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo/META-INF/MANIFEST.MF
index 6ad41e252f..3eed508a8a 100644
--- a/plugins/org.eclipse.emf.cdo/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo/META-INF/MANIFEST.MF
@@ -25,7 +25,8 @@ Export-Package: org.eclipse.emf.cdo;version="2.0.0",
org.eclipse.emf.internal.cdo;version="2.0.0",
org.eclipse.emf.internal.cdo.analyzer;version="2.0.0";x-friends:="org.eclipse.emf.cdo.tests,org.eclipse.emf.cdo.defs,org.eclipse.emf.cdo.ui",
org.eclipse.emf.internal.cdo.bundle;version="2.0.0";x-friends:="org.eclipse.emf.cdo.ui",
- org.eclipse.emf.internal.cdo.protocol;version="2.0.0";x-friends:="org.eclipse.emf.cdo.tests,org.eclipse.emf.cdo.defs,org.eclipse.emf.cdo.ui",
+ org.eclipse.emf.internal.cdo.net4j;version="2.0.0";x-friends:="org.eclipse.emf.cdo.tests,org.eclipse.emf.cdo.defs,org.eclipse.emf.cdo.ui",
+ org.eclipse.emf.internal.cdo.net4j.protocol;version="2.0.0";x-friends:="org.eclipse.emf.cdo.tests,org.eclipse.emf.cdo.defs,org.eclipse.emf.cdo.ui",
org.eclipse.emf.internal.cdo.query;version="2.0.0";x-friends:="org.eclipse.emf.cdo.tests,org.eclipse.emf.cdo.defs,org.eclipse.emf.cdo.ui",
org.eclipse.emf.internal.cdo.revision;version="2.0.0";x-friends:="org.eclipse.emf.cdo.tests,org.eclipse.emf.cdo.defs,org.eclipse.emf.cdo.ui",
org.eclipse.emf.internal.cdo.session;version="2.0.0";x-friends:="org.eclipse.emf.cdo.tests,org.eclipse.emf.cdo.defs,org.eclipse.emf.cdo.ui",
diff --git a/plugins/org.eclipse.emf.cdo/plugin.xml b/plugins/org.eclipse.emf.cdo/plugin.xml
index 615a61dd2d..5dea7846b9 100644
--- a/plugins/org.eclipse.emf.cdo/plugin.xml
+++ b/plugins/org.eclipse.emf.cdo/plugin.xml
@@ -22,7 +22,7 @@
<extension
point="org.eclipse.net4j.util.factories">
<factory
- class="org.eclipse.emf.internal.cdo.protocol.CDOClientProtocolFactory"
+ class="org.eclipse.emf.internal.cdo.net4j.protocol.CDOClientProtocolFactory"
productGroup="org.eclipse.net4j.clientProtocols"
type="cdo"/>
<factory
@@ -34,7 +34,7 @@
<extension
point="org.eclipse.net4j.util.elementProcessors">
<elementProcessor
- class="org.eclipse.emf.internal.cdo.protocol.ChannelInjector">
+ class="org.eclipse.emf.internal.cdo.net4j.protocol.ChannelInjector">
</elementProcessor>
</extension>
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/net4j/CDONet4jUtil.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/net4j/CDONet4jUtil.java
index eda3d4ec2a..8ba73209e7 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/net4j/CDONet4jUtil.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/net4j/CDONet4jUtil.java
@@ -12,10 +12,8 @@
**************************************************************************/
package org.eclipse.emf.cdo.net4j;
-import org.eclipse.emf.cdo.session.CDOSessionConfiguration;
-
-import org.eclipse.emf.internal.cdo.protocol.CDOClientProtocolFactory;
-import org.eclipse.emf.internal.cdo.session.CDOSessionConfigurationImpl;
+import org.eclipse.emf.internal.cdo.net4j.CDONet4jSessionConfigurationImpl;
+import org.eclipse.emf.internal.cdo.net4j.protocol.CDOClientProtocolFactory;
import org.eclipse.net4j.util.container.IManagedContainer;
@@ -31,7 +29,7 @@ public final class CDONet4jUtil
public static CDOSessionConfiguration createSessionConfiguration()
{
- return new CDOSessionConfigurationImpl();
+ return new CDONet4jSessionConfigurationImpl();
}
public static void prepareContainer(IManagedContainer container)
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/net4j/CDOSession.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/net4j/CDOSession.java
index 9166df6b1f..4a03d4dc96 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/net4j/CDOSession.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/net4j/CDOSession.java
@@ -12,6 +12,12 @@
**************************************************************************/
package org.eclipse.emf.cdo.net4j;
+import org.eclipse.emf.cdo.common.CDOCommonSession;
+
+import org.eclipse.net4j.signal.ISignalProtocol;
+
+import org.eclipse.emf.spi.cdo.CDOSessionProtocol;
+
/**
* @since 2.0
* @author Eike Stepper
@@ -33,6 +39,6 @@ public interface CDOSession extends org.eclipse.emf.cdo.session.CDOSession
* Returns the Net4j {@link CDOSessionProtocol protocol} instance that represents the underlying
* <em>signalling connection</em> to the repository of this session.
*/
- public CDOSessionProtocol getProtocol();
+ public ISignalProtocol<CDOCommonSession> getProtocol();
}
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/net4j/CDOSessionProtocol.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/net4j/CDOSessionProtocol.java
deleted file mode 100644
index 714ca2e907..0000000000
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/net4j/CDOSessionProtocol.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.emf.cdo.net4j;
-
-import org.eclipse.emf.cdo.common.CDOCommonSession;
-import org.eclipse.emf.cdo.session.CDOSession;
-
-import org.eclipse.net4j.signal.ISignalProtocol;
-
-/**
- * @author Eike Stepper
- * @since 2.0
- */
-public interface CDOSessionProtocol extends ISignalProtocol<CDOCommonSession>
-{
- public CDOSession getSession();
-}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/session/CDOSession.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/session/CDOSession.java
index c1acbc03da..e9e16f75fc 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/session/CDOSession.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/session/CDOSession.java
@@ -16,7 +16,6 @@ import org.eclipse.emf.cdo.common.CDOCommonSession;
import org.eclipse.emf.cdo.common.model.CDOPackage;
import org.eclipse.emf.cdo.common.revision.CDORevision;
import org.eclipse.emf.cdo.common.revision.CDORevisionFactory;
-import org.eclipse.emf.cdo.net4j.CDOSessionProtocol;
import org.eclipse.emf.cdo.transaction.CDOTimeStampContext;
import org.eclipse.emf.cdo.transaction.CDOTransaction;
import org.eclipse.emf.cdo.util.CDOEvent;
@@ -55,22 +54,6 @@ import java.util.Collection;
public interface CDOSession extends CDOCommonSession, IContainer<CDOView>, IOptionsContainer
{
/**
- * Returns an instance of {@link Repository} that describes the model repository this {@link CDOSession session} is
- * connected to.
- *
- * @since 2.0
- */
- public Repository repository();
-
- /**
- * Returns the Net4j {@link CDOSessionProtocol protocol} instance that represents the underlying
- * <em>signalling connection</em> to the repository of this session.
- *
- * @since 2.0
- */
- public CDOSessionProtocol getProtocol();
-
- /**
* Returns the EMF {@link EPackage.Registry package registry} that is used by all {@link EObject objects} of all
* {@link CDOView views} of this session.
* <p>
@@ -173,6 +156,14 @@ public interface CDOSession extends CDOCommonSession, IContainer<CDOView>, IOpti
public Options options();
/**
+ * Returns an instance of {@link Repository} that describes the model repository this {@link CDOSession session} is
+ * connected to.
+ *
+ * @since 2.0
+ */
+ public Repository repository();
+
+ /**
* @author Simon McDuff
* @since 2.0
*/
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOUtil.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOUtil.java
index 871050703d..78fd91abaf 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOUtil.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOUtil.java
@@ -31,7 +31,6 @@ import org.eclipse.emf.internal.cdo.transaction.CDOXATransactionImpl;
import org.eclipse.emf.internal.cdo.util.FSMUtil;
import org.eclipse.emf.internal.cdo.view.CDORevisionPrefetchingPolicyImpl;
-
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.util.BasicEList;
import org.eclipse.emf.common.util.EList;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java
index 0811eacb15..ffabd01e40 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java
@@ -18,16 +18,13 @@ import org.eclipse.emf.cdo.common.model.CDOClass;
import org.eclipse.emf.cdo.common.revision.CDORevision;
import org.eclipse.emf.cdo.common.revision.CDORevisionFactory;
import org.eclipse.emf.cdo.common.revision.delta.CDOFeatureDelta;
-import org.eclipse.emf.cdo.common.util.TransportException;
import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevision;
import org.eclipse.emf.cdo.transaction.CDOTransaction;
import org.eclipse.emf.cdo.util.InvalidObjectException;
import org.eclipse.emf.cdo.view.CDOView;
import org.eclipse.emf.internal.cdo.bundle.OM;
-import org.eclipse.emf.internal.cdo.protocol.CDOClientProtocol;
-import org.eclipse.emf.internal.cdo.protocol.CommitTransactionResult;
-import org.eclipse.emf.internal.cdo.protocol.VerifyRevisionRequest;
+import org.eclipse.emf.internal.cdo.net4j.protocol.CommitTransactionResult;
import org.eclipse.emf.internal.cdo.session.CDORevisionManagerImpl;
import org.eclipse.emf.internal.cdo.util.FSMUtil;
@@ -41,6 +38,7 @@ import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.EStoreEObjectImpl;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.spi.cdo.InternalCDOObject;
+import org.eclipse.emf.spi.cdo.InternalCDOSession;
import org.eclipse.emf.spi.cdo.InternalCDOTransaction;
import org.eclipse.emf.spi.cdo.InternalCDOView;
@@ -308,15 +306,8 @@ public final class CDOStateMachine extends FiniteStateMachine<CDOState, CDOEvent
if (view != null)
{
- try
- {
- CDOClientProtocol protocol = (CDOClientProtocol)view.getSession().getProtocol();
- revisions = new VerifyRevisionRequest(protocol, revisions).send();
- }
- catch (Exception ex)
- {
- throw new TransportException(ex);
- }
+ InternalCDOSession session = (InternalCDOSession)view.getSession();
+ revisions = session.getSessionProtocol().verifyRevision(revisions);
revisions.addAll(revised);
for (InternalCDORevision revision : revisions)
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/CDONet4jSessionConfigurationImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/CDONet4jSessionConfigurationImpl.java
new file mode 100644
index 0000000000..5e0e1d2c4c
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/CDONet4jSessionConfigurationImpl.java
@@ -0,0 +1,82 @@
+/***************************************************************************
+ * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ **************************************************************************/
+package org.eclipse.emf.internal.cdo.net4j;
+
+import org.eclipse.emf.internal.cdo.session.CDOSessionConfigurationImpl;
+
+import org.eclipse.net4j.connector.IConnector;
+import org.eclipse.net4j.signal.failover.IFailOverStrategy;
+import org.eclipse.net4j.signal.failover.NOOPFailOverStrategy;
+import org.eclipse.net4j.util.CheckUtil;
+
+import org.eclipse.emf.spi.cdo.InternalCDOSession;
+
+/**
+ * @author Eike Stepper
+ */
+public class CDONet4jSessionConfigurationImpl extends CDOSessionConfigurationImpl implements
+ org.eclipse.emf.cdo.net4j.CDOSessionConfiguration
+{
+ private IConnector connector;
+
+ private IFailOverStrategy failOverStrategy;
+
+ public CDONet4jSessionConfigurationImpl()
+ {
+ }
+
+ public IConnector getConnector()
+ {
+ return connector;
+ }
+
+ public void setConnector(IConnector connector)
+ {
+ checkNotOpen();
+ this.connector = connector;
+ }
+
+ public IFailOverStrategy getFailOverStrategy()
+ {
+ return failOverStrategy;
+ }
+
+ public void setFailOverStrategy(IFailOverStrategy failOverStrategy)
+ {
+ checkNotOpen();
+ this.failOverStrategy = failOverStrategy;
+ }
+
+ @Override
+ public org.eclipse.emf.cdo.net4j.CDOSession openSession()
+ {
+ return (org.eclipse.emf.cdo.net4j.CDOSession)super.openSession();
+ }
+
+ @Override
+ protected InternalCDOSession createSession()
+ {
+ CheckUtil.checkState(connector != null ^ failOverStrategy != null,
+ "Specify exactly one of connector or failOverStrategy");
+
+ CDONet4jSessionImpl session = new CDONet4jSessionImpl();
+ if (connector != null)
+ {
+ session.options().getProtocol().setFailOverStrategy(new NOOPFailOverStrategy(connector));
+ }
+ else
+ {
+ session.options().getProtocol().setFailOverStrategy(failOverStrategy);
+ }
+
+ return session;
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/CDONet4jSessionFactory.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/CDONet4jSessionFactory.java
new file mode 100644
index 0000000000..c5ad6ee46c
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/CDONet4jSessionFactory.java
@@ -0,0 +1,60 @@
+/***************************************************************************
+ * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ **************************************************************************/
+package org.eclipse.emf.internal.cdo.net4j;
+
+import org.eclipse.emf.cdo.net4j.CDONet4jUtil;
+import org.eclipse.emf.cdo.net4j.CDOSessionConfiguration;
+import org.eclipse.emf.cdo.session.CDOSession;
+
+import org.eclipse.emf.internal.cdo.session.CDOPackageRegistryImpl;
+import org.eclipse.emf.internal.cdo.session.CDOSessionFactory;
+
+import org.eclipse.net4j.signal.failover.IFailOverStrategy;
+import org.eclipse.net4j.util.container.IManagedContainer;
+
+import org.eclipse.emf.spi.cdo.InternalCDOSession;
+
+/**
+ * @author Eike Stepper
+ */
+public class CDONet4jSessionFactory extends CDOSessionFactory
+{
+
+ public static final String TYPE = "cdo";
+
+ public CDONet4jSessionFactory()
+ {
+ super(TYPE);
+ }
+
+ public static CDOSession get(IManagedContainer container, String description)
+ {
+ return (CDOSession)container.getElement(PRODUCT_GROUP, TYPE, description);
+ }
+
+ /**
+ * @since 2.0
+ */
+ @Override
+ protected InternalCDOSession createSession(String repositoryName, boolean automaticPackageRegistry,
+ IFailOverStrategy failOverStrategy)
+ {
+ CDOSessionConfiguration configuration = CDONet4jUtil.createSessionConfiguration();
+ configuration.setRepositoryName(repositoryName);
+ configuration.setFailOverStrategy(failOverStrategy);
+ if (automaticPackageRegistry)
+ {
+ configuration.setPackageRegistry(new CDOPackageRegistryImpl.Eager());
+ }
+
+ return (InternalCDOSession)configuration.openSession();
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/CDONet4jSessionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/CDONet4jSessionImpl.java
new file mode 100644
index 0000000000..f8a958a7de
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/CDONet4jSessionImpl.java
@@ -0,0 +1,97 @@
+/***************************************************************************
+ * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ * Simon McDuff - http://bugs.eclipse.org/226778
+ * Simon McDuff - http://bugs.eclipse.org/230832
+ * Simon McDuff - http://bugs.eclipse.org/233490
+ * Simon McDuff - http://bugs.eclipse.org/213402
+ * Victor Roldan Betancort - maintenance
+ **************************************************************************/
+package org.eclipse.emf.internal.cdo.net4j;
+
+import org.eclipse.emf.internal.cdo.net4j.protocol.CDOClientProtocol;
+import org.eclipse.emf.internal.cdo.session.CDOSessionImpl;
+
+import org.eclipse.net4j.channel.IChannel;
+import org.eclipse.net4j.util.ReflectUtil.ExcludeFromDump;
+import org.eclipse.net4j.util.event.EventUtil;
+import org.eclipse.net4j.util.event.IListener;
+import org.eclipse.net4j.util.lifecycle.ILifecycle;
+import org.eclipse.net4j.util.lifecycle.LifecycleEventAdapter;
+
+/**
+ * @author Eike Stepper
+ */
+public class CDONet4jSessionImpl extends CDOSessionImpl implements org.eclipse.emf.cdo.net4j.CDOSession
+{
+ private CDOClientProtocol protocol;
+
+ @ExcludeFromDump
+ private IListener protocolListener = new LifecycleEventAdapter()
+ {
+ @Override
+ protected void onDeactivated(ILifecycle lifecycle)
+ {
+ close();
+ }
+ };
+
+ public CDONet4jSessionImpl()
+ {
+ protocol = new CDOClientProtocol();
+ protocol.setInfraStructure(this);
+ }
+
+ /**
+ * @since 2.0
+ */
+ public String getUserID()
+ {
+ IChannel channel = protocol.getChannel();
+ return channel == null ? null : channel.getUserID();
+ }
+
+ @Override
+ public OptionsImpl options()
+ {
+ return (OptionsImpl)super.options();
+ }
+
+ @Override
+ protected void doActivate() throws Exception
+ {
+ super.doActivate();
+ EventUtil.addListener(protocol, protocolListener);
+ }
+
+ @Override
+ protected void doDeactivate() throws Exception
+ {
+ EventUtil.removeListener(protocol, protocolListener);
+ super.doDeactivate();
+ protocol.close();
+ protocol = null;
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ protected class OptionsImpl extends org.eclipse.emf.internal.cdo.session.CDOSessionImpl.OptionsImpl implements
+ org.eclipse.emf.cdo.net4j.CDOSession.Options
+ {
+ public OptionsImpl()
+ {
+ }
+
+ public CDOClientProtocol getProtocol()
+ {
+ return protocol;
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CDOClientIndication.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CDOClientIndication.java
index 7482238de8..3a2654d8de 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CDOClientIndication.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CDOClientIndication.java
@@ -9,7 +9,7 @@
* Eike Stepper - initial API and implementation
* Simon McDuff - http://bugs.eclipse.org/233490
**************************************************************************/
-package org.eclipse.emf.internal.cdo.protocol;
+package org.eclipse.emf.internal.cdo.net4j.protocol;
import org.eclipse.emf.cdo.common.id.CDOIDObjectFactory;
import org.eclipse.emf.cdo.common.io.CDODataInput;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CDOClientProtocol.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CDOClientProtocol.java
new file mode 100644
index 0000000000..c58e6cee3f
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CDOClientProtocol.java
@@ -0,0 +1,300 @@
+/***************************************************************************
+ * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ **************************************************************************/
+package org.eclipse.emf.internal.cdo.net4j.protocol;
+
+import org.eclipse.emf.cdo.CDOObject;
+import org.eclipse.emf.cdo.common.id.CDOID;
+import org.eclipse.emf.cdo.common.model.CDOFeature;
+import org.eclipse.emf.cdo.common.model.CDOPackage;
+import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants;
+import org.eclipse.emf.cdo.common.revision.CDORevision;
+import org.eclipse.emf.cdo.common.util.TransportException;
+import org.eclipse.emf.cdo.internal.common.protocol.CDOProtocolImpl;
+import org.eclipse.emf.cdo.session.CDOSession;
+import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevision;
+import org.eclipse.emf.cdo.transaction.CDOTimeStampContext;
+import org.eclipse.emf.cdo.view.CDOView;
+
+import org.eclipse.emf.internal.cdo.bundle.OM;
+import org.eclipse.emf.internal.cdo.query.CDOAbstractQueryIteratorImpl;
+import org.eclipse.emf.internal.cdo.session.CDORevisionManagerImpl;
+import org.eclipse.emf.internal.cdo.transaction.CDOXATransactionCommitContext;
+
+import org.eclipse.net4j.signal.RemoteException;
+import org.eclipse.net4j.signal.RequestWithConfirmation;
+import org.eclipse.net4j.signal.SignalReactor;
+import org.eclipse.net4j.util.WrappedException;
+import org.eclipse.net4j.util.concurrent.RWLockManager.LockType;
+import org.eclipse.net4j.util.om.monitor.OMMonitor;
+import org.eclipse.net4j.util.om.trace.PerfTracer;
+
+import org.eclipse.emf.spi.cdo.CDOSessionProtocol;
+import org.eclipse.emf.spi.cdo.InternalCDOCommitContext;
+import org.eclipse.emf.spi.cdo.InternalCDOObject;
+
+import java.io.File;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author Eike Stepper
+ */
+public class CDOClientProtocol extends CDOProtocolImpl implements CDOSessionProtocol
+{
+ private static final PerfTracer REVISION_LOADING = new PerfTracer(OM.PERF_REVISION_LOADING,
+ CDORevisionManagerImpl.class);
+
+ public CDOClientProtocol()
+ {
+ }
+
+ @Override
+ public CDOSession getSession()
+ {
+ return (CDOSession)super.getSession();
+ }
+
+ public OpenSessionResult openSession(String repositoryName, boolean passiveUpdateEnabled)
+ {
+ open();
+ return send(new OpenSessionRequest(this, repositoryName, passiveUpdateEnabled));
+ }
+
+ public void loadLibraries(Set<String> missingLibraries, File cacheFolder)
+ {
+ send(new LoadLibrariesRequest(this, missingLibraries, cacheFolder));
+ }
+
+ public void setPassiveUpdate(Map<CDOID, CDORevision> allRevisions, int initialChunkSize, boolean passiveUpdateEnabled)
+ {
+ send(new SetPassiveUpdateRequest(this, allRevisions, initialChunkSize, passiveUpdateEnabled));
+ }
+
+ public RepositoryTimeResult getRepositoryTime()
+ {
+ return send(new RepositoryTimeRequest(this));
+ }
+
+ public String loadPackage(CDOPackage cdoPackage, boolean onlyEcore)
+ {
+ return send(new LoadPackageRequest(this, cdoPackage, false));
+ }
+
+ public Object loadChunk(InternalCDORevision revision, CDOFeature feature, int accessIndex, int fetchIndex,
+ int fromIndex, int toIndex)
+ {
+ return send(new LoadChunkRequest(this, revision, feature, accessIndex, fetchIndex, fromIndex, toIndex));
+ }
+
+ public List<InternalCDORevision> loadRevisions(Collection<CDOID> ids, int referenceChunk)
+ {
+ return send(new LoadRevisionRequest(this, ids, referenceChunk));
+ }
+
+ public List<InternalCDORevision> loadRevisionsByTime(Collection<CDOID> ids, int referenceChunk, long timeStamp)
+ {
+ return send(new LoadRevisionByTimeRequest(this, ids, referenceChunk, timeStamp));
+ }
+
+ public InternalCDORevision loadRevisionByVersion(CDOID id, int referenceChunk, int version)
+ {
+ return send(new LoadRevisionByVersionRequest(this, id, referenceChunk, version)).get(0);
+ }
+
+ public List<InternalCDORevision> verifyRevision(List<InternalCDORevision> revisions) throws TransportException
+ {
+ return send(new VerifyRevisionRequest(this, revisions));
+ }
+
+ public Collection<CDOTimeStampContext> syncRevisions(Map<CDOID, CDORevision> allRevisions, int initialChunkSize)
+ {
+ return send(new SyncRevisionsRequest(this, allRevisions, initialChunkSize));
+ }
+
+ public void openView(int viewId, byte protocolViewType, long timeStamp)
+ {
+ send(new ViewsChangedRequest(this, viewId, protocolViewType, timeStamp));
+ }
+
+ public void closeView(int viewId)
+ {
+ send(new ViewsChangedRequest(this, viewId));
+ }
+
+ public boolean[] setAudit(int viewId, long timeStamp, List<InternalCDOObject> invalidObjects)
+ {
+ return send(new SetAuditRequest(this, viewId, timeStamp, invalidObjects));
+ }
+
+ public void changeSubscription(int viewId, List<CDOID> cdoIDs, boolean subscribeMode, boolean clear)
+ {
+ send(new ChangeSubscriptionRequest(this, viewId, cdoIDs, subscribeMode, clear));
+ }
+
+ public List<Object> query(int viewID, CDOAbstractQueryIteratorImpl<?> queryResult)
+ {
+ return send(new QueryRequest(this, viewID, queryResult));
+ }
+
+ public boolean cancelQuery(int queryId)
+ {
+ try
+ {
+ return new QueryCancelRequest(this, queryId).send();
+ }
+ catch (Exception ignore)
+ {
+ return false;
+ }
+ }
+
+ public void lockObjects(CDOView view, Collection<? extends CDOObject> objects, long timeout, LockType lockType)
+ throws InterruptedException
+ {
+ InterruptedException interruptedException = null;
+ RuntimeException runtimeException = null;
+
+ try
+ {
+ new LockObjectsRequest(this, view, objects, timeout, lockType).send();
+ }
+ catch (RemoteException ex)
+ {
+ if (ex.getCause() instanceof RuntimeException)
+ {
+ runtimeException = (RuntimeException)ex.getCause();
+ }
+ else if (ex.getCause() instanceof InterruptedException)
+ {
+ interruptedException = (InterruptedException)ex.getCause();
+ }
+ }
+ catch (Exception ex)
+ {
+ throw WrappedException.wrap(ex);
+ }
+
+ if (interruptedException != null)
+ {
+ throw interruptedException;
+ }
+
+ if (runtimeException != null)
+ {
+ throw runtimeException;
+ }
+ }
+
+ public void unlockObjects(CDOView view, Collection<? extends CDOObject> objects, LockType lockType)
+ {
+ send(new UnlockObjectsRequest(this, view, objects, lockType));
+ }
+
+ public boolean isObjectLocked(CDOView view, CDOObject object, LockType lockType)
+ {
+ return send(new ObjectLockedRequest(this, view, object, lockType));
+ }
+
+ public CommitTransactionResult commitTransaction(InternalCDOCommitContext commitContext, OMMonitor monitor)
+ {
+ return send(new CommitTransactionRequest(this, commitContext), monitor);
+ }
+
+ public CommitTransactionResult commitTransactionPhase1(CDOXATransactionCommitContext xaContext, OMMonitor monitor)
+ {
+ return send(new CommitTransactionPhase1Request(this, xaContext), monitor);
+ }
+
+ public CommitTransactionResult commitTransactionPhase2(CDOXATransactionCommitContext xaContext, OMMonitor monitor)
+ {
+ return send(new CommitTransactionPhase2Request(this, xaContext), monitor);
+ }
+
+ public CommitTransactionResult commitTransactionPhase3(CDOXATransactionCommitContext xaContext, OMMonitor monitor)
+ {
+ return send(new CommitTransactionPhase3Request(this, xaContext), monitor);
+ }
+
+ public CommitTransactionResult commitTransactionCancel(CDOXATransactionCommitContext xaContext, OMMonitor monitor)
+ {
+ return send(new CommitTransactionCancelRequest(this, xaContext), monitor);
+ }
+
+ @Override
+ protected SignalReactor createSignalReactor(short signalID)
+ {
+ switch (signalID)
+ {
+ case CDOProtocolConstants.SIGNAL_COMMIT_NOTIFICATION:
+ return new CommitNotificationIndication(this);
+
+ default:
+ return super.createSignalReactor(signalID);
+ }
+ }
+
+ @Override
+ protected void doBeforeActivate() throws Exception
+ {
+ super.doBeforeActivate();
+ if (!(getInfraStructure() instanceof CDOSession))
+ {
+ throw new IllegalStateException("No session");
+ }
+ }
+
+ private <RESULT> RESULT send(RequestWithConfirmation<RESULT> request)
+ {
+ try
+ {
+ return request.send();
+ }
+ catch (RuntimeException ex)
+ {
+ throw ex;
+ }
+ catch (Exception ex)
+ {
+ throw new TransportException(ex);
+ }
+ }
+
+ private CommitTransactionResult send(CommitTransactionRequest request, OMMonitor monitor)
+ {
+ try
+ {
+ return request.send(monitor);
+ }
+ catch (RuntimeException ex)
+ {
+ throw ex;
+ }
+ catch (Exception ex)
+ {
+ throw new TransportException(ex);
+ }
+ }
+
+ private List<InternalCDORevision> send(LoadRevisionRequest request)
+ {
+ try
+ {
+ REVISION_LOADING.start(request);
+ return send(request);
+ }
+ finally
+ {
+ REVISION_LOADING.stop(request);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CDOClientProtocolFactory.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CDOClientProtocolFactory.java
index c071efd864..880c15fe1a 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CDOClientProtocolFactory.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CDOClientProtocolFactory.java
@@ -8,7 +8,7 @@
* Contributors:
* Eike Stepper - initial API and implementation
**************************************************************************/
-package org.eclipse.emf.internal.cdo.protocol;
+package org.eclipse.emf.internal.cdo.net4j.protocol;
import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CDOClientRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CDOClientRequest.java
index b373182526..77e01b426f 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CDOClientRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CDOClientRequest.java
@@ -9,7 +9,7 @@
* Eike Stepper - initial API and implementation
* Simon McDuff - maintenance
**************************************************************************/
-package org.eclipse.emf.internal.cdo.protocol;
+package org.eclipse.emf.internal.cdo.net4j.protocol;
import org.eclipse.emf.cdo.common.id.CDOIDObjectFactory;
import org.eclipse.emf.cdo.common.id.CDOIDProvider;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CDOTimeRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CDOTimeRequest.java
index 6e302ab515..e0ce3d89f5 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CDOTimeRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CDOTimeRequest.java
@@ -8,7 +8,7 @@
* Contributors:
* Eike Stepper - initial API and implementation
**************************************************************************/
-package org.eclipse.emf.internal.cdo.protocol;
+package org.eclipse.emf.internal.cdo.net4j.protocol;
import org.eclipse.emf.cdo.common.io.CDODataInput;
import org.eclipse.emf.cdo.common.io.CDODataOutput;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/ChangeSubscriptionRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/ChangeSubscriptionRequest.java
index 1da0ba986c..278ec61fa6 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/ChangeSubscriptionRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/ChangeSubscriptionRequest.java
@@ -10,7 +10,7 @@
* Simon McDuff - http://bugs.eclipse.org/230832
* Eike Stepper - maintenance
**************************************************************************/
-package org.eclipse.emf.internal.cdo.protocol;
+package org.eclipse.emf.internal.cdo.net4j.protocol;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.io.CDODataInput;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/ChannelInjector.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/ChannelInjector.java
index d75b843cd7..7122afa7e7 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/ChannelInjector.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/ChannelInjector.java
@@ -8,9 +8,7 @@
* Contributors:
* Eike Stepper - initial API and implementation
**************************************************************************/
-package org.eclipse.emf.internal.cdo.protocol;
-
-import org.eclipse.emf.cdo.session.CDOSession;
+package org.eclipse.emf.internal.cdo.net4j.protocol;
import org.eclipse.net4j.connector.IConnector;
import org.eclipse.net4j.signal.failover.NOOPFailOverStrategy;
@@ -34,10 +32,10 @@ public class ChannelInjector implements IElementProcessor
public Object process(IManagedContainer container, String productGroup, String factoryType, String description,
Object element)
{
- if (element instanceof CDOSession)
+ if (element instanceof org.eclipse.emf.cdo.net4j.CDOSession)
{
- CDOSession session = (CDOSession)element;
- session.getProtocol().setFailOverStrategy(new NOOPFailOverStrategy(getConnector(container, description)));
+ NOOPFailOverStrategy failOverStrategy = new NOOPFailOverStrategy(getConnector(container, description));
+ ((org.eclipse.emf.cdo.net4j.CDOSession)element).options().getProtocol().setFailOverStrategy(failOverStrategy);
}
return element;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CommitNotificationIndication.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitNotificationIndication.java
index 03aa819dca..6eeff83345 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CommitNotificationIndication.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitNotificationIndication.java
@@ -9,7 +9,7 @@
* Eike Stepper - initial API and implementation
* Simon McDuff - http://bugs.eclipse.org/233490
**************************************************************************/
-package org.eclipse.emf.internal.cdo.protocol;
+package org.eclipse.emf.internal.cdo.net4j.protocol;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.id.CDOIDAndVersion;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CommitTransactionCancelRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitTransactionCancelRequest.java
index 00e5a87c3a..d490713108 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CommitTransactionCancelRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitTransactionCancelRequest.java
@@ -8,7 +8,7 @@
* Contributors:
* Simon McDuff - initial API and implementation
**************************************************************************/
-package org.eclipse.emf.internal.cdo.protocol;
+package org.eclipse.emf.internal.cdo.net4j.protocol;
import org.eclipse.emf.cdo.common.io.CDODataInput;
import org.eclipse.emf.cdo.common.io.CDODataOutput;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CommitTransactionPhase1Request.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitTransactionPhase1Request.java
index a2eed7624d..ec3bdfc2e2 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CommitTransactionPhase1Request.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitTransactionPhase1Request.java
@@ -8,7 +8,7 @@
* Contributors:
* Simon McDuff - initial API and implementation
**************************************************************************/
-package org.eclipse.emf.internal.cdo.protocol;
+package org.eclipse.emf.internal.cdo.net4j.protocol;
import org.eclipse.emf.cdo.common.id.CDOIDProvider;
import org.eclipse.emf.cdo.common.io.CDODataInput;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CommitTransactionPhase2Request.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitTransactionPhase2Request.java
index 5889ab1ab2..78c4af57b5 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CommitTransactionPhase2Request.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitTransactionPhase2Request.java
@@ -8,7 +8,7 @@
* Contributors:
* Simon McDuff - initial API and implementation
**************************************************************************/
-package org.eclipse.emf.internal.cdo.protocol;
+package org.eclipse.emf.internal.cdo.net4j.protocol;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.id.CDOIDUtil;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CommitTransactionPhase3Request.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitTransactionPhase3Request.java
index cf8b4a33a9..0bd908d98d 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CommitTransactionPhase3Request.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitTransactionPhase3Request.java
@@ -8,7 +8,7 @@
* Contributors:
* Simon McDuff - initial API and implementation
**************************************************************************/
-package org.eclipse.emf.internal.cdo.protocol;
+package org.eclipse.emf.internal.cdo.net4j.protocol;
import org.eclipse.emf.cdo.common.io.CDODataInput;
import org.eclipse.emf.cdo.common.io.CDODataOutput;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CommitTransactionRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitTransactionRequest.java
index a01cc81c09..58d7fbc925 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CommitTransactionRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitTransactionRequest.java
@@ -11,7 +11,7 @@
* Simon McDuff - http://bugs.eclipse.org/215688
* Simon McDuff - http://bugs.eclipse.org/213402
**************************************************************************/
-package org.eclipse.emf.internal.cdo.protocol;
+package org.eclipse.emf.internal.cdo.net4j.protocol;
import org.eclipse.emf.cdo.CDOObject;
import org.eclipse.emf.cdo.common.id.CDOID;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CommitTransactionResult.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitTransactionResult.java
index 0aed64edb5..c34fb0ad77 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CommitTransactionResult.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitTransactionResult.java
@@ -8,7 +8,7 @@
* Contributors:
* Eike Stepper - initial API and implementation
**************************************************************************/
-package org.eclipse.emf.internal.cdo.protocol;
+package org.eclipse.emf.internal.cdo.net4j.protocol;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.id.CDOIDTemp;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadChunkRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadChunkRequest.java
index e8d0295381..9be6f77a75 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadChunkRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadChunkRequest.java
@@ -8,7 +8,7 @@
* Contributors:
* Eike Stepper - initial API and implementation
**************************************************************************/
-package org.eclipse.emf.internal.cdo.protocol;
+package org.eclipse.emf.internal.cdo.net4j.protocol;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.io.CDODataInput;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadLibrariesRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadLibrariesRequest.java
index d0aa05f73e..8248cd769a 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadLibrariesRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadLibrariesRequest.java
@@ -8,7 +8,7 @@
* Contributors:
* Eike Stepper - initial API and implementation
**************************************************************************/
-package org.eclipse.emf.internal.cdo.protocol;
+package org.eclipse.emf.internal.cdo.net4j.protocol;
import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadPackageRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadPackageRequest.java
index 94e3ae5716..402614a030 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadPackageRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadPackageRequest.java
@@ -8,7 +8,7 @@
* Contributors:
* Eike Stepper - initial API and implementation
**************************************************************************/
-package org.eclipse.emf.internal.cdo.protocol;
+package org.eclipse.emf.internal.cdo.net4j.protocol;
import org.eclipse.emf.cdo.common.io.CDODataInput;
import org.eclipse.emf.cdo.common.io.CDODataOutput;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadRevisionByTimeRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadRevisionByTimeRequest.java
index 00275a0dc0..06f63f5f35 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadRevisionByTimeRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadRevisionByTimeRequest.java
@@ -8,7 +8,7 @@
* Contributors:
* Eike Stepper - initial API and implementation
**************************************************************************/
-package org.eclipse.emf.internal.cdo.protocol;
+package org.eclipse.emf.internal.cdo.net4j.protocol;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.io.CDODataOutput;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadRevisionByVersionRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadRevisionByVersionRequest.java
index 49ff835a68..48110d8621 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadRevisionByVersionRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadRevisionByVersionRequest.java
@@ -8,7 +8,7 @@
* Contributors:
* Eike Stepper - initial API and implementation
**************************************************************************/
-package org.eclipse.emf.internal.cdo.protocol;
+package org.eclipse.emf.internal.cdo.net4j.protocol;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.io.CDODataOutput;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadRevisionRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadRevisionRequest.java
index c1e9d0a5dc..48919f6e10 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadRevisionRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadRevisionRequest.java
@@ -8,7 +8,7 @@
* Contributors:
* Eike Stepper - initial API and implementation
**************************************************************************/
-package org.eclipse.emf.internal.cdo.protocol;
+package org.eclipse.emf.internal.cdo.net4j.protocol;
import org.eclipse.emf.cdo.common.CDOFetchRule;
import org.eclipse.emf.cdo.common.id.CDOID;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LockObjectsRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LockObjectsRequest.java
index 5c7fc08972..019a4147e0 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LockObjectsRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LockObjectsRequest.java
@@ -8,7 +8,7 @@
* Contributors:
* Simon McDuff - initial API and implementation
**************************************************************************/
-package org.eclipse.emf.internal.cdo.protocol;
+package org.eclipse.emf.internal.cdo.net4j.protocol;
import org.eclipse.emf.cdo.CDOObject;
import org.eclipse.emf.cdo.common.io.CDODataInput;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/ObjectLockedRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/ObjectLockedRequest.java
index 71e2d92d1b..5ff6c79bd0 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/ObjectLockedRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/ObjectLockedRequest.java
@@ -8,7 +8,7 @@
* Contributors:
* Simon McDuff - initial API and implementation
**************************************************************************/
-package org.eclipse.emf.internal.cdo.protocol;
+package org.eclipse.emf.internal.cdo.net4j.protocol;
import org.eclipse.emf.cdo.CDOObject;
import org.eclipse.emf.cdo.common.io.CDODataInput;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/OpenSessionRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/OpenSessionRequest.java
index 861a66f1b0..2d8dbdd6e7 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/OpenSessionRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/OpenSessionRequest.java
@@ -9,7 +9,7 @@
* Eike Stepper - initial API and implementation
* Simon McDuff - http://bugs.eclipse.org/230832
**************************************************************************/
-package org.eclipse.emf.internal.cdo.protocol;
+package org.eclipse.emf.internal.cdo.net4j.protocol;
import org.eclipse.emf.cdo.common.id.CDOIDLibraryDescriptor;
import org.eclipse.emf.cdo.common.id.CDOIDMetaRange;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/OpenSessionResult.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/OpenSessionResult.java
index be37a01ff2..7248a280d1 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/OpenSessionResult.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/OpenSessionResult.java
@@ -8,7 +8,7 @@
* Contributors:
* Eike Stepper - initial API and implementation
**************************************************************************/
-package org.eclipse.emf.internal.cdo.protocol;
+package org.eclipse.emf.internal.cdo.net4j.protocol;
import org.eclipse.emf.cdo.common.id.CDOIDLibraryDescriptor;
import org.eclipse.emf.cdo.common.id.CDOIDMetaRange;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/QueryCancelRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/QueryCancelRequest.java
index e8ce737466..bb48b83caa 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/QueryCancelRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/QueryCancelRequest.java
@@ -9,7 +9,7 @@
* Simon McDuff - initial API and implementation
* Eike Stepper - maintenance
**************************************************************************/
-package org.eclipse.emf.internal.cdo.protocol;
+package org.eclipse.emf.internal.cdo.net4j.protocol;
import org.eclipse.emf.cdo.common.io.CDODataInput;
import org.eclipse.emf.cdo.common.io.CDODataOutput;
@@ -24,7 +24,7 @@ import java.io.IOException;
/**
* @author Simon McDuff
*/
-public class QueryCancelRequest extends CDOClientRequest<Object>
+public class QueryCancelRequest extends CDOClientRequest<Boolean>
{
private static final ContextTracer PROTOCOL_TRACER = new ContextTracer(OM.DEBUG_PROTOCOL, QueryCancelRequest.class);
@@ -48,7 +48,7 @@ public class QueryCancelRequest extends CDOClientRequest<Object>
}
@Override
- protected Object confirming(CDODataInput in) throws IOException
+ protected Boolean confirming(CDODataInput in) throws IOException
{
boolean exception = in.readBoolean();
if (exception)
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/QueryRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/QueryRequest.java
index 65c137f6de..9ef99ed241 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/QueryRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/QueryRequest.java
@@ -9,7 +9,7 @@
* Simon McDuff - initial API and implementation
* Eike Stepper - maintenance
**************************************************************************/
-package org.eclipse.emf.internal.cdo.protocol;
+package org.eclipse.emf.internal.cdo.net4j.protocol;
import org.eclipse.emf.cdo.common.io.CDODataInput;
import org.eclipse.emf.cdo.common.io.CDODataOutput;
@@ -29,7 +29,7 @@ import java.util.List;
/**
* @author Simon McDuff
*/
-public class QueryRequest extends CDOClientRequest<Object>
+public class QueryRequest extends CDOClientRequest<List<Object>>
{
private static final ContextTracer PROTOCOL_TRACER = new ContextTracer(OM.DEBUG_PROTOCOL, QueryRequest.class);
@@ -53,7 +53,7 @@ public class QueryRequest extends CDOClientRequest<Object>
}
@Override
- protected Object confirming(CDODataInput in) throws IOException
+ protected List<Object> confirming(CDODataInput in) throws IOException
{
int queryID = in.readInt();
queryResult.setQueryID(queryID);
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/RepositoryTimeRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/RepositoryTimeRequest.java
index 4ecf6e78e5..523e35ea1c 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/RepositoryTimeRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/RepositoryTimeRequest.java
@@ -8,7 +8,7 @@
* Contributors:
* Eike Stepper - initial API and implementation
**************************************************************************/
-package org.eclipse.emf.internal.cdo.protocol;
+package org.eclipse.emf.internal.cdo.net4j.protocol;
import org.eclipse.emf.cdo.common.io.CDODataInput;
import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/RepositoryTimeResult.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/RepositoryTimeResult.java
index 9bfb2375e2..1d30e95eaf 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/RepositoryTimeResult.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/RepositoryTimeResult.java
@@ -8,7 +8,7 @@
* Contributors:
* Eike Stepper - initial API and implementation
**************************************************************************/
-package org.eclipse.emf.internal.cdo.protocol;
+package org.eclipse.emf.internal.cdo.net4j.protocol;
import java.text.MessageFormat;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/ResourceIDRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/ResourceIDRequest.java
index 26031e7993..cfdffdb9d7 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/ResourceIDRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/ResourceIDRequest.java
@@ -8,7 +8,7 @@
* Contributors:
* Eike Stepper - initial API and implementation
**************************************************************************/
-package org.eclipse.emf.internal.cdo.protocol;
+package org.eclipse.emf.internal.cdo.net4j.protocol;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.io.CDODataInput;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/SetAuditRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/SetAuditRequest.java
index 1ed6d8a824..f53990c850 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/SetAuditRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/SetAuditRequest.java
@@ -8,7 +8,7 @@
* Contributors:
* Eike Stepper - initial API and implementation
**************************************************************************/
-package org.eclipse.emf.internal.cdo.protocol;
+package org.eclipse.emf.internal.cdo.net4j.protocol;
import org.eclipse.emf.cdo.common.io.CDODataInput;
import org.eclipse.emf.cdo.common.io.CDODataOutput;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/SetPassiveUpdateRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/SetPassiveUpdateRequest.java
index 4ac7c1f886..17ee873ecb 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/SetPassiveUpdateRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/SetPassiveUpdateRequest.java
@@ -9,7 +9,7 @@
* Simon McDuff - initial API and implementation
* Simon McDuff - http://bugs.eclipse.org/230832
**************************************************************************/
-package org.eclipse.emf.internal.cdo.protocol;
+package org.eclipse.emf.internal.cdo.net4j.protocol;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.io.CDODataOutput;
@@ -20,8 +20,6 @@ import org.eclipse.emf.internal.cdo.bundle.OM;
import org.eclipse.net4j.util.om.trace.ContextTracer;
-import org.eclipse.emf.spi.cdo.InternalCDOSession;
-
import java.io.IOException;
import java.util.Map;
@@ -29,17 +27,17 @@ import java.util.Map;
* @author Simon McDuff
* @since 2.0
*/
-public class SetPassiveUpdateRequest extends SyncRevisionRequest
+public class SetPassiveUpdateRequest extends SyncRevisionsRequest
{
private static final ContextTracer PROTOCOL_TRACER = new ContextTracer(OM.DEBUG_PROTOCOL,
SetPassiveUpdateRequest.class);
private boolean passiveUpdateEnabled;
- public SetPassiveUpdateRequest(CDOClientProtocol protocol, InternalCDOSession session,
- Map<CDOID, CDORevision> revisions, int referenceChunk, boolean passiveUpdateEnabled)
+ public SetPassiveUpdateRequest(CDOClientProtocol protocol, Map<CDOID, CDORevision> revisions, int referenceChunk,
+ boolean passiveUpdateEnabled)
{
- super(protocol, CDOProtocolConstants.SIGNAL_PASSIVE_UPDATE, session, revisions, referenceChunk);
+ super(protocol, CDOProtocolConstants.SIGNAL_PASSIVE_UPDATE, revisions, referenceChunk);
this.passiveUpdateEnabled = passiveUpdateEnabled;
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/SyncRevisionRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/SyncRevisionsRequest.java
index f61e6acf7a..6e18bc9ae2 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/SyncRevisionRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/SyncRevisionsRequest.java
@@ -9,7 +9,7 @@
* Simon McDuff - initial API and implementation
* Eike Stepper - maintenance
**************************************************************************/
-package org.eclipse.emf.internal.cdo.protocol;
+package org.eclipse.emf.internal.cdo.net4j.protocol;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.id.CDOIDAndVersion;
@@ -27,8 +27,6 @@ import org.eclipse.emf.internal.cdo.transaction.CDOTimeStampContextImpl;
import org.eclipse.net4j.util.om.trace.ContextTracer;
-import org.eclipse.emf.spi.cdo.InternalCDOSession;
-
import java.io.IOException;
import java.util.Collection;
import java.util.Collections;
@@ -40,27 +38,23 @@ import java.util.TreeMap;
* @author Simon McDuff
* @since 2.0
*/
-public class SyncRevisionRequest extends CDOClientRequest<Collection<CDOTimeStampContext>>
+public class SyncRevisionsRequest extends CDOClientRequest<Collection<CDOTimeStampContext>>
{
- private static final ContextTracer PROTOCOL_TRACER = new ContextTracer(OM.DEBUG_PROTOCOL, SyncRevisionRequest.class);
+ private static final ContextTracer PROTOCOL_TRACER = new ContextTracer(OM.DEBUG_PROTOCOL, SyncRevisionsRequest.class);
private Map<CDOID, CDORevision> revisions;
- private InternalCDOSession session;
-
private int referenceChunk;
- public SyncRevisionRequest(CDOClientProtocol protocol, InternalCDOSession session, Map<CDOID, CDORevision> revisions,
- int referenceChunk)
+ public SyncRevisionsRequest(CDOClientProtocol protocol, Map<CDOID, CDORevision> revisions, int referenceChunk)
{
- this(protocol, CDOProtocolConstants.SIGNAL_SYNC, session, revisions, referenceChunk);
+ this(protocol, CDOProtocolConstants.SIGNAL_SYNC_REVISIONS, revisions, referenceChunk);
}
- public SyncRevisionRequest(CDOClientProtocol protocol, short signalID, InternalCDOSession session,
- Map<CDOID, CDORevision> revisions, int referenceChunk)
+ public SyncRevisionsRequest(CDOClientProtocol protocol, short signalID, Map<CDOID, CDORevision> revisions,
+ int referenceChunk)
{
super(protocol, signalID);
- this.session = session;
this.revisions = revisions;
this.referenceChunk = referenceChunk;
}
@@ -131,7 +125,7 @@ public class SyncRevisionRequest extends CDOClientRequest<Collection<CDOTimeStam
((CDOTimeStampContextImpl)timestampContext).setDirtyObjects(dirtyObjects);
((CDOTimeStampContextImpl)timestampContext).setDetachedObjects(detachedObjects);
- session.handleSyncResponse(timestampContext.getTimeStamp(), dirtyObjects, detachedObjects);
+ getSession().handleSyncResponse(timestampContext.getTimeStamp(), dirtyObjects, detachedObjects);
}
return Collections.unmodifiableCollection(mapofContext.values());
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/UnlockObjectsRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/UnlockObjectsRequest.java
index 5a73164159..978dda818b 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/UnlockObjectsRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/UnlockObjectsRequest.java
@@ -8,7 +8,7 @@
* Contributors:
* Simon McDuff - initial API and implementation
**************************************************************************/
-package org.eclipse.emf.internal.cdo.protocol;
+package org.eclipse.emf.internal.cdo.net4j.protocol;
import org.eclipse.emf.cdo.CDOObject;
import org.eclipse.emf.cdo.common.io.CDODataInput;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/VerifyRevisionRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/VerifyRevisionRequest.java
index 0e7d867e6c..996869515e 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/VerifyRevisionRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/VerifyRevisionRequest.java
@@ -8,7 +8,7 @@
* Contributors:
* Eike Stepper - initial API and implementation
**************************************************************************/
-package org.eclipse.emf.internal.cdo.protocol;
+package org.eclipse.emf.internal.cdo.net4j.protocol;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.io.CDODataInput;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/ViewsChangedRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/ViewsChangedRequest.java
index fee2722549..a31ff13c4a 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/ViewsChangedRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/ViewsChangedRequest.java
@@ -8,7 +8,7 @@
* Contributors:
* Eike Stepper - initial API and implementation
**************************************************************************/
-package org.eclipse.emf.internal.cdo.protocol;
+package org.eclipse.emf.internal.cdo.net4j.protocol;
import org.eclipse.emf.cdo.common.CDOCommonView;
import org.eclipse.emf.cdo.common.io.CDODataInput;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CDOClientProtocol.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CDOClientProtocol.java
deleted file mode 100644
index 55f59eabf3..0000000000
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CDOClientProtocol.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.emf.internal.cdo.protocol;
-
-import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants;
-import org.eclipse.emf.cdo.internal.common.protocol.CDOProtocolImpl;
-import org.eclipse.emf.cdo.net4j.CDOSessionProtocol;
-import org.eclipse.emf.cdo.session.CDOSession;
-
-import org.eclipse.net4j.signal.SignalReactor;
-
-/**
- * @author Eike Stepper
- */
-public class CDOClientProtocol extends CDOProtocolImpl implements CDOSessionProtocol
-{
- public CDOClientProtocol()
- {
- }
-
- @Override
- public CDOSession getSession()
- {
- return (CDOSession)super.getSession();
- }
-
- @Override
- protected SignalReactor createSignalReactor(short signalID)
- {
- switch (signalID)
- {
- case CDOProtocolConstants.SIGNAL_COMMIT_NOTIFICATION:
- return new CommitNotificationIndication(this);
-
- default:
- return super.createSignalReactor(signalID);
- }
- }
-
- @Override
- protected void doBeforeActivate() throws Exception
- {
- super.doBeforeActivate();
- if (!(getInfraStructure() instanceof CDOSession))
- {
- throw new IllegalStateException("No session");
- }
- }
-}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/query/CDOAbstractQueryIteratorImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/query/CDOAbstractQueryIteratorImpl.java
index 066c926209..844357e718 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/query/CDOAbstractQueryIteratorImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/query/CDOAbstractQueryIteratorImpl.java
@@ -14,9 +14,6 @@ import org.eclipse.emf.cdo.common.CDOQueryInfo;
import org.eclipse.emf.cdo.spi.common.AbstractQueryResult;
import org.eclipse.emf.cdo.view.CDOView;
-import org.eclipse.emf.internal.cdo.protocol.CDOClientProtocol;
-import org.eclipse.emf.internal.cdo.protocol.QueryCancelRequest;
-
import org.eclipse.net4j.util.concurrent.ConcurrentValue;
import org.eclipse.emf.spi.cdo.InternalCDOSession;
@@ -76,15 +73,8 @@ public abstract class CDOAbstractQueryIteratorImpl<T> extends AbstractQueryResul
super.close();
queryIDSet.reevaluate();
- try
- {
- CDOClientProtocol protocol = (CDOClientProtocol)((InternalCDOSession)getView().getSession()).getProtocol();
- new QueryCancelRequest(protocol, getQueryID()).send();
- }
- catch (Exception ignore)
- {
- // Catch all exception
- }
+ InternalCDOSession session = (InternalCDOSession)getView().getSession();
+ session.getSessionProtocol().cancelQuery(getQueryID());
}
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/query/CDOQueryImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/query/CDOQueryImpl.java
index 9ae66eb014..957e3954b7 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/query/CDOQueryImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/query/CDOQueryImpl.java
@@ -16,8 +16,6 @@ import org.eclipse.emf.cdo.common.util.BlockingCloseableIterator;
import org.eclipse.emf.cdo.internal.common.CDOQueryInfoImpl;
import org.eclipse.emf.cdo.view.CDOQuery;
-import org.eclipse.emf.internal.cdo.protocol.CDOClientProtocol;
-import org.eclipse.emf.internal.cdo.protocol.QueryRequest;
import org.eclipse.emf.internal.cdo.session.CDOSessionPackageManagerImpl;
import org.eclipse.emf.internal.cdo.util.FSMUtil;
import org.eclipse.emf.internal.cdo.util.ModelUtil;
@@ -77,17 +75,7 @@ public class CDOQueryImpl extends CDOQueryInfoImpl implements CDOQuery
public <T> List<T> getResult(Class<T> classObject)
{
CDOAbstractQueryIteratorImpl<T> queryResult = createQueryResult(classObject);
-
- try
- {
- CDOClientProtocol protocol = (CDOClientProtocol)view.getSession().getProtocol();
- new QueryRequest(protocol, view.getViewID(), queryResult).send();
- }
- catch (Exception exception)
- {
- throw WrappedException.wrap(exception);
- }
-
+ view.getSession().getSessionProtocol().query(view.getViewID(), queryResult);
return queryResult.asList();
}
@@ -101,8 +89,7 @@ public class CDOQueryImpl extends CDOQueryInfoImpl implements CDOQuery
{
try
{
- CDOClientProtocol protocol = (CDOClientProtocol)view.getSession().getProtocol();
- new QueryRequest(protocol, view.getViewID(), queryResult).send();
+ view.getSession().getSessionProtocol().query(view.getViewID(), queryResult);
}
catch (Exception ex)
{
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDORevisionManagerImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDORevisionManagerImpl.java
index c08aba02ca..aa7c308c39 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDORevisionManagerImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDORevisionManagerImpl.java
@@ -16,21 +16,11 @@ import org.eclipse.emf.cdo.common.id.CDOIDObjectFactory;
import org.eclipse.emf.cdo.common.model.CDOFeature;
import org.eclipse.emf.cdo.common.model.CDOPackageManager;
import org.eclipse.emf.cdo.common.revision.CDORevision;
-import org.eclipse.emf.cdo.common.util.TransportException;
import org.eclipse.emf.cdo.internal.common.revision.CDORevisionResolverImpl;
import org.eclipse.emf.cdo.session.CDORevisionManager;
import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevision;
import org.eclipse.emf.cdo.view.CDOFetchRuleManager;
-import org.eclipse.emf.internal.cdo.bundle.OM;
-import org.eclipse.emf.internal.cdo.protocol.CDOClientProtocol;
-import org.eclipse.emf.internal.cdo.protocol.LoadChunkRequest;
-import org.eclipse.emf.internal.cdo.protocol.LoadRevisionByTimeRequest;
-import org.eclipse.emf.internal.cdo.protocol.LoadRevisionByVersionRequest;
-import org.eclipse.emf.internal.cdo.protocol.LoadRevisionRequest;
-
-import org.eclipse.net4j.util.om.trace.PerfTracer;
-
import org.eclipse.emf.spi.cdo.InternalCDOSession;
import java.util.Collection;
@@ -42,8 +32,6 @@ import java.util.List;
*/
public class CDORevisionManagerImpl extends CDORevisionResolverImpl implements CDORevisionManager
{
- private static final PerfTracer LOADING = new PerfTracer(OM.PERF_REVISION_LOADING, CDORevisionManagerImpl.class);
-
private InternalCDOSession session;
private CDOFetchRuleManager ruleManager = CDOFetchRuleManager.NOOP;
@@ -64,6 +52,22 @@ public class CDORevisionManagerImpl extends CDORevisionResolverImpl implements C
return session;
}
+ /**
+ * @since 2.0
+ */
+ public CDOFetchRuleManager getRuleManager()
+ {
+ return ruleManager;
+ }
+
+ /**
+ * @since 2.0
+ */
+ public void setRuleManager(CDOFetchRuleManager ruleManager)
+ {
+ this.ruleManager = ruleManager;
+ }
+
public CDOIDObjectFactory getCDOIDObjectFactory()
{
return session;
@@ -84,55 +88,38 @@ public class CDORevisionManagerImpl extends CDORevisionResolverImpl implements C
public Object loadChunkByRange(CDORevision revision, CDOFeature feature, int accessIndex, int fetchIndex,
int fromIndex, int toIndex)
{
- try
- {
- CDOClientProtocol protocol = (CDOClientProtocol)session.getProtocol();
- return new LoadChunkRequest(protocol, (InternalCDORevision)revision, feature, accessIndex, fetchIndex, fromIndex,
- toIndex).send();
- }
- catch (RuntimeException ex)
- {
- throw ex;
- }
- catch (Exception ex)
- {
- throw new TransportException(ex);
- }
+ return session.getSessionProtocol().loadChunk((InternalCDORevision)revision, feature, accessIndex, fetchIndex,
+ fromIndex, toIndex);
}
@Override
protected InternalCDORevision loadRevision(CDOID id, int referenceChunk)
{
- CDOClientProtocol protocol = (CDOClientProtocol)session.getProtocol();
- return send(new LoadRevisionRequest(protocol, Collections.singleton(id), referenceChunk)).get(0);
+ return loadRevisions(Collections.singleton(id), referenceChunk).get(0);
}
@Override
protected InternalCDORevision loadRevisionByTime(CDOID id, int referenceChunk, long timeStamp)
{
- CDOClientProtocol protocol = (CDOClientProtocol)session.getProtocol();
- return send(new LoadRevisionByTimeRequest(protocol, Collections.singleton(id), referenceChunk, timeStamp)).get(0);
+ return loadRevisionsByTime(Collections.singleton(id), referenceChunk, timeStamp).get(0);
}
@Override
protected InternalCDORevision loadRevisionByVersion(CDOID id, int referenceChunk, int version)
{
- CDOClientProtocol protocol = (CDOClientProtocol)session.getProtocol();
- return send(new LoadRevisionByVersionRequest(protocol, id, referenceChunk, version)).get(0);
+ return session.getSessionProtocol().loadRevisionByVersion(id, referenceChunk, version);
}
@Override
protected List<InternalCDORevision> loadRevisions(Collection<CDOID> ids, int referenceChunk)
{
- CDOClientProtocol protocol = (CDOClientProtocol)session.getProtocol();
- return send(new LoadRevisionRequest(protocol, ids, referenceChunk));
+ return session.getSessionProtocol().loadRevisions(ids, referenceChunk);
}
@Override
protected List<InternalCDORevision> loadRevisionsByTime(Collection<CDOID> ids, int referenceChunk, long timeStamp)
{
- CDOClientProtocol protocol = (CDOClientProtocol)session.getProtocol();
- return send(new LoadRevisionByTimeRequest(protocol, ids, referenceChunk, timeStamp));
+ return session.getSessionProtocol().loadRevisionsByTime(ids, referenceChunk, timeStamp);
}
/**
@@ -143,41 +130,4 @@ public class CDORevisionManagerImpl extends CDORevisionResolverImpl implements C
{
return session.getPackageManager();
}
-
- private List<InternalCDORevision> send(LoadRevisionRequest request)
- {
- try
- {
- LOADING.start(request);
- return request.send();
- }
- catch (RuntimeException ex)
- {
- throw ex;
- }
- catch (Exception ex)
- {
- throw new TransportException(ex);
- }
- finally
- {
- LOADING.stop(request);
- }
- }
-
- /**
- * @since 2.0
- */
- public CDOFetchRuleManager getRuleManager()
- {
- return ruleManager;
- }
-
- /**
- * @since 2.0
- */
- public void setRuleManager(CDOFetchRuleManager ruleManager)
- {
- this.ruleManager = ruleManager;
- }
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionConfigurationImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionConfigurationImpl.java
index 714f1db1b0..08a051c1f5 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionConfigurationImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionConfigurationImpl.java
@@ -12,29 +12,21 @@ package org.eclipse.emf.internal.cdo.session;
import org.eclipse.emf.cdo.common.revision.cache.CDORevisionCache;
import org.eclipse.emf.cdo.session.CDOPackageRegistry;
+import org.eclipse.emf.cdo.session.CDOSession;
import org.eclipse.emf.cdo.session.CDOSessionConfiguration;
import org.eclipse.emf.cdo.util.CDOUtil;
-import org.eclipse.net4j.connector.IConnector;
-import org.eclipse.net4j.signal.failover.IFailOverStrategy;
-import org.eclipse.net4j.signal.failover.NOOPFailOverStrategy;
-import org.eclipse.net4j.util.CheckUtil;
-
import org.eclipse.emf.spi.cdo.InternalCDOSession;
/**
* @author Eike Stepper
*/
-public class CDOSessionConfigurationImpl implements CDOSessionConfiguration
+public abstract class CDOSessionConfigurationImpl implements CDOSessionConfiguration
{
private InternalCDOSession session;
- private IConnector connector;
-
private String repositoryName;
- private IFailOverStrategy failOverStrategy;
-
private CDOPackageRegistry packageRegistry;
private CDORevisionCache revisionCache;
@@ -45,17 +37,6 @@ public class CDOSessionConfigurationImpl implements CDOSessionConfiguration
{
}
- public IConnector getConnector()
- {
- return connector;
- }
-
- public void setConnector(IConnector connector)
- {
- checkNotOpen();
- this.connector = connector;
- }
-
public String getRepositoryName()
{
return repositoryName;
@@ -67,17 +48,6 @@ public class CDOSessionConfigurationImpl implements CDOSessionConfiguration
this.repositoryName = repositoryName;
}
- public IFailOverStrategy getFailOverStrategy()
- {
- return failOverStrategy;
- }
-
- public void setFailOverStrategy(IFailOverStrategy failOverStrategy)
- {
- checkNotOpen();
- this.failOverStrategy = failOverStrategy;
- }
-
/**
* @since 2.0
*/
@@ -139,26 +109,30 @@ public class CDOSessionConfigurationImpl implements CDOSessionConfiguration
this.activateOnOpen = activateOnOpen;
}
+ public boolean isSessionOpen()
+ {
+ if (session == null)
+ {
+ return false;
+ }
+
+ if (!session.isClosed())
+ {
+ return true;
+ }
+
+ session = null;
+ return false;
+ }
+
/**
* @since 2.0
*/
- public InternalCDOSession openSession()
+ public CDOSession openSession()
{
- CheckUtil.checkState(connector != null ^ failOverStrategy != null,
- "Specify exactly one of connector or failOverStrategy");
-
if (!isSessionOpen())
{
- session = SessionUtil.createSession();
- if (connector != null)
- {
- session.getProtocol().setFailOverStrategy(new NOOPFailOverStrategy(connector));
- }
- else
- {
- session.getProtocol().setFailOverStrategy(failOverStrategy);
- }
-
+ session = createSession();
session.setRepositoryName(repositoryName);
session.setPackageRegistry(packageRegistry);
session.getRevisionManager().setCache(revisionCache);
@@ -172,27 +146,13 @@ public class CDOSessionConfigurationImpl implements CDOSessionConfiguration
return session;
}
- public boolean isSessionOpen()
- {
- if (session == null)
- {
- return false;
- }
-
- if (!session.isClosed())
- {
- return true;
- }
-
- session = null;
- return false;
- }
-
- private void checkNotOpen()
+ protected void checkNotOpen()
{
if (isSessionOpen())
{
throw new IllegalStateException("Session is already open");
}
}
+
+ protected abstract InternalCDOSession createSession();
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionFactory.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionFactory.java
index ebbbb9fc31..d67a508324 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionFactory.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionFactory.java
@@ -14,7 +14,6 @@ import org.eclipse.emf.cdo.session.CDOSession;
import org.eclipse.net4j.signal.failover.IFailOverStrategy;
import org.eclipse.net4j.util.StringUtil;
-import org.eclipse.net4j.util.container.IManagedContainer;
import org.eclipse.net4j.util.factory.Factory;
import org.eclipse.emf.spi.cdo.InternalCDOSession;
@@ -28,17 +27,15 @@ import java.util.StringTokenizer;
/**
* @author Eike Stepper
*/
-public class CDOSessionFactory extends Factory
+public abstract class CDOSessionFactory extends Factory
{
public static final String PRODUCT_GROUP = "org.eclipse.emf.cdo.sessions";
- public static final String TYPE = "cdo";
-
private static final String TRUE = Boolean.TRUE.toString();
- public CDOSessionFactory()
+ public CDOSessionFactory(String type)
{
- super(PRODUCT_GROUP, TYPE);
+ super(PRODUCT_GROUP, type);
}
public CDOSession create(String description)
@@ -84,27 +81,9 @@ public class CDOSessionFactory extends Factory
}
}
- public static CDOSession get(IManagedContainer container, String description)
- {
- return (CDOSession)container.getElement(PRODUCT_GROUP, TYPE, description);
- }
-
/**
* @since 2.0
*/
- public static InternalCDOSession createSession(String repositoryName, boolean automaticPackageRegistry,
- IFailOverStrategy failOverStrategy)
- {
- InternalCDOSession session = SessionUtil.createSession();
- if (automaticPackageRegistry)
- {
- CDOPackageRegistryImpl.Eager packageRegistry = new CDOPackageRegistryImpl.Eager();
- packageRegistry.setSession(session);
- session.setPackageRegistry(packageRegistry);
- }
-
- session.setRepositoryName(repositoryName);
- session.getProtocol().setFailOverStrategy(failOverStrategy);
- return session;
- }
+ protected abstract InternalCDOSession createSession(String repositoryName, boolean automaticPackageRegistry,
+ IFailOverStrategy failOverStrategy);
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java
index 3fb781b7de..cd2a989d21 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java
@@ -43,34 +43,23 @@ import org.eclipse.emf.cdo.util.CDOUtil;
import org.eclipse.emf.cdo.view.CDOView;
import org.eclipse.emf.internal.cdo.bundle.OM;
-import org.eclipse.emf.internal.cdo.protocol.CDOClientProtocol;
-import org.eclipse.emf.internal.cdo.protocol.LoadLibrariesRequest;
-import org.eclipse.emf.internal.cdo.protocol.OpenSessionRequest;
-import org.eclipse.emf.internal.cdo.protocol.OpenSessionResult;
-import org.eclipse.emf.internal.cdo.protocol.RepositoryTimeRequest;
-import org.eclipse.emf.internal.cdo.protocol.RepositoryTimeResult;
-import org.eclipse.emf.internal.cdo.protocol.SetPassiveUpdateRequest;
-import org.eclipse.emf.internal.cdo.protocol.SyncRevisionRequest;
+import org.eclipse.emf.internal.cdo.net4j.protocol.OpenSessionResult;
+import org.eclipse.emf.internal.cdo.net4j.protocol.RepositoryTimeResult;
import org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl;
import org.eclipse.emf.internal.cdo.util.ModelUtil;
import org.eclipse.emf.internal.cdo.view.CDOAuditImpl;
import org.eclipse.emf.internal.cdo.view.CDOViewImpl;
-import org.eclipse.net4j.channel.IChannel;
import org.eclipse.net4j.util.WrappedException;
import org.eclipse.net4j.util.ReflectUtil.ExcludeFromDump;
import org.eclipse.net4j.util.concurrent.QueueRunner;
import org.eclipse.net4j.util.container.Container;
import org.eclipse.net4j.util.event.Event;
-import org.eclipse.net4j.util.event.EventUtil;
-import org.eclipse.net4j.util.event.IListener;
import org.eclipse.net4j.util.event.Notifier;
import org.eclipse.net4j.util.io.ExtendedDataInput;
import org.eclipse.net4j.util.io.ExtendedDataOutput;
import org.eclipse.net4j.util.io.IOUtil;
import org.eclipse.net4j.util.io.StringCompressor;
-import org.eclipse.net4j.util.lifecycle.ILifecycle;
-import org.eclipse.net4j.util.lifecycle.LifecycleEventAdapter;
import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
import org.eclipse.net4j.util.om.trace.ContextTracer;
import org.eclipse.net4j.util.options.IOptions;
@@ -81,6 +70,7 @@ import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.spi.cdo.CDOSessionProtocol;
import org.eclipse.emf.spi.cdo.InternalCDOObject;
import org.eclipse.emf.spi.cdo.InternalCDOSession;
import org.eclipse.emf.spi.cdo.InternalCDOTransaction;
@@ -102,23 +92,13 @@ import java.util.Set;
/**
* @author Eike Stepper
*/
-public class CDOSessionImpl extends Container<CDOView> implements InternalCDOSession, Repository
+public abstract class CDOSessionImpl extends Container<CDOView> implements InternalCDOSession, Repository
{
private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG_SESSION, CDOSessionImpl.class);
private int sessionID;
- private CDOClientProtocol protocol;
-
- @ExcludeFromDump
- private IListener protocolListener = new LifecycleEventAdapter()
- {
- @Override
- protected void onDeactivated(ILifecycle lifecycle)
- {
- close();
- }
- };
+ private CDOSessionProtocol sessionProtocol;
private String repositoryName;
@@ -167,9 +147,6 @@ public class CDOSessionImpl extends Container<CDOView> implements InternalCDOSes
public CDOSessionImpl()
{
- protocol = new CDOClientProtocol();
- protocol.setInfraStructure(this);
-
packageManager = createPackageManager();
revisionManager = createRevisionManager();
}
@@ -195,15 +172,6 @@ public class CDOSessionImpl extends Container<CDOView> implements InternalCDOSes
return this;
}
- /**
- * @since 2.0
- */
- public String getUserID()
- {
- IChannel channel = protocol.getChannel();
- return channel == null ? null : channel.getUserID();
- }
-
public CDOIDObject createCDOIDObject(ExtendedDataInput in)
{
return cdoidObjectFactory.createCDOIDObject(in);
@@ -217,9 +185,9 @@ public class CDOSessionImpl extends Container<CDOView> implements InternalCDOSes
return cdoidObjectFactory.createCDOIDObject(in);
}
- public CDOClientProtocol getProtocol()
+ public CDOSessionProtocol getSessionProtocol()
{
- return protocol;
+ return sessionProtocol;
}
/**
@@ -276,14 +244,7 @@ public class CDOSessionImpl extends Container<CDOView> implements InternalCDOSes
private RepositoryTimeResult sendRepositoryTimeRequest()
{
- try
- {
- return new RepositoryTimeRequest(protocol).send();
- }
- catch (Exception ex)
- {
- throw WrappedException.wrap(ex);
- }
+ return sessionProtocol.getRepositoryTime();
}
/**
@@ -709,8 +670,7 @@ public class CDOSessionImpl extends Container<CDOView> implements InternalCDOSes
@Override
public String toString()
{
- IChannel channel = protocol.getChannel();
- return MessageFormat.format("CDOSession[{0}/{1}]", channel, repositoryName);
+ return MessageFormat.format("CDOSession[{0}, {1}]", repositoryName, sessionID);
}
/**
@@ -787,10 +747,8 @@ public class CDOSessionImpl extends Container<CDOView> implements InternalCDOSes
}
packageRegistry.setSession(this);
- protocol.open();
- boolean passiveUpdateEnabled = options().isPassiveUpdateEnabled();
- OpenSessionResult result = new OpenSessionRequest(protocol, repositoryName, passiveUpdateEnabled).send();
+ OpenSessionResult result = sessionProtocol.openSession(repositoryName, options().isPassiveUpdateEnabled());
sessionID = result.getSessionID();
repositoryUUID = result.getRepositoryUUID();
repositoryCreationTime = result.getRepositoryCreationTime();
@@ -801,7 +759,6 @@ public class CDOSessionImpl extends Container<CDOView> implements InternalCDOSes
packageManager.addPackageProxies(result.getPackageInfos());
packageManager.activate();
revisionManager.activate();
- EventUtil.addListener(protocol, protocolListener);
}
@Override
@@ -832,10 +789,6 @@ public class CDOSessionImpl extends Container<CDOView> implements InternalCDOSes
packageManager.deactivate();
packageManager = null;
-
- EventUtil.removeListener(protocol, protocolListener);
- protocol.close();
- protocol = null;
super.doDeactivate();
}
@@ -860,7 +813,7 @@ public class CDOSessionImpl extends Container<CDOView> implements InternalCDOSes
missingLibraries.removeAll(existingLibraries);
if (!missingLibraries.isEmpty())
{
- new LoadLibrariesRequest(protocol, missingLibraries, cacheFolder).send();
+ sessionProtocol.loadLibraries(missingLibraries, cacheFolder);
}
}
@@ -948,7 +901,7 @@ public class CDOSessionImpl extends Container<CDOView> implements InternalCDOSes
if (!allRevisions.isEmpty())
{
int initialChunkSize = options().getCollectionLoadingPolicy().getInitialChunkSize();
- return new SyncRevisionRequest(protocol, this, allRevisions, initialChunkSize).send();
+ return sessionProtocol.syncRevisions(allRevisions, initialChunkSize);
}
}
catch (Exception ex)
@@ -1049,18 +1002,10 @@ public class CDOSessionImpl extends Container<CDOView> implements InternalCDOSes
// Need to refresh if we change state
Map<CDOID, CDORevision> allRevisions = getAllRevisions();
-
- try
- {
- if (!allRevisions.isEmpty())
- {
- new SetPassiveUpdateRequest(protocol, CDOSessionImpl.this, allRevisions, collectionLoadingPolicy
- .getInitialChunkSize(), passiveUpdateEnabled).send();
- }
- }
- catch (Exception ex)
+ if (!allRevisions.isEmpty())
{
- throw WrappedException.wrap(ex);
+ int initialChunkSize = collectionLoadingPolicy.getInitialChunkSize();
+ sessionProtocol.setPassiveUpdate(allRevisions, initialChunkSize, passiveUpdateEnabled);
}
fireEvent(new PassiveUpdateEventImpl());
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionPackageManagerImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionPackageManagerImpl.java
index 183a989673..0618325372 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionPackageManagerImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionPackageManagerImpl.java
@@ -18,14 +18,10 @@ import org.eclipse.emf.cdo.common.model.CDOFeature;
import org.eclipse.emf.cdo.common.model.CDOModelUtil;
import org.eclipse.emf.cdo.common.model.CDOPackage;
import org.eclipse.emf.cdo.common.model.CDOPackageInfo;
-import org.eclipse.emf.cdo.common.util.TransportException;
import org.eclipse.emf.cdo.internal.common.model.CDOPackageManagerImpl;
import org.eclipse.emf.cdo.session.CDOSessionPackageManager;
-import org.eclipse.emf.cdo.spi.common.model.InternalCDOPackage;
import org.eclipse.emf.internal.cdo.bundle.OM;
-import org.eclipse.emf.internal.cdo.protocol.CDOClientProtocol;
-import org.eclipse.emf.internal.cdo.protocol.LoadPackageRequest;
import org.eclipse.emf.internal.cdo.util.ModelUtil;
import org.eclipse.emf.ecore.EClass;
@@ -158,22 +154,10 @@ public class CDOSessionPackageManagerImpl extends CDOPackageManagerImpl implemen
}
}
- try
- {
- CDOClientProtocol protocol = (CDOClientProtocol)session.getProtocol();
- new LoadPackageRequest(protocol, cdoPackage, false).send();
- if (!cdoPackage.isDynamic())
- {
- OM.LOG.info("Dynamic package created for " + cdoPackage.getPackageURI());
- }
- }
- catch (RuntimeException ex)
- {
- throw ex;
- }
- catch (Exception ex)
+ session.getSessionProtocol().loadPackage(cdoPackage, false);
+ if (!cdoPackage.isDynamic())
{
- throw new TransportException(ex);
+ OM.LOG.info("Dynamic package created for " + cdoPackage.getPackageURI());
}
}
@@ -182,19 +166,6 @@ public class CDOSessionPackageManagerImpl extends CDOPackageManagerImpl implemen
*/
public void loadPackageEcore(CDOPackage cdoPackage)
{
- try
- {
- CDOClientProtocol protocol = (CDOClientProtocol)session.getProtocol();
- String ecore = new LoadPackageRequest(protocol, cdoPackage, true).send();
- ((InternalCDOPackage)cdoPackage).setEcore(ecore);
- }
- catch (RuntimeException ex)
- {
- throw ex;
- }
- catch (Exception ex)
- {
- throw new TransportException(ex);
- }
+ session.getSessionProtocol().loadPackage(cdoPackage, true);
}
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/SessionUtil.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/SessionUtil.java
index 923da7a032..77d62563ff 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/SessionUtil.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/SessionUtil.java
@@ -101,9 +101,4 @@ public final class SessionUtil
return viewSet;
}
-
- public static CDOSessionImpl createSession()
- {
- return new CDOSessionImpl();
- }
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOSingleTransactionStrategy.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOSingleTransactionStrategy.java
index 5f31a51ca1..b3a14456f1 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOSingleTransactionStrategy.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOSingleTransactionStrategy.java
@@ -13,11 +13,10 @@ package org.eclipse.emf.internal.cdo.transaction;
import org.eclipse.emf.cdo.transaction.CDOSavepoint;
import org.eclipse.emf.internal.cdo.bundle.OM;
-import org.eclipse.emf.internal.cdo.protocol.CDOClientProtocol;
-import org.eclipse.emf.internal.cdo.protocol.CommitTransactionRequest;
-import org.eclipse.emf.internal.cdo.protocol.CommitTransactionResult;
+import org.eclipse.emf.internal.cdo.net4j.protocol.CommitTransactionResult;
import org.eclipse.net4j.util.om.monitor.EclipseMonitor;
+import org.eclipse.net4j.util.om.monitor.OMMonitor;
import org.eclipse.net4j.util.om.trace.ContextTracer;
import org.eclipse.net4j.util.transaction.TransactionException;
@@ -50,27 +49,25 @@ public class CDOSingleTransactionStrategy implements CDOTransactionStrategy
}
commitContext.preCommit();
+
CommitTransactionResult result = null;
if (commitContext.getTransaction().isDirty())
{
- CDOClientProtocol protocol = (CDOClientProtocol)transaction.getSession().getProtocol();
- CommitTransactionRequest request = new CommitTransactionRequest(protocol, commitContext);
- if (TRACER.isEnabled())
- {
- TRACER.format("Sending commit request");
- }
+ OMMonitor monitor = new EclipseMonitor(progressMonitor);
+ result = transaction.getSession().getSessionProtocol().commitTransaction(commitContext, monitor);
- result = request.send(new EclipseMonitor(progressMonitor));
String rollbackMessage = result.getRollbackMessage();
if (rollbackMessage != null)
{
throw new TransactionException(rollbackMessage);
}
}
+
if (TRACER.isEnabled())
{
TRACER.format("CDOCommitContext.postCommit");
}
+
commitContext.postCommit(result);
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java
index 3ba95c7a30..180cb3331b 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java
@@ -45,7 +45,7 @@ import org.eclipse.emf.cdo.view.CDOViewResourcesEvent;
import org.eclipse.emf.internal.cdo.CDOObjectMerger;
import org.eclipse.emf.internal.cdo.CDOStateMachine;
import org.eclipse.emf.internal.cdo.bundle.OM;
-import org.eclipse.emf.internal.cdo.protocol.CommitTransactionResult;
+import org.eclipse.emf.internal.cdo.net4j.protocol.CommitTransactionResult;
import org.eclipse.emf.internal.cdo.session.CDOSessionPackageManagerImpl;
import org.eclipse.emf.internal.cdo.util.CompletePackageClosure;
import org.eclipse.emf.internal.cdo.util.FSMUtil;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXATransactionCommitContext.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXATransactionCommitContext.java
index c397c4bb60..84f2a8670c 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXATransactionCommitContext.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXATransactionCommitContext.java
@@ -20,7 +20,7 @@ import org.eclipse.emf.cdo.eresource.CDOResource;
import org.eclipse.emf.cdo.internal.common.id.CDOIDExternalTempImpl;
import org.eclipse.emf.cdo.util.CDOUtil;
-import org.eclipse.emf.internal.cdo.protocol.CommitTransactionResult;
+import org.eclipse.emf.internal.cdo.net4j.protocol.CommitTransactionResult;
import org.eclipse.emf.internal.cdo.transaction.CDOXATransactionImpl.CDOXAState;
import org.eclipse.net4j.util.ImplementationError;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXATransactionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXATransactionImpl.java
index c8fbb2e709..6538d85d11 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXATransactionImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXATransactionImpl.java
@@ -18,21 +18,18 @@ import org.eclipse.emf.cdo.util.CDOUtil;
import org.eclipse.emf.cdo.view.CDOView;
import org.eclipse.emf.cdo.view.CDOViewSet;
-import org.eclipse.emf.internal.cdo.protocol.CDOClientProtocol;
-import org.eclipse.emf.internal.cdo.protocol.CommitTransactionCancelRequest;
-import org.eclipse.emf.internal.cdo.protocol.CommitTransactionPhase1Request;
-import org.eclipse.emf.internal.cdo.protocol.CommitTransactionPhase2Request;
-import org.eclipse.emf.internal.cdo.protocol.CommitTransactionPhase3Request;
-import org.eclipse.emf.internal.cdo.protocol.CommitTransactionResult;
+import org.eclipse.emf.internal.cdo.net4j.protocol.CommitTransactionResult;
import org.eclipse.net4j.util.CheckUtil;
import org.eclipse.net4j.util.om.monitor.EclipseMonitor;
+import org.eclipse.net4j.util.om.monitor.OMMonitor;
import org.eclipse.net4j.util.om.monitor.EclipseMonitor.SynchonizedSubProgressMonitor;
import org.eclipse.net4j.util.transaction.TransactionException;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.spi.cdo.CDOSessionProtocol;
import org.eclipse.emf.spi.cdo.CDOTransactionStrategy;
import org.eclipse.emf.spi.cdo.InternalCDOCommitContext;
import org.eclipse.emf.spi.cdo.InternalCDOTransaction;
@@ -471,12 +468,12 @@ public class CDOXATransactionImpl implements CDOXATransaction
CommitTransactionResult result = null;
if (xaContext.getTransaction().isDirty())
{
- // Phase 1
- CDOClientProtocol protocol = (CDOClientProtocol)xaContext.getTransaction().getSession().getProtocol();
- CommitTransactionPhase1Request request = new CommitTransactionPhase1Request(protocol, xaContext);
- result = request.send(new EclipseMonitor(progressMonitor));
+ CDOSessionProtocol sessionProtocol = xaContext.getTransaction().getSession().getSessionProtocol();
+ OMMonitor monitor = new EclipseMonitor(progressMonitor);
+ result = sessionProtocol.commitTransactionPhase1(xaContext, monitor);
check_result(result);
}
+
xaContext.setResult(result);
xaContext.setState(CDOXAPhase2State.INSTANCE);
}
@@ -498,12 +495,12 @@ public class CDOXATransactionImpl implements CDOXATransaction
{
if (xaContext.getTransaction().isDirty())
{
- // Phase 2
- CDOClientProtocol protocol = (CDOClientProtocol)xaContext.getTransaction().getSession().getProtocol();
- CommitTransactionPhase2Request request = new CommitTransactionPhase2Request(protocol, xaContext);
- CommitTransactionResult result = request.send(new EclipseMonitor(progressMonitor));
+ CDOSessionProtocol sessionProtocol = xaContext.getTransaction().getSession().getSessionProtocol();
+ OMMonitor monitor = new EclipseMonitor(progressMonitor);
+ CommitTransactionResult result = sessionProtocol.commitTransactionPhase2(xaContext, monitor);
check_result(result);
}
+
xaContext.setState(CDOXAPhase3State.INSTANCE);
}
};
@@ -522,12 +519,11 @@ public class CDOXATransactionImpl implements CDOXATransaction
@Override
protected void handle(CDOXATransactionCommitContext xaContext, IProgressMonitor progressMonitor) throws Exception
{
- // Phase 2
if (xaContext.getTransaction().isDirty())
{
- CDOClientProtocol protocol = (CDOClientProtocol)xaContext.getTransaction().getSession().getProtocol();
- CommitTransactionPhase3Request request = new CommitTransactionPhase3Request(protocol, xaContext);
- CommitTransactionResult result = request.send(new EclipseMonitor(progressMonitor));
+ CDOSessionProtocol sessionProtocol = xaContext.getTransaction().getSession().getSessionProtocol();
+ OMMonitor monitor = new EclipseMonitor(progressMonitor);
+ CommitTransactionResult result = sessionProtocol.commitTransactionPhase3(xaContext, monitor);
check_result(result);
}
xaContext.postCommit(xaContext.getResult());
@@ -549,10 +545,9 @@ public class CDOXATransactionImpl implements CDOXATransaction
@Override
protected void handle(CDOXATransactionCommitContext xaContext, IProgressMonitor progressMonitor) throws Exception
{
- // Phase 2
- CDOClientProtocol protocol = (CDOClientProtocol)xaContext.getTransaction().getSession().getProtocol();
- CommitTransactionCancelRequest request = new CommitTransactionCancelRequest(protocol, xaContext);
- CommitTransactionResult result = request.send(new EclipseMonitor(progressMonitor));
+ CDOSessionProtocol sessionProtocol = xaContext.getTransaction().getSession().getSessionProtocol();
+ OMMonitor monitor = new EclipseMonitor(progressMonitor);
+ CommitTransactionResult result = sessionProtocol.commitTransactionCancel(xaContext, monitor);
check_result(result);
}
};
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOAuditImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOAuditImpl.java
index 38f7fbbb4a..6c316689d5 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOAuditImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOAuditImpl.java
@@ -17,10 +17,6 @@ import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevision;
import org.eclipse.emf.cdo.view.CDOAudit;
import org.eclipse.emf.internal.cdo.CDOStateMachine;
-import org.eclipse.emf.internal.cdo.protocol.CDOClientProtocol;
-import org.eclipse.emf.internal.cdo.protocol.SetAuditRequest;
-
-import org.eclipse.net4j.util.WrappedException;
import org.eclipse.emf.spi.cdo.InternalCDOObject;
import org.eclipse.emf.spi.cdo.InternalCDOSession;
@@ -64,7 +60,7 @@ public class CDOAuditImpl extends CDOViewImpl implements CDOAudit
if (this.timeStamp != timeStamp)
{
List<InternalCDOObject> invalidObjects = getInvalidObjects(timeStamp);
- boolean[] existanceFlags = sendSetAuditRequest(timeStamp, invalidObjects);
+ boolean[] existanceFlags = getSession().getSessionProtocol().setAudit(getViewID(), timeStamp, invalidObjects);
this.timeStamp = timeStamp;
int i = 0;
@@ -85,19 +81,6 @@ public class CDOAuditImpl extends CDOViewImpl implements CDOAudit
}
}
- private boolean[] sendSetAuditRequest(long timeStamp, List<InternalCDOObject> invalidObjects)
- {
- try
- {
- CDOClientProtocol protocol = (CDOClientProtocol)getSession().getProtocol();
- return new SetAuditRequest(protocol, getViewID(), timeStamp, invalidObjects).send();
- }
- catch (Exception ex)
- {
- throw WrappedException.wrap(ex);
- }
- }
-
@Override
public InternalCDORevision getRevision(CDOID id, boolean loadOnDemand)
{
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java
index fe217709e6..12dabb5fc7 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java
@@ -58,20 +58,12 @@ import org.eclipse.emf.internal.cdo.CDOStateMachine;
import org.eclipse.emf.internal.cdo.CDOStore;
import org.eclipse.emf.internal.cdo.CDOURIHandler;
import org.eclipse.emf.internal.cdo.bundle.OM;
-import org.eclipse.emf.internal.cdo.protocol.CDOClientProtocol;
-import org.eclipse.emf.internal.cdo.protocol.ChangeSubscriptionRequest;
-import org.eclipse.emf.internal.cdo.protocol.LockObjectsRequest;
-import org.eclipse.emf.internal.cdo.protocol.ObjectLockedRequest;
-import org.eclipse.emf.internal.cdo.protocol.UnlockObjectsRequest;
-import org.eclipse.emf.internal.cdo.protocol.ViewsChangedRequest;
import org.eclipse.emf.internal.cdo.query.CDOQueryImpl;
import org.eclipse.emf.internal.cdo.util.FSMUtil;
import org.eclipse.emf.internal.cdo.util.ModelUtil;
-import org.eclipse.net4j.signal.RemoteException;
import org.eclipse.net4j.util.ImplementationError;
import org.eclipse.net4j.util.StringUtil;
-import org.eclipse.net4j.util.WrappedException;
import org.eclipse.net4j.util.ReflectUtil.ExcludeFromDump;
import org.eclipse.net4j.util.collection.CloseableIterator;
import org.eclipse.net4j.util.collection.HashBag;
@@ -82,7 +74,6 @@ import org.eclipse.net4j.util.om.trace.ContextTracer;
import org.eclipse.net4j.util.options.OptionsEvent;
import org.eclipse.net4j.util.ref.ReferenceType;
import org.eclipse.net4j.util.ref.ReferenceValueMap;
-import org.eclipse.net4j.util.transaction.TransactionException;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notification;
@@ -286,39 +277,7 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView
throws InterruptedException
{
checkActive();
- InterruptedException interruptedException = null;
- RuntimeException runtimeException = null;
-
- try
- {
- CDOClientProtocol protocol = (CDOClientProtocol)getSession().getProtocol();
- new LockObjectsRequest(protocol, this, objects, timeout, lockType).send();
- }
- catch (RemoteException ex)
- {
- if (ex.getCause() instanceof RuntimeException)
- {
- runtimeException = (RuntimeException)ex.getCause();
- }
- else if (ex.getCause() instanceof InterruptedException)
- {
- interruptedException = (InterruptedException)ex.getCause();
- }
- }
- catch (Exception ex)
- {
- throw WrappedException.wrap(ex);
- }
-
- if (interruptedException != null)
- {
- throw interruptedException;
- }
-
- if (runtimeException != null)
- {
- throw runtimeException;
- }
+ session.getSessionProtocol().lockObjects(this, objects, timeout, lockType);
}
/**
@@ -327,16 +286,7 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView
public void unlockObjects(Collection<? extends CDOObject> objects, RWLockManager.LockType lockType)
{
checkActive();
-
- try
- {
- CDOClientProtocol protocol = (CDOClientProtocol)getSession().getProtocol();
- new UnlockObjectsRequest(protocol, this, objects, lockType).send();
- }
- catch (Exception ex)
- {
- throw WrappedException.wrap(ex);
- }
+ session.getSessionProtocol().unlockObjects(this, objects, lockType);
}
/**
@@ -354,16 +304,7 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView
public boolean isObjectLocked(CDOObject object, RWLockManager.LockType lockType)
{
checkActive();
-
- try
- {
- CDOClientProtocol protocol = (CDOClientProtocol)getSession().getProtocol();
- return new ObjectLockedRequest(protocol, this, object, lockType).send();
- }
- catch (Exception ex)
- {
- throw WrappedException.wrap(ex);
- }
+ return session.getSessionProtocol().isObjectLocked(this, object, lockType);
}
/**
@@ -1465,8 +1406,7 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView
@Override
protected void doActivate() throws Exception
{
- CDOClientProtocol protocol = (CDOClientProtocol)getSession().getProtocol();
- new ViewsChangedRequest(protocol, getViewID(), getProtocolViewType(), getTimeStamp()).send();
+ session.getSessionProtocol().openView(getViewID(), getProtocolViewType(), getTimeStamp());
}
/**
@@ -1475,9 +1415,7 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView
@Override
protected void doDeactivate() throws Exception
{
- CDOClientProtocol protocol = (CDOClientProtocol)getSession().getProtocol();
- new ViewsChangedRequest(protocol, getViewID()).send();
-
+ session.getSessionProtocol().closeView(getViewID());
session.viewDetached(this);
session = null;
objects = null;
@@ -1722,15 +1660,7 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView
protected void request(List<CDOID> cdoIDs, boolean clear, boolean subscribeMode)
{
- try
- {
- CDOClientProtocol protocol = (CDOClientProtocol)getSession().getProtocol();
- new ChangeSubscriptionRequest(protocol, getViewID(), cdoIDs, subscribeMode, clear).send();
- }
- catch (Exception ex)
- {
- throw new TransactionException(ex);
- }
+ session.getSessionProtocol().changeSubscription(getViewID(), cdoIDs, subscribeMode, clear);
}
protected int getNumberOfValidAdapter(InternalCDOObject object)
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/PluginContainerViewProvider.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/PluginContainerViewProvider.java
index f43a4cf47d..f72bc0bfaa 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/PluginContainerViewProvider.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/PluginContainerViewProvider.java
@@ -17,6 +17,7 @@ import org.eclipse.emf.cdo.view.CDOViewProvider;
import org.eclipse.emf.cdo.view.CDOViewSet;
import org.eclipse.emf.cdo.view.ManagedContainerViewProvider;
+import org.eclipse.emf.internal.cdo.net4j.CDONet4jSessionFactory;
import org.eclipse.emf.internal.cdo.session.CDOSessionFactory;
import org.eclipse.net4j.util.container.IManagedContainer;
@@ -49,7 +50,7 @@ public class PluginContainerViewProvider extends ManagedContainerViewProvider im
}
String repoUUID = CDOURIUtil.extractRepositoryUUID(uri);
- for (Object element : container.getElements(CDOSessionFactory.PRODUCT_GROUP, CDOSessionFactory.TYPE))
+ for (Object element : container.getElements(CDOSessionFactory.PRODUCT_GROUP, CDONet4jSessionFactory.TYPE))
{
CDOSession session = (CDOSession)element;
String uuid = session.repository().getUUID();
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/CDOSessionProtocol.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/CDOSessionProtocol.java
new file mode 100644
index 0000000000..08ae06587c
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/CDOSessionProtocol.java
@@ -0,0 +1,93 @@
+/***************************************************************************
+ * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ **************************************************************************/
+package org.eclipse.emf.spi.cdo;
+
+import org.eclipse.emf.cdo.CDOObject;
+import org.eclipse.emf.cdo.common.id.CDOID;
+import org.eclipse.emf.cdo.common.model.CDOFeature;
+import org.eclipse.emf.cdo.common.model.CDOPackage;
+import org.eclipse.emf.cdo.common.revision.CDORevision;
+import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevision;
+import org.eclipse.emf.cdo.transaction.CDOTimeStampContext;
+import org.eclipse.emf.cdo.view.CDOView;
+
+import org.eclipse.emf.internal.cdo.net4j.protocol.CommitTransactionResult;
+import org.eclipse.emf.internal.cdo.net4j.protocol.OpenSessionResult;
+import org.eclipse.emf.internal.cdo.net4j.protocol.RepositoryTimeResult;
+import org.eclipse.emf.internal.cdo.query.CDOAbstractQueryIteratorImpl;
+import org.eclipse.emf.internal.cdo.transaction.CDOXATransactionCommitContext;
+
+import org.eclipse.net4j.util.concurrent.RWLockManager.LockType;
+import org.eclipse.net4j.util.om.monitor.OMMonitor;
+
+import java.io.File;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author Eike Stepper
+ */
+public interface CDOSessionProtocol
+{
+ public OpenSessionResult openSession(String repositoryName, boolean passiveUpdateEnabled);
+
+ public void loadLibraries(Set<String> missingLibraries, File cacheFolder);
+
+ public void setPassiveUpdate(Map<CDOID, CDORevision> allRevisions, int initialChunkSize, boolean passiveUpdateEnabled);
+
+ public RepositoryTimeResult getRepositoryTime();
+
+ public String loadPackage(CDOPackage cdoPackage, boolean onlyEcore);
+
+ public Object loadChunk(InternalCDORevision revision, CDOFeature feature, int accessIndex, int fetchIndex,
+ int fromIndex, int toIndex);
+
+ public List<InternalCDORevision> loadRevisions(Collection<CDOID> ids, int referenceChunk);
+
+ public List<InternalCDORevision> loadRevisionsByTime(Collection<CDOID> ids, int referenceChunk, long timeStamp);
+
+ public InternalCDORevision loadRevisionByVersion(CDOID id, int referenceChunk, int version);
+
+ public List<InternalCDORevision> verifyRevision(List<InternalCDORevision> revisions);
+
+ public Collection<CDOTimeStampContext> syncRevisions(Map<CDOID, CDORevision> allRevisions, int initialChunkSize);
+
+ public void openView(int viewId, byte protocolViewType, long timeStamp);
+
+ public void closeView(int viewId);
+
+ public boolean[] setAudit(int viewId, long timeStamp, List<InternalCDOObject> invalidObjects);
+
+ public void changeSubscription(int viewId, List<CDOID> cdoIDs, boolean subscribeMode, boolean clear);
+
+ public List<Object> query(int viewID, CDOAbstractQueryIteratorImpl<?> queryResult);
+
+ public boolean cancelQuery(int queryId);
+
+ public void lockObjects(CDOView view, Collection<? extends CDOObject> objects, long timeout, LockType lockType)
+ throws InterruptedException;
+
+ public void unlockObjects(CDOView view, Collection<? extends CDOObject> objects, LockType lockType);
+
+ public boolean isObjectLocked(CDOView view, CDOObject object, LockType lockType);
+
+ public CommitTransactionResult commitTransaction(InternalCDOCommitContext commitContext, OMMonitor monitor);
+
+ public CommitTransactionResult commitTransactionPhase1(CDOXATransactionCommitContext xaContext, OMMonitor monitor);
+
+ public CommitTransactionResult commitTransactionPhase2(CDOXATransactionCommitContext xaContext, OMMonitor monitor);
+
+ public CommitTransactionResult commitTransactionPhase3(CDOXATransactionCommitContext xaContext, OMMonitor monitor);
+
+ public CommitTransactionResult commitTransactionCancel(CDOXATransactionCommitContext xaContext, OMMonitor monitor);
+}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/CDOTransactionStrategy.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/CDOTransactionStrategy.java
index 84955a3b47..90e7922d59 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/CDOTransactionStrategy.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/CDOTransactionStrategy.java
@@ -14,9 +14,13 @@ import org.eclipse.emf.cdo.transaction.CDOSavepoint;
import org.eclipse.emf.internal.cdo.transaction.CDOSingleTransactionStrategy;
+import org.eclipse.net4j.util.om.monitor.OMMonitor;
+
import org.eclipse.core.runtime.IProgressMonitor;
/**
+ * TODO Simon: JavaDoc
+ *
* @author Simon McDuff
* @since 2.0
*/
@@ -28,6 +32,9 @@ public interface CDOTransactionStrategy
public void unsetTarget(InternalCDOTransaction transaction);
+ /**
+ * TODO Better use an {@link OMMonitor}?
+ */
public void commit(InternalCDOTransaction transaction, IProgressMonitor progressMonitor) throws Exception;
public void rollback(InternalCDOTransaction transaction, CDOSavepoint savepoint);
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOCommitContext.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOCommitContext.java
index 07ba083a81..c4075a074b 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOCommitContext.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOCommitContext.java
@@ -13,7 +13,7 @@ package org.eclipse.emf.spi.cdo;
import org.eclipse.emf.cdo.transaction.CDOCommitContext;
-import org.eclipse.emf.internal.cdo.protocol.CommitTransactionResult;
+import org.eclipse.emf.internal.cdo.net4j.protocol.CommitTransactionResult;
/**
* Provides a context for a commit operation.
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOSession.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOSession.java
index 237324ec86..5e7c5f15b9 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOSession.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOSession.java
@@ -16,7 +16,6 @@ import org.eclipse.emf.cdo.common.id.CDOIDMetaRange;
import org.eclipse.emf.cdo.common.id.CDOIDObjectFactory;
import org.eclipse.emf.cdo.common.model.CDOPackageURICompressor;
import org.eclipse.emf.cdo.common.revision.delta.CDORevisionDelta;
-import org.eclipse.emf.cdo.net4j.CDOSessionProtocol;
import org.eclipse.emf.cdo.session.CDOPackageRegistry;
import org.eclipse.emf.cdo.session.CDOSession;
@@ -35,7 +34,7 @@ import java.util.Set;
public interface InternalCDOSession extends CDOSession, CDOIDObjectFactory, CDOPackageURICompressor,
ILifecycle.Introspection
{
- public CDOSessionProtocol getProtocol();
+ public CDOSessionProtocol getSessionProtocol();
public void setRepositoryName(String repositoryName);

Back to the top