summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-05-29 16:13:13 (EDT)
committerEike Stepper2008-05-29 16:13:13 (EDT)
commitf4b878cc6ee276bb82a93f6b6c1a5a3425111ea3 (patch)
tree9cd8b3561e0f9b5e70b7946d1f6f053ece32debe
parente58c02e25a3d1a9ae9f0270f7bb82d92c50cb9eb (diff)
downloadcdo-f4b878cc6ee276bb82a93f6b6c1a5a3425111ea3.zip
cdo-f4b878cc6ee276bb82a93f6b6c1a5a3425111ea3.tar.gz
cdo-f4b878cc6ee276bb82a93f6b6c1a5a3425111ea3.tar.bz2
[234702] Change default for legacySupport to false
https://bugs.eclipse.org/bugs/show_bug.cgi?id=234702
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java12
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionManager.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/OpenSessionIndication.java8
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/ISessionManager.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenSessionAction.java4
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOUtil.java6
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionConfigurationImpl.java2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionFactory.java8
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java19
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/LegacySupportEnabler.java (renamed from plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/LegacyObjectDisabler.java)12
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/OpenSessionRequest.java10
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/FSMUtil.java2
12 files changed, 47 insertions, 42 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java
index e821ae9..270c2d2 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java
@@ -51,7 +51,7 @@ public class Session extends Container<IView> implements ISession, CDOIDProvider
private int sessionID;
- private boolean disableLegacyObjects;
+ private boolean legacySupportEnabled;
private ConcurrentMap<Integer, IView> views = new ConcurrentHashMap<Integer, IView>();
@@ -64,13 +64,13 @@ public class Session extends Container<IView> implements ISession, CDOIDProvider
}
};
- public Session(SessionManager sessionManager, CDOServerProtocol protocol, int sessionID, boolean disableLegacyObjects)
+ public Session(SessionManager sessionManager, CDOServerProtocol protocol, int sessionID, boolean legacySupportEnabled)
throws SessionCreationException
{
this.sessionManager = sessionManager;
this.protocol = protocol;
this.sessionID = sessionID;
- this.disableLegacyObjects = disableLegacyObjects;
+ this.legacySupportEnabled = legacySupportEnabled;
protocol.addListener(protocolListener);
try
@@ -93,9 +93,9 @@ public class Session extends Container<IView> implements ISession, CDOIDProvider
return sessionID;
}
- public boolean isDisableLegacyObjects()
+ public boolean isLegacySupportEnabled()
{
- return disableLegacyObjects;
+ return legacySupportEnabled;
}
public CDOServerProtocol getProtocol()
@@ -212,7 +212,7 @@ public class Session extends Container<IView> implements ISession, CDOIDProvider
public CDOID provideCDOID(Object idObject)
{
CDOID id = (CDOID)idObject;
- if (disableLegacyObjects || id.isNull() || id.isMeta())
+ if (!legacySupportEnabled || id.isNull() || id.isMeta())
{
return id;
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionManager.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionManager.java
index 7adafdb..5555cd2 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionManager.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionManager.java
@@ -71,7 +71,7 @@ public class SessionManager extends Container<ISession> implements ISessionManag
}
}
- public Session openSession(CDOServerProtocol protocol, boolean disableLegacyObjects) throws SessionCreationException
+ public Session openSession(CDOServerProtocol protocol, boolean legacySupportEnabled) throws SessionCreationException
{
int id = ++lastSessionID;
if (TRACER.isEnabled())
@@ -79,7 +79,7 @@ public class SessionManager extends Container<ISession> implements ISessionManag
TRACER.trace("Opening session " + id);
}
- Session session = new Session(this, protocol, id, disableLegacyObjects);
+ Session session = new Session(this, protocol, id, legacySupportEnabled);
synchronized (sessions)
{
sessions.put(id, session);
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/OpenSessionIndication.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/OpenSessionIndication.java
index 279efac..de0afa7 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/OpenSessionIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/OpenSessionIndication.java
@@ -40,7 +40,7 @@ public class OpenSessionIndication extends IndicationWithResponse
private String repositoryName;
- private boolean disableLegacyObjects;
+ private boolean legacySupportEnabled;
public OpenSessionIndication()
{
@@ -61,10 +61,10 @@ public class OpenSessionIndication extends IndicationWithResponse
PROTOCOL.format("Read repositoryName: {0}", repositoryName);
}
- disableLegacyObjects = in.readBoolean();
+ legacySupportEnabled = in.readBoolean();
if (PROTOCOL.isEnabled())
{
- PROTOCOL.format("Read disableLegacyObjects: {0}", disableLegacyObjects);
+ PROTOCOL.format("Read legacySupportEnabled: {0}", legacySupportEnabled);
}
}
@@ -77,7 +77,7 @@ public class OpenSessionIndication extends IndicationWithResponse
SessionManager sessionManager = repository.getSessionManager();
CDOServerProtocol serverProtocol = (CDOServerProtocol)getProtocol();
- Session session = sessionManager.openSession(serverProtocol, disableLegacyObjects);
+ Session session = sessionManager.openSession(serverProtocol, legacySupportEnabled);
serverProtocol.setInfraStructure(session);
writeSessionID(out, session);
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/ISessionManager.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/ISessionManager.java
index 49ba7b1..785b6db 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/ISessionManager.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/ISessionManager.java
@@ -24,5 +24,5 @@ public interface ISessionManager extends IRepositoryElement, IContainer<ISession
/**
* @return Never <code>null</code>
*/
- public ISession openSession(CDOServerProtocol protocol, boolean disableLegacyObjects) throws SessionCreationException;
+ public ISession openSession(CDOServerProtocol protocol, boolean legacySupportEnabled) throws SessionCreationException;
}
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenSessionAction.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenSessionAction.java
index a7840ba..97fada3 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenSessionAction.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/OpenSessionAction.java
@@ -55,9 +55,9 @@ public final class OpenSessionAction extends LongRunningAction
builder.append("&automaticPackageRegistry=true");
}
- if (!dialog.isLegacyModelSupport())
+ if (dialog.isLegacyModelSupport())
{
- builder.append("&disableLegacyObjects=true");
+ builder.append("&legacySupportEnabled=true");
}
description = builder.toString();
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 f482fdd..0e5f4ce 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
@@ -19,7 +19,7 @@ import org.eclipse.emf.internal.cdo.CDOSessionConfigurationImpl;
import org.eclipse.emf.internal.cdo.CDOStateMachine;
import org.eclipse.emf.internal.cdo.CDOViewImpl;
import org.eclipse.emf.internal.cdo.InternalCDOObject;
-import org.eclipse.emf.internal.cdo.LegacyObjectDisabler;
+import org.eclipse.emf.internal.cdo.LegacySupportEnabler;
import org.eclipse.emf.internal.cdo.protocol.CDOClientProtocolFactory;
import org.eclipse.emf.internal.cdo.util.CDOPackageRegistryImpl;
import org.eclipse.emf.internal.cdo.util.FSMUtil;
@@ -91,10 +91,10 @@ public final class CDOUtil
map.put(CDOProtocolConstants.PROTOCOL_NAME, factory);
}
- public static void prepareContainer(IManagedContainer container, boolean disableLegacyObjects)
+ public static void prepareContainer(IManagedContainer container, boolean legacySupportEnabled)
{
container.registerFactory(new CDOClientProtocolFactory());
- container.addPostProcessor(new LegacyObjectDisabler(disableLegacyObjects));
+ container.addPostProcessor(new LegacySupportEnabler(legacySupportEnabled));
}
public static String extractResourcePath(URI uri)
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionConfigurationImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionConfigurationImpl.java
index fb43580..e662974 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionConfigurationImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionConfigurationImpl.java
@@ -125,7 +125,7 @@ public class CDOSessionConfigurationImpl implements CDOSessionConfiguration
session = new CDOSessionImpl();
session.setConnector(connector);
session.setRepositoryName(repositoryName);
- session.setDisableLegacyObjects(!legacySupportEnabled);
+ session.setLegacySupportEnabled(legacySupportEnabled);
session.setFailOverStrategy(failOverStrategy);
session.setPackageRegistry(packageRegistry);
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionFactory.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionFactory.java
index 98e489d..3f0ea35 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionFactory.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionFactory.java
@@ -75,9 +75,9 @@ public class CDOSessionFactory extends Factory
}
String repositoryName = result.get("repositoryName");
- boolean disableLegacyObjects = TRUE.equals(result.get("disableLegacyObjects"));
+ boolean legacySupportEnabled = TRUE.equals(result.get("legacySupportEnabled"));
boolean automaticPackageRegistry = TRUE.equals(result.get("automaticPackageRegistry"));
- return createSession(repositoryName, disableLegacyObjects, automaticPackageRegistry, null);
+ return createSession(repositoryName, legacySupportEnabled, automaticPackageRegistry, null);
}
catch (URISyntaxException ex)
{
@@ -90,7 +90,7 @@ public class CDOSessionFactory extends Factory
return (CDOSession)container.getElement(PRODUCT_GROUP, TYPE, description);
}
- public static CDOSessionImpl createSession(String repositoryName, boolean disableLegacyObjects,
+ public static CDOSessionImpl createSession(String repositoryName, boolean legacySupportEnabled,
boolean automaticPackageRegistry, IFailOverStrategy failOverStrategy)
{
CDOSessionImpl session = new CDOSessionImpl();
@@ -102,7 +102,7 @@ public class CDOSessionFactory extends Factory
}
session.setRepositoryName(repositoryName);
- session.setDisableLegacyObjects(disableLegacyObjects);
+ session.setLegacySupportEnabled(legacySupportEnabled);
session.setFailOverStrategy(failOverStrategy);
return session;
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java
index 552aaa4..06db4f7 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java
@@ -91,7 +91,7 @@ public class CDOSessionImpl extends Container<CDOView> implements CDOSession, CD
private int sessionID;
- private boolean disableLegacyObjects;
+ private boolean legacySupportEnabled;
private int referenceChunkSize;
@@ -165,20 +165,20 @@ public class CDOSessionImpl extends Container<CDOView> implements CDOSession, CD
return cdoidObjectFactory.createCDOIDObject(in);
}
- public boolean isDisableLegacyObjects()
+ public boolean isLegacySupportEnabled()
{
- return disableLegacyObjects;
+ return legacySupportEnabled;
}
- public void setDisableLegacyObjects(boolean disableLegacyObjects)
+ public void setLegacySupportEnabled(boolean legacySupportEnabled)
{
checkInactive();
- if (!disableLegacyObjects && !FSMUtil.isLegacySystemAvailable())
+ if (legacySupportEnabled && !FSMUtil.isLegacySystemAvailable())
{
throw new LegacySystemNotAvailableException();
}
- this.disableLegacyObjects = disableLegacyObjects;
+ this.legacySupportEnabled = legacySupportEnabled;
}
public int getReferenceChunkSize()
@@ -629,6 +629,11 @@ public class CDOSessionImpl extends Container<CDOView> implements CDOSession, CD
protected void doBeforeActivate() throws Exception
{
super.doBeforeActivate();
+ if (legacySupportEnabled && !FSMUtil.isLegacySystemAvailable())
+ {
+ throw new LegacySystemNotAvailableException();
+ }
+
if (channel == null && connector == null)
{
throw new IllegalStateException("channel == null && connector == null");
@@ -656,7 +661,7 @@ public class CDOSessionImpl extends Container<CDOView> implements CDOSession, CD
channel = connector.openChannel(CDOProtocolConstants.PROTOCOL_NAME, this);
}
- OpenSessionRequest request = new OpenSessionRequest(channel, repositoryName, disableLegacyObjects);
+ OpenSessionRequest request = new OpenSessionRequest(channel, repositoryName, legacySupportEnabled);
OpenSessionResult result = request.send();
sessionID = result.getSessionID();
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/LegacyObjectDisabler.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/LegacySupportEnabler.java
index e4f2258..1a6dd32 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/LegacyObjectDisabler.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/LegacySupportEnabler.java
@@ -16,16 +16,16 @@ import org.eclipse.net4j.util.container.IManagedContainer;
/**
* @author Eike Stepper
*/
-public class LegacyObjectDisabler implements IElementProcessor
+public class LegacySupportEnabler implements IElementProcessor
{
- private boolean disableLegacyObjects;
+ private boolean legacySupportEnabled;
- public LegacyObjectDisabler(boolean disableLegacyObjects)
+ public LegacySupportEnabler(boolean legacySupportEnabled)
{
- this.disableLegacyObjects = disableLegacyObjects;
+ this.legacySupportEnabled = legacySupportEnabled;
}
- public LegacyObjectDisabler()
+ public LegacySupportEnabler()
{
this(true);
}
@@ -36,7 +36,7 @@ public class LegacyObjectDisabler implements IElementProcessor
if (element instanceof CDOSessionImpl)
{
CDOSessionImpl session = (CDOSessionImpl)element;
- session.setDisableLegacyObjects(disableLegacyObjects);
+ session.setLegacySupportEnabled(legacySupportEnabled);
}
return element;
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/protocol/OpenSessionRequest.java
index c8c5c24..2c72ba9 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/protocol/OpenSessionRequest.java
@@ -36,13 +36,13 @@ public class OpenSessionRequest extends RequestWithConfirmation<OpenSessionResul
private String repositoryName;
- private boolean disableLegacyObjects;
+ private boolean legacySupportEnabled;
- public OpenSessionRequest(IChannel channel, String repositoryName, boolean disableLegacyObjects)
+ public OpenSessionRequest(IChannel channel, String repositoryName, boolean legacySupportEnabled)
{
super(channel);
this.repositoryName = repositoryName;
- this.disableLegacyObjects = disableLegacyObjects;
+ this.legacySupportEnabled = legacySupportEnabled;
}
@Override
@@ -62,9 +62,9 @@ public class OpenSessionRequest extends RequestWithConfirmation<OpenSessionResul
if (PROTOCOL.isEnabled())
{
- PROTOCOL.format("Writing disableLegacyObjects: {0}", disableLegacyObjects);
+ PROTOCOL.format("Writing legacySupportEnabled: {0}", legacySupportEnabled);
}
- out.writeBoolean(disableLegacyObjects);
+ out.writeBoolean(legacySupportEnabled);
}
@Override
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/FSMUtil.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/FSMUtil.java
index e3f5d2e..118c1c5 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/FSMUtil.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/FSMUtil.java
@@ -77,7 +77,7 @@ public final class FSMUtil
public static void checkLegacySystemAvailability(CDOSession session, CDOObject object)
throws LegacySystemNotAvailableException
{
- if (session.isDisableLegacyObjects() && object instanceof CDOLegacyImpl)
+ if (!session.isLegacySupportEnabled() && object instanceof CDOLegacyImpl)
{
throw new LegacySystemNotAvailableException();
}