Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2009-01-10 08:30:04 -0500
committerEike Stepper2009-01-10 08:30:04 -0500
commit049e0286b7025340c9639e24308b9bb679bab21a (patch)
treed6d147ecd939b70ae1a943bb467b5d551c5d4fc5
parent55a01e3b94ab9700e27f9ac4f3ddd8983d2a6abe (diff)
downloadcdo-049e0286b7025340c9639e24308b9bb679bab21a.tar.gz
cdo-049e0286b7025340c9639e24308b9bb679bab21a.tar.xz
cdo-049e0286b7025340c9639e24308b9bb679bab21a.zip
*** empty log message ***
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/CDONet4jSessionImpl.java13
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CDOClientProtocol.java4
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java36
-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/view/CDOViewImpl.java18
5 files changed, 44 insertions, 29 deletions
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
index f8a958a7de..c5885038bd 100644
--- 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
@@ -25,6 +25,8 @@ import org.eclipse.net4j.util.event.IListener;
import org.eclipse.net4j.util.lifecycle.ILifecycle;
import org.eclipse.net4j.util.lifecycle.LifecycleEventAdapter;
+import org.eclipse.emf.spi.cdo.CDOSessionProtocol;
+
/**
* @author Eike Stepper
*/
@@ -48,6 +50,11 @@ public class CDONet4jSessionImpl extends CDOSessionImpl implements org.eclipse.e
protocol.setInfraStructure(this);
}
+ public CDOSessionProtocol getSessionProtocol()
+ {
+ return protocol;
+ }
+
/**
* @since 2.0
*/
@@ -64,6 +71,12 @@ public class CDONet4jSessionImpl extends CDOSessionImpl implements org.eclipse.e
}
@Override
+ protected OptionsImpl createOptions()
+ {
+ return new OptionsImpl();
+ }
+
+ @Override
protected void doActivate() throws Exception
{
super.doActivate();
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
index cbbe109448..0729675161 100644
--- 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
@@ -87,7 +87,7 @@ public class CDOClientProtocol extends CDOProtocolImpl implements CDOSessionProt
public String loadPackage(CDOPackage cdoPackage, boolean onlyEcore)
{
- return send(new LoadPackageRequest(this, cdoPackage, false));
+ return send(new LoadPackageRequest(this, cdoPackage, onlyEcore));
}
public Object loadChunk(InternalCDORevision revision, CDOFeature feature, int accessIndex, int fetchIndex,
@@ -290,7 +290,7 @@ public class CDOClientProtocol extends CDOProtocolImpl implements CDOSessionProt
try
{
REVISION_LOADING.start(request);
- return send(request);
+ return send((RequestWithConfirmation<List<InternalCDORevision>>)request);
}
finally
{
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 0936b6d079..f4cb760508 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
@@ -68,7 +68,6 @@ 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;
@@ -98,8 +97,6 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter
private int sessionID;
- private CDOSessionProtocol sessionProtocol;
-
private String repositoryName;
private String repositoryUUID;
@@ -143,10 +140,11 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter
/**
* @since 2.0
*/
- protected IOptions options = new OptionsImpl();
+ protected IOptions options;
public CDOSessionImpl()
{
+ options = createOptions();
packageManager = createPackageManager();
revisionManager = createRevisionManager();
}
@@ -159,9 +157,17 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter
/**
* @since 2.0
*/
- public Options options()
+ public OptionsImpl options()
+ {
+ return (OptionsImpl)options;
+ }
+
+ /**
+ * @since 2.0
+ */
+ protected OptionsImpl createOptions()
{
- return (Options)options;
+ return new OptionsImpl();
}
/**
@@ -185,11 +191,6 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter
return cdoidObjectFactory.createCDOIDObject(in);
}
- public CDOSessionProtocol getSessionProtocol()
- {
- return sessionProtocol;
- }
-
/**
* @since 2.0
*/
@@ -244,7 +245,7 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter
private RepositoryTimeResult sendRepositoryTimeRequest()
{
- return sessionProtocol.getRepositoryTime();
+ return getSessionProtocol().getRepositoryTime();
}
/**
@@ -734,7 +735,8 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter
protected void doBeforeActivate() throws Exception
{
super.doBeforeActivate();
- checkState(repositoryName, "repositoryName == null");
+ checkState(getSessionProtocol(), "sessionProtocol");
+ checkState(repositoryName, "repositoryName");
}
@Override
@@ -748,7 +750,7 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter
packageRegistry.setSession(this);
- OpenSessionResult result = sessionProtocol.openSession(repositoryName, options().isPassiveUpdateEnabled());
+ OpenSessionResult result = getSessionProtocol().openSession(repositoryName, options().isPassiveUpdateEnabled());
sessionID = result.getSessionID();
repositoryUUID = result.getRepositoryUUID();
repositoryCreationTime = result.getRepositoryCreationTime();
@@ -813,7 +815,7 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter
missingLibraries.removeAll(existingLibraries);
if (!missingLibraries.isEmpty())
{
- sessionProtocol.loadLibraries(missingLibraries, cacheFolder);
+ getSessionProtocol().loadLibraries(missingLibraries, cacheFolder);
}
}
@@ -901,7 +903,7 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter
if (!allRevisions.isEmpty())
{
int initialChunkSize = options().getCollectionLoadingPolicy().getInitialChunkSize();
- return sessionProtocol.syncRevisions(allRevisions, initialChunkSize);
+ return getSessionProtocol().syncRevisions(allRevisions, initialChunkSize);
}
}
catch (Exception ex)
@@ -1005,7 +1007,7 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter
if (!allRevisions.isEmpty())
{
int initialChunkSize = collectionLoadingPolicy.getInitialChunkSize();
- sessionProtocol.setPassiveUpdate(allRevisions, initialChunkSize, passiveUpdateEnabled);
+ getSessionProtocol().setPassiveUpdate(allRevisions, initialChunkSize, passiveUpdateEnabled);
}
fireEvent(new PassiveUpdateEventImpl());
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 b5ccb0f8fd..6a57ec9632 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
@@ -128,7 +128,7 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
* @since 2.0
*/
@Override
- protected OptionsImpl initOptions()
+ protected OptionsImpl createOptions()
{
return new OptionsImpl();
}
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 12dabb5fc7..b8490ec04e 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
@@ -146,7 +146,7 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView
*/
public CDOViewImpl()
{
- options = initOptions();
+ options = createOptions();
}
/**
@@ -157,14 +157,6 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView
return options;
}
- /**
- * @since 2.0
- */
- protected OptionsImpl initOptions()
- {
- return new OptionsImpl();
- }
-
public int getViewID()
{
return viewID;
@@ -1392,6 +1384,14 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView
/**
* @since 2.0
*/
+ protected OptionsImpl createOptions()
+ {
+ return new OptionsImpl();
+ }
+
+ /**
+ * @since 2.0
+ */
@Override
protected void doBeforeActivate() throws Exception
{

Back to the top