summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-08-12 02:30:29 (EDT)
committerEike Stepper2007-08-12 02:30:29 (EDT)
commitce55e0593251f66502e71381487560ef9a01b0b2 (patch)
treee42cf3d35f2f1b045cc13e89e96a20430f6c38de
parentc31109a9ccf8c1aa95602a93f7c186c5ba20bef8 (diff)
downloadcdo-ce55e0593251f66502e71381487560ef9a01b0b2.zip
cdo-ce55e0593251f66502e71381487560ef9a01b0b2.tar.gz
cdo-ce55e0593251f66502e71381487560ef9a01b0b2.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java37
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/View.java10
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/bundle/OM.java7
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CommitTransactionIndication.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/OpenSessionIndication.java3
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IRepositoryManager.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IView.java10
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/EntryAction.java1
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditorInput.java18
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOItemProvider.java20
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOView.java18
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAuditImpl.java12
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java30
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java16
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java64
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CommitTransactionRequest.java1
16 files changed, 129 insertions, 122 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 7d2f49c..3d9ab3b 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
@@ -22,9 +22,11 @@ import org.eclipse.emf.cdo.protocol.model.CDOClassRef;
import org.eclipse.emf.cdo.server.ISession;
import org.eclipse.emf.cdo.server.ISessionViewsEvent;
import org.eclipse.emf.cdo.server.IView;
+import org.eclipse.emf.cdo.server.IView.Type;
import org.eclipse.net4j.internal.util.container.SingleDeltaContainerEvent;
import org.eclipse.net4j.internal.util.event.Notifier;
+import org.eclipse.net4j.util.ImplementationError;
import org.eclipse.net4j.util.container.IContainerDelta;
import org.eclipse.net4j.util.container.IContainerDelta.Kind;
@@ -87,27 +89,36 @@ public class Session extends Notifier implements ISession, CDOIDProvider
public void notifyViewsChanged(Session session, int viewID, byte kind)
{
- switch (kind)
- {
- case CDOProtocolConstants.VIEW_ADDED:
- {
- View view = new View(this, viewID);
- views.put(viewID, view);
- fireEvent(new ViewsEvent(view, IContainerDelta.Kind.ADDED));
- break;
- }
-
- case CDOProtocolConstants.VIEW_REMOVED:
+ if (kind == CDOProtocolConstants.VIEW_CLOSED)
{
View view = views.remove(viewID);
if (view != null)
{
fireEvent(new ViewsEvent(view, IContainerDelta.Kind.REMOVED));
}
-
- break;
}
+ else
+ {
+ IView.Type viewType = getViewType(kind);
+ View view = new View(this, viewID, viewType);
+ views.put(viewID, view);
+ fireEvent(new ViewsEvent(view, IContainerDelta.Kind.ADDED));
+ }
+ }
+
+ private Type getViewType(byte kind)
+ {
+ switch (kind)
+ {
+ case CDOProtocolConstants.VIEW_TRANSACTION:
+ return Type.TRANSACTION;
+ case CDOProtocolConstants.VIEW_READONLY:
+ return Type.READONLY;
+ case CDOProtocolConstants.VIEW_AUDIT:
+ return Type.AUDIT;
}
+
+ throw new ImplementationError("Invalid kind: " + kind);
}
public void notifyInvalidation(long timeStamp, CDORevisionImpl[] dirtyObjects)
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/View.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/View.java
index 08f2f2a..e78ca12 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/View.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/View.java
@@ -21,10 +21,13 @@ public class View implements IView
private int viewID;
- public View(Session session, int viewID)
+ private Type viewType;
+
+ public View(Session session, int viewID, Type viewType)
{
this.session = session;
this.viewID = viewID;
+ this.viewType = viewType;
}
public Session getSession()
@@ -36,4 +39,9 @@ public class View implements IView
{
return viewID;
}
+
+ public Type getViewType()
+ {
+ return viewType;
+ }
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/bundle/OM.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/bundle/OM.java
index c08135a..514e26f 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/bundle/OM.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/bundle/OM.java
@@ -10,8 +10,9 @@
**************************************************************************/
package org.eclipse.emf.cdo.internal.server.bundle;
-import org.eclipse.emf.cdo.internal.server.RepositoryManager;
+import org.eclipse.emf.cdo.server.IRepositoryManager;
+import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
import org.eclipse.net4j.util.om.OMBundle;
import org.eclipse.net4j.util.om.OMPlatform;
import org.eclipse.net4j.util.om.OSGiActivator;
@@ -45,12 +46,12 @@ public abstract class OM
static void start() throws Exception
{
- RepositoryManager.INSTANCE.activate();
+ LifecycleUtil.activate(IRepositoryManager.INSTANCE);
}
static void stop() throws Exception
{
- RepositoryManager.INSTANCE.deactivate();
+ LifecycleUtil.deactivate(IRepositoryManager.INSTANCE);
}
/**
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CommitTransactionIndication.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CommitTransactionIndication.java
index 4270cd2..36d4263 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CommitTransactionIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CommitTransactionIndication.java
@@ -63,7 +63,7 @@ public class CommitTransactionIndication extends CDOServerIndication
protected void indicating(final ExtendedDataInputStream in) throws IOException
{
timeStamp = System.currentTimeMillis();
-
+ int viewID = in.readInt();
transact(new Runnable()
{
public void run()
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 a294502..5ace6f7 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
@@ -65,7 +65,8 @@ public class OpenSessionIndication extends IndicationWithResponse
{
try
{
- Repository repository = RepositoryManager.INSTANCE.getRepository(repositoryName);
+ RepositoryManager repositoryManager = RepositoryManager.INSTANCE;
+ Repository repository = repositoryManager.getRepository(repositoryName);
SessionManager sessionManager = repository.getSessionManager();
CDOServerProtocol serverProtocol = (CDOServerProtocol)getProtocol();
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IRepositoryManager.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IRepositoryManager.java
index 5eef8ae..fc04b21 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IRepositoryManager.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IRepositoryManager.java
@@ -24,7 +24,7 @@ public interface IRepositoryManager
public IRepository[] getRepositories();
/**
- * @return Never <code>null</code>
+ * @return Never <code>null</code>.
*/
public IRepository getRepository(String name) throws RepositoryNotFoundException;
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IView.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IView.java
index 3d6ee65..2a40891 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IView.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IView.java
@@ -18,4 +18,14 @@ public interface IView
public ISession getSession();
public int getViewID();
+
+ public Type getViewType();
+
+ /**
+ * @author Eike Stepper
+ */
+ public enum Type
+ {
+ TRANSACTION, READONLY, AUDIT
+ }
}
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/EntryAction.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/EntryAction.java
index 7e4d483..a433de7 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/EntryAction.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/EntryAction.java
@@ -1,7 +1,6 @@
package org.eclipse.emf.cdo.internal.ui.actions;
import org.eclipse.emf.cdo.internal.ui.views.CDOViewHistory;
-import org.eclipse.emf.cdo.internal.ui.views.CDOViewHistory.Entry;
import org.eclipse.net4j.ui.actions.LongRunningAction;
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditorInput.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditorInput.java
index bee7ded..948837c 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditorInput.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditorInput.java
@@ -57,17 +57,17 @@ public class CDOEditorInput extends PlatformObject implements IEditorInput
public ImageDescriptor getImageDescriptor()
{
- if (view.isAudit())
- {
- return SharedIcons.getDescriptor(SharedIcons.OBJ_EDITOR_HISTORICAL);
- }
-
- if (view.isReadOnly())
+ switch (view.getViewType())
{
+ case TRANSACTION:
+ return SharedIcons.getDescriptor(SharedIcons.OBJ_EDITOR);
+ case READONLY:
return SharedIcons.getDescriptor(SharedIcons.OBJ_EDITOR_READONLY);
+ case AUDIT:
+ return SharedIcons.getDescriptor(SharedIcons.OBJ_EDITOR_HISTORICAL);
}
- return SharedIcons.getDescriptor(SharedIcons.OBJ_EDITOR);
+ return null;
}
public String getName()
@@ -103,10 +103,10 @@ public class CDOEditorInput extends PlatformObject implements IEditorInput
builder.append(" [");
builder.append(session.getSessionID());
builder.append(":");
- builder.append(view.getID());
+ builder.append(view.getViewID());
builder.append("]");
- if (view.isReadOnly())
+ if (view.getViewType() != CDOView.Type.TRANSACTION)
{
builder.append(" readonly");
}
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOItemProvider.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOItemProvider.java
index 9bb9075..6522178 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOItemProvider.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOItemProvider.java
@@ -202,17 +202,15 @@ public class CDOItemProvider extends ContainerItemProvider
if (obj instanceof CDOView)
{
CDOView view = (CDOView)obj;
- if (view.isAudit())
- {
- return SharedIcons.getImage(SharedIcons.OBJ_EDITOR_HISTORICAL);
- }
-
- if (view.isReadOnly())
+ switch (view.getViewType())
{
+ case TRANSACTION:
+ return SharedIcons.getImage(SharedIcons.OBJ_EDITOR);
+ case READONLY:
return SharedIcons.getImage(SharedIcons.OBJ_EDITOR_READONLY);
+ case AUDIT:
+ return SharedIcons.getImage(SharedIcons.OBJ_EDITOR_HISTORICAL);
}
-
- return SharedIcons.getImage(SharedIcons.OBJ_EDITOR);
}
return super.getImage(obj);
@@ -230,7 +228,7 @@ public class CDOItemProvider extends ContainerItemProvider
if (view instanceof CDOTransaction)
{
CDOTransaction transaction = (CDOTransaction)view;
- return MessageFormat.format("{0}Transaction [{1}]", transaction.isDirty() ? "*" : "", transaction.getID());
+ return MessageFormat.format("{0}Transaction [{1}]", transaction.isDirty() ? "*" : "", transaction.getViewID());
}
if (view instanceof CDOAudit)
@@ -239,7 +237,7 @@ public class CDOItemProvider extends ContainerItemProvider
return MessageFormat.format("Audit [{0,date} {0,time}]", audit.getTimeStamp());
}
- return MessageFormat.format("View [{0}]", view.getID());
+ return MessageFormat.format("View [{0}]", view.getViewID());
}
public static String getHistroyEntryLabel(CDOViewHistory.Entry entry)
@@ -283,7 +281,7 @@ public class CDOItemProvider extends ContainerItemProvider
protected void fillView(IMenuManager manager, CDOView view)
{
manager.add(new LoadResourceAction(page, view));
- if (view.isTransaction())
+ if (view.getViewType() == CDOView.Type.TRANSACTION)
{
manager.add(new CreateResourceAction(page, view));
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOView.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOView.java
index 2ca373f..9d9a50e 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOView.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOView.java
@@ -26,7 +26,9 @@ public interface CDOView extends INotifier
{
public static final long UNSPECIFIED_DATE = CDORevision.UNSPECIFIED_DATE;
- public int getID();
+ public int getViewID();
+
+ public Type getViewType();
public CDOSession getSession();
@@ -34,12 +36,6 @@ public interface CDOView extends INotifier
public boolean isDirty();
- public boolean isTransaction();
-
- public boolean isReadOnly();
-
- public boolean isAudit();
-
/**
* @see ResourceSet#getResource(URI, boolean)
*/
@@ -50,4 +46,12 @@ public interface CDOView extends INotifier
public CDORevision getRevision(CDOID id);
public void close();
+
+ /**
+ * @author Eike Stepper
+ */
+ public enum Type
+ {
+ TRANSACTION, READONLY, AUDIT
+ }
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAuditImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAuditImpl.java
index 181abd8..5dd9de5 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAuditImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAuditImpl.java
@@ -30,15 +30,15 @@ public class CDOAuditImpl extends CDOViewImpl implements CDOAudit
this.timeStamp = timeStamp;
}
- public long getTimeStamp()
+ @Override
+ public Type getViewType()
{
- return timeStamp;
+ return Type.AUDIT;
}
- @Override
- public boolean isAudit()
+ public long getTimeStamp()
{
- return true;
+ return timeStamp;
}
@Override
@@ -51,6 +51,6 @@ public class CDOAuditImpl extends CDOViewImpl implements CDOAudit
@Override
public String toString()
{
- return MessageFormat.format("CDOAudit({0})", getID());
+ return MessageFormat.format("CDOAudit({0})", getViewID());
}
}
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 ebc1965..8325b67 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
@@ -259,7 +259,7 @@ public class CDOSessionImpl extends Lifecycle implements CDOSession
try
{
- new ViewsChangedNotification(channel, view.getID(), CDOProtocolConstants.VIEW_REMOVED).send();
+ new ViewsChangedNotification(channel, view.getViewID(), CDOProtocolConstants.VIEW_CLOSED).send();
}
catch (Exception ex)
{
@@ -494,17 +494,39 @@ public class CDOSessionImpl extends Lifecycle implements CDOSession
views.put(resourceSet, view);
}
+ resourceSet.eAdapters().add(view);
+ sendViewsNotification(view);
+ fireEvent(new ViewsEvent(view, IContainerDelta.Kind.ADDED));
+ }
+
+ private void sendViewsNotification(CDOViewImpl view)
+ {
try
{
- new ViewsChangedNotification(channel, view.getID(), CDOProtocolConstants.VIEW_ADDED).send();
+ int id = view.getViewID();
+ byte kind = getKind(view);
+ new ViewsChangedNotification(channel, id, kind).send();
}
catch (Exception ex)
{
throw WrappedException.wrap(ex);
}
+ }
+
+ private byte getKind(CDOViewImpl view)
+ {
+ CDOView.Type type = view.getViewType();
+ switch (type)
+ {
+ case TRANSACTION:
+ return CDOProtocolConstants.VIEW_TRANSACTION;
+ case READONLY:
+ return CDOProtocolConstants.VIEW_READONLY;
+ case AUDIT:
+ return CDOProtocolConstants.VIEW_AUDIT;
+ }
- resourceSet.eAdapters().add(view);
- fireEvent(new ViewsEvent(view, IContainerDelta.Kind.ADDED));
+ throw new ImplementationError("Invalid view type: " + type);
}
/**
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java
index 249ca32..f7ef9c8 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java
@@ -60,21 +60,15 @@ public class CDOTransactionImpl extends CDOViewImpl implements CDOTransaction
}
@Override
- public boolean isDirty()
- {
- return dirty;
- }
-
- @Override
- public boolean isTransaction()
+ public Type getViewType()
{
- return true;
+ return Type.TRANSACTION;
}
@Override
- public boolean isReadOnly()
+ public boolean isDirty()
{
- return false;
+ return dirty;
}
public List<CDOPackageImpl> getNewPackages()
@@ -185,7 +179,7 @@ public class CDOTransactionImpl extends CDOViewImpl implements CDOTransaction
@Override
public String toString()
{
- return MessageFormat.format("CDOTransaction({0})", getID());
+ return MessageFormat.format("CDOTransaction({0})", getViewID());
}
public void registerNew(InternalCDOObject object)
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java
index 34a5323..7ece4f3 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java
@@ -61,7 +61,7 @@ public class CDOViewImpl extends org.eclipse.net4j.internal.util.event.Notifier
{
private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG_VIEW, CDOViewImpl.class);
- private int id;
+ private int viewID;
private CDOSessionImpl session;
@@ -77,13 +77,18 @@ public class CDOViewImpl extends org.eclipse.net4j.internal.util.event.Notifier
public CDOViewImpl(int id, CDOSessionImpl session)
{
- this.id = id;
+ this.viewID = id;
this.session = session;
}
- public int getID()
+ public int getViewID()
{
- return id;
+ return viewID;
+ }
+
+ public Type getViewType()
+ {
+ return Type.READONLY;
}
public ResourceSet getResourceSet()
@@ -106,21 +111,6 @@ public class CDOViewImpl extends org.eclipse.net4j.internal.util.event.Notifier
return false;
}
- public boolean isTransaction()
- {
- return false;
- }
-
- public boolean isReadOnly()
- {
- return true;
- }
-
- public boolean isAudit()
- {
- return false;
- }
-
public CDOTransactionImpl toTransaction()
{
if (this instanceof CDOTransactionImpl)
@@ -529,7 +519,7 @@ public class CDOViewImpl extends org.eclipse.net4j.internal.util.event.Notifier
@Override
public String toString()
{
- return MessageFormat.format("CDOView({0})", id);
+ return MessageFormat.format("CDOView({0})", viewID);
}
public boolean isAdapterForType(Object type)
@@ -692,44 +682,12 @@ public class CDOViewImpl extends org.eclipse.net4j.internal.util.event.Notifier
protected void checkWritable()
{
- if (isReadOnly())
+ if (getViewType() != Type.TRANSACTION)
{
throw new IllegalStateException("CDO view is read only");
}
}
- // public final class HistoryEntryImpl implements HistoryEntry, Comparable
- // {
- // private String resourcePath;
- //
- // private HistoryEntryImpl(String resourcePath)
- // {
- // this.resourcePath = resourcePath;
- // }
- //
- // public CDOView getView()
- // {
- // return CDOViewImpl.this;
- // }
- //
- // public String getResourcePath()
- // {
- // return resourcePath;
- // }
- //
- // public int compareTo(Object o)
- // {
- // HistoryEntry that = (HistoryEntry)o;
- // return resourcePath.compareTo(that.getResourcePath());
- // }
- //
- // @Override
- // public String toString()
- // {
- // return resourcePath;
- // }
- // }
-
/**
* @author Eike Stepper
*/
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/protocol/CommitTransactionRequest.java
index 8f7fea9..aa2ed8a 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/protocol/CommitTransactionRequest.java
@@ -51,6 +51,7 @@ public class CommitTransactionRequest extends CDOClientRequest<CommitTransaction
@Override
protected void requesting(ExtendedDataOutputStream out) throws IOException
{
+ out.writeInt(transaction.getViewID());
writeNewPackages(out);
writeNewResources(out);
writeNewObjects(out);