summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-06-30 05:45:36 (EDT)
committerEike Stepper2007-06-30 05:45:36 (EDT)
commita3048f4ca51aea81ceb13a42d9478ff0c89285c8 (patch)
tree6150b1ac5a2573ae314434c7487c6cb2a4253964
parent9cc83e628bbc924ac2ce7ee1310ad6f234d985a3 (diff)
downloadcdo-a3048f4ca51aea81ceb13a42d9478ff0c89285c8.zip
cdo-a3048f4ca51aea81ceb13a42d9478ff0c89285c8.tar.gz
cdo-a3048f4ca51aea81ceb13a42d9478ff0c89285c8.tar.bz2
task 1: Develop 0.8.0
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java10
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditorInput.java22
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOItemProvider.java30
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOSessionsView.java4
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOAdapter.java60
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOObject.java2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOSession.java10
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOSessionAdaptersEvent.java4
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOTransaction.java23
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOView.java40
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java8
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOUtil.java8
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAdapterImpl.java469
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java10
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java46
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java21
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStore.java38
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java9
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java435
19 files changed, 566 insertions, 683 deletions
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java
index 442b11e..eafe1f7 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java
@@ -6,7 +6,7 @@
*/
package org.eclipse.emf.cdo.internal.ui.editor;
-import org.eclipse.emf.cdo.CDOAdapter;
+import org.eclipse.emf.cdo.CDOView;
import org.eclipse.emf.cdo.internal.ui.bundle.CDOUI;
import org.eclipse.emf.cdo.util.CDOUtil;
@@ -133,7 +133,7 @@ public class CDOEditor extends MultiPageEditorPart implements IEditingDomainProv
/**
* @ADDED
*/
- private CDOAdapter adapter;
+ private CDOView adapter;
/**
* This keeps track of the editing domain that is used to track all changes to
@@ -882,7 +882,7 @@ public class CDOEditor extends MultiPageEditorPart implements IEditingDomainProv
/**
* @ADDED
*/
- public CDOAdapter getAdapter()
+ public CDOView getAdapter()
{
return adapter;
}
@@ -897,7 +897,7 @@ public class CDOEditor extends MultiPageEditorPart implements IEditingDomainProv
public void createModel()
{
CDOEditorInput input = (CDOEditorInput)getEditorInput();
- adapter = input.getAdapter();
+ adapter = input.getView();
URI resourceURI = CDOUtil.createURI(input.getResourcePath());
BasicCommandStack commandStack = new BasicCommandStack();
@@ -1659,7 +1659,7 @@ public class CDOEditor extends MultiPageEditorPart implements IEditingDomainProv
/**
* @ADDED
*/
- public static CDOEditor open(IWorkbenchPage page, CDOAdapter adapter, String resourcePath)
+ public static CDOEditor open(IWorkbenchPage page, CDOView adapter, String resourcePath)
{
try
{
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 4be9453..1ad75e5 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
@@ -10,7 +10,7 @@
**************************************************************************/
package org.eclipse.emf.cdo.internal.ui.editor;
-import org.eclipse.emf.cdo.CDOAdapter;
+import org.eclipse.emf.cdo.CDOView;
import org.eclipse.emf.cdo.internal.ui.bundle.SharedIcons;
import org.eclipse.jface.resource.ImageDescriptor;
@@ -24,19 +24,19 @@ import java.text.MessageFormat;
*/
public class CDOEditorInput implements IEditorInput
{
- private CDOAdapter adapter;
+ private CDOView view;
private String resourcePath;
- public CDOEditorInput(CDOAdapter adapter, String resourcePath)
+ public CDOEditorInput(CDOView view, String resourcePath)
{
- this.adapter = adapter;
+ this.view = view;
this.resourcePath = resourcePath;
}
- public CDOAdapter getAdapter()
+ public CDOView getView()
{
- return adapter;
+ return view;
}
public String getResourcePath()
@@ -51,12 +51,12 @@ public class CDOEditorInput implements IEditorInput
public ImageDescriptor getImageDescriptor()
{
- if (adapter.isHistorical())
+ if (view.isHistorical())
{
return SharedIcons.getDescriptor(SharedIcons.OBJ_EDITOR_HISTORICAL);
}
- if (adapter.isReadOnly())
+ if (view.isReadOnly())
{
return SharedIcons.getDescriptor(SharedIcons.OBJ_EDITOR_READONLY);
}
@@ -76,12 +76,12 @@ public class CDOEditorInput implements IEditorInput
public String getToolTipText()
{
- if (adapter.isHistorical())
+ if (view.isHistorical())
{
- return MessageFormat.format("{0} ({1,D})", resourcePath, adapter.getView().getTimeStamp());
+ return MessageFormat.format("{0} ({1,D})", resourcePath, view.getTimeStamp());
}
- if (adapter.isReadOnly())
+ if (view.isReadOnly())
{
return MessageFormat.format("{0} (read only)", resourcePath);
}
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 73445bb..97542e2 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
@@ -10,7 +10,7 @@
**************************************************************************/
package org.eclipse.emf.cdo.internal.ui.views;
-import org.eclipse.emf.cdo.CDOAdapter;
+import org.eclipse.emf.cdo.CDOView;
import org.eclipse.emf.cdo.CDOSession;
import org.eclipse.emf.cdo.internal.ui.bundle.SharedIcons;
import org.eclipse.emf.cdo.internal.ui.editor.CDOEditor;
@@ -58,15 +58,15 @@ public class CDOItemProvider extends ContainerItemProvider
return SharedIcons.getImage(SharedIcons.OBJ_SESSION);
}
- if (obj instanceof CDOAdapter)
+ if (obj instanceof CDOView)
{
- CDOAdapter adapter = (CDOAdapter)obj;
- if (adapter.isHistorical())
+ CDOView view = (CDOView)obj;
+ if (view.isHistorical())
{
return SharedIcons.getImage(SharedIcons.OBJ_EDITOR_HISTORICAL);
}
- if (adapter.isReadOnly())
+ if (view.isReadOnly())
{
return SharedIcons.getImage(SharedIcons.OBJ_EDITOR_READONLY);
}
@@ -90,27 +90,27 @@ public class CDOItemProvider extends ContainerItemProvider
manager.add(new OpenEditorAction("Open Editor", "Open a CDO editor", session)
{
@Override
- protected CDOAdapter createAdapter()
+ protected CDOView createView()
{
- return getSession().attach(new ResourceSetImpl());
+ return getSession().openView(new ResourceSetImpl());
}
});
manager.add(new OpenEditorAction("Open Read-Only Editor", "Open a read-only CDO editor", session)
{
@Override
- protected CDOAdapter createAdapter()
+ protected CDOView createView()
{
- return getSession().attach(new ResourceSetImpl(), true);
+ return getSession().openView(new ResourceSetImpl(), true);
}
});
manager.add(new OpenEditorAction("Open Historical Editor", "Open a historical CDO editor", session)
{
@Override
- protected CDOAdapter createAdapter()
+ protected CDOView createView()
{
- return getSession().attach(new ResourceSetImpl(), System.currentTimeMillis());
+ return getSession().openView(new ResourceSetImpl(), System.currentTimeMillis());
}
});
}
@@ -144,7 +144,7 @@ public class CDOItemProvider extends ContainerItemProvider
protected void doRun(final IWorkbenchPage page, IProgressMonitor monitor) throws Exception
{
final Exception[] exception = new Exception[1];
- final CDOAdapter adapter = createAdapter();
+ final CDOView view = createView();
final IWorkbenchPart part = page.getActivePart();
getDisplay().asyncExec(new Runnable()
{
@@ -154,10 +154,10 @@ public class CDOItemProvider extends ContainerItemProvider
{
if (part instanceof ISetSelectionTarget)
{
- ((ISetSelectionTarget)part).selectReveal(new StructuredSelection(adapter));
+ ((ISetSelectionTarget)part).selectReveal(new StructuredSelection(view));
}
- CDOEditor.open(page, adapter, "/res/test");
+ CDOEditor.open(page, view, "/res/test");
}
catch (Exception ex)
{
@@ -172,7 +172,7 @@ public class CDOItemProvider extends ContainerItemProvider
}
}
- protected abstract CDOAdapter createAdapter();
+ protected abstract CDOView createView();
}
protected Display getDisplay()
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOSessionsView.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOSessionsView.java
index 6ddda68..fc6a55b 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOSessionsView.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOSessionsView.java
@@ -50,9 +50,9 @@ public class CDOSessionsView extends ContainerView
@Override
protected void doubleClicked(Object object)
{
- // if (object instanceof CDOAdapter)
+ // if (object instanceof CDOView)
// {
- // openEditor((CDOAdapter)object);
+ // openEditor((CDOView)object);
// }
// else
{
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOAdapter.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOAdapter.java
deleted file mode 100644
index 6f21b26..0000000
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOAdapter.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004-2007 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;
-
-import org.eclipse.emf.cdo.eresource.CDOResource;
-import org.eclipse.emf.cdo.protocol.event.CDOEventSource;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-
-/**
- * @author Eike Stepper
- */
-public interface CDOAdapter extends CDOEventSource, Adapter
-{
- public ResourceSet getResourceSet();
-
- public CDOSession getSession();
-
- public CDOView getView();
-
- public CDOTransaction getTransaction();
-
- public boolean isHistorical();
-
- public boolean isActual();
-
- public boolean isReadOnly();
-
- /**
- * @see CDOTransaction#commit()
- */
- public void commit();
-
- /**
- * @see CDOTransaction#rollback()
- */
- public void rollback();
-
- public void detach();
-
- /**
- * @see ResourceSet#createResource(URI)
- */
- public CDOResource createResource(String path);
-
- /**
- * @see ResourceSet#getResource(URI, boolean)
- */
- public CDOResource getResource(String path);
-}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOObject.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOObject.java
index d5debd0..45b18cf 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOObject.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOObject.java
@@ -28,7 +28,7 @@ public interface CDOObject extends EObject
public CDOState cdoState();
- public CDOAdapter cdoAdapter();
+ public CDOView cdoView();
public CDOResource cdoResource();
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOSession.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOSession.java
index 82788ed..d63cccc 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOSession.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOSession.java
@@ -18,7 +18,7 @@ import org.eclipse.emf.ecore.resource.ResourceSet;
/**
* @author Eike Stepper
*/
-public interface CDOSession extends IContainer<CDOAdapter>
+public interface CDOSession extends IContainer<CDOView>
{
public int getSessionID();
@@ -34,11 +34,11 @@ public interface CDOSession extends IContainer<CDOAdapter>
public CDORevisionManager getRevisionManager();
- public CDOAdapter attach(ResourceSet resourceSet, long timeStamp);
+ public CDOView openView(ResourceSet resourceSet, long timeStamp);
- public CDOAdapter attach(ResourceSet resourceSet, boolean readOnly);
+ public CDOView openView(ResourceSet resourceSet, boolean readOnly);
- public CDOAdapter attach(ResourceSet resourceSet);
+ public CDOView openView(ResourceSet resourceSet);
- public CDOAdapter[] getAdapters();
+ public CDOView[] getViews();
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOSessionAdaptersEvent.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOSessionAdaptersEvent.java
index 665acc7..fb37ca7 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOSessionAdaptersEvent.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOSessionAdaptersEvent.java
@@ -15,9 +15,9 @@ import org.eclipse.net4j.util.container.IContainerEvent;
/**
* @author Eike Stepper
*/
-public interface CDOSessionAdaptersEvent extends IContainerEvent<CDOAdapter>
+public interface CDOSessionAdaptersEvent extends IContainerEvent<CDOView>
{
public CDOSession getSession();
- public CDOAdapter getAdapter();
+ public CDOView getAdapter();
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOTransaction.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOTransaction.java
deleted file mode 100644
index 76634cd..0000000
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOTransaction.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004-2007 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;
-
-/**
- * @author Eike Stepper
- */
-public interface CDOTransaction
-{
- public CDOAdapter getAdapter();
-
- public void commit();
-
- public void rollback();
-}
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 7bd0bba..206f241 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
@@ -10,23 +10,55 @@
**************************************************************************/
package org.eclipse.emf.cdo;
+import org.eclipse.emf.cdo.eresource.CDOResource;
import org.eclipse.emf.cdo.protocol.CDOID;
+import org.eclipse.emf.cdo.protocol.event.CDOEventSource;
import org.eclipse.emf.cdo.protocol.revision.CDORevision;
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+
/**
* @author Eike Stepper
*/
-public interface CDOView
+public interface CDOView extends CDOEventSource, Adapter
{
public static final long UNSPECIFIED_DATE = CDORevision.UNSPECIFIED_DATE;
- public CDOAdapter getAdapter();
+ public ResourceSet getResourceSet();
+
+ public CDOSession getSession();
- public boolean isActual();
+ public long getTimeStamp();
public boolean isHistorical();
- public long getTimeStamp();
+ public boolean isReadWrite();
+
+ public boolean isReadOnly();
+
+ /**
+ * @see ResourceSet#createResource(URI)
+ */
+ public CDOResource createResource(String path);
+
+ /**
+ * @see ResourceSet#getResource(URI, boolean)
+ */
+ public CDOResource getResource(String path);
+
+ /**
+ * @see CDOTransaction#commit()
+ */
+ public void commit();
+
+ /**
+ * @see CDOTransaction#rollback()
+ */
+ public void rollback();
+
+ public void close();
public CDORevision resolve(CDOID id);
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java
index 04ee277..dcaa4e4 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/impl/CDOResourceImpl.java
@@ -29,7 +29,7 @@ import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceImpl;
import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.emf.internal.cdo.CDOAdapterImpl;
+import org.eclipse.emf.internal.cdo.CDOViewImpl;
import org.eclipse.emf.internal.cdo.CDOObjectImpl;
import org.eclipse.emf.internal.cdo.bundle.CDO;
@@ -78,7 +78,7 @@ public class CDOResourceImpl extends CDOObjectImpl implements CDOResource
/**
* @ADDED
*/
- private CDOAdapterImpl adapter;
+ private CDOViewImpl adapter;
/**
* @ADDED
@@ -428,7 +428,7 @@ public class CDOResourceImpl extends CDOObjectImpl implements CDOResource
* @ADDED
*/
@Override
- public CDOAdapterImpl cdoAdapter()
+ public CDOViewImpl cdoView()
{
return adapter;
}
@@ -436,7 +436,7 @@ public class CDOResourceImpl extends CDOObjectImpl implements CDOResource
/**
* @ADDED
*/
- public void cdoSetAdapter(CDOAdapterImpl adapter)
+ public void cdoSetAdapter(CDOViewImpl adapter)
{
if (TRACER.isEnabled())
{
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 efe8ef4..793f71e 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
@@ -10,7 +10,7 @@
**************************************************************************/
package org.eclipse.emf.cdo.util;
-import org.eclipse.emf.cdo.CDOAdapter;
+import org.eclipse.emf.cdo.CDOView;
import org.eclipse.emf.cdo.CDOObject;
import org.eclipse.emf.cdo.CDOSession;
import org.eclipse.emf.cdo.eresource.CDOResourceFactory;
@@ -53,14 +53,14 @@ public final class CDOUtil
return session;
}
- public static CDOAdapter getAdapter(ResourceSet resourceSet)
+ public static CDOView getAdapter(ResourceSet resourceSet)
{
EList<Adapter> adapters = resourceSet.eAdapters();
for (Adapter adapter : adapters)
{
- if (adapter instanceof CDOAdapter)
+ if (adapter instanceof CDOView)
{
- return (CDOAdapter)adapter;
+ return (CDOView)adapter;
}
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAdapterImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAdapterImpl.java
deleted file mode 100644
index 7956799..0000000
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAdapterImpl.java
+++ /dev/null
@@ -1,469 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004-2007 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;
-
-import org.eclipse.emf.cdo.CDOAdapter;
-import org.eclipse.emf.cdo.CDOObject;
-import org.eclipse.emf.cdo.CDOState;
-import org.eclipse.emf.cdo.CDOView;
-import org.eclipse.emf.cdo.eresource.CDOResource;
-import org.eclipse.emf.cdo.eresource.EresourceFactory;
-import org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl;
-import org.eclipse.emf.cdo.internal.protocol.event.CDOEventImpl;
-import org.eclipse.emf.cdo.internal.protocol.event.CDOEventSourceImpl;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
-import org.eclipse.emf.cdo.protocol.CDOID;
-import org.eclipse.emf.cdo.protocol.event.CDOInvalidationEvent;
-import org.eclipse.emf.cdo.protocol.model.CDOClass;
-import org.eclipse.emf.cdo.protocol.util.ImplementationError;
-import org.eclipse.emf.cdo.protocol.util.TransportException;
-import org.eclipse.emf.cdo.util.CDOUtil;
-
-import org.eclipse.net4j.util.om.trace.ContextTracer;
-
-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.common.util.EList;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.internal.cdo.bundle.CDO;
-import org.eclipse.emf.internal.cdo.protocol.ResourcePathRequest;
-
-import java.text.MessageFormat;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * @author Eike Stepper
- */
-public class CDOAdapterImpl extends CDOEventSourceImpl implements CDOAdapter, Adapter.Internal
-{
- private static final ContextTracer TRACER = new ContextTracer(CDO.DEBUG_ADAPTER, CDOAdapterImpl.class);
-
- private CDOSessionImpl session;
-
- private ResourceSet resourceSet;
-
- private CDOViewImpl view;
-
- private CDOTransactionImpl transaction;
-
- private Map<CDOID, CDOObjectImpl> objects = new HashMap();
-
- public CDOAdapterImpl(CDOSessionImpl session, boolean readOnly)
- {
- this.session = session;
- view = new CDOViewImpl(this, CDOView.UNSPECIFIED_DATE);
- if (!readOnly)
- {
- transaction = new CDOTransactionImpl(this);
- }
- }
-
- public CDOAdapterImpl(CDOSessionImpl session, long timeStamp)
- {
- this.session = session;
- view = new CDOViewImpl(this, timeStamp);
- }
-
- public ResourceSet getResourceSet()
- {
- return resourceSet;
- }
-
- public CDOSessionImpl getSession()
- {
- return session;
- }
-
- public CDOViewImpl getView()
- {
- return view;
- }
-
- public CDOTransactionImpl getTransaction()
- {
- return transaction;
- }
-
- public boolean isActual()
- {
- return getView().isActual();
- }
-
- public boolean isHistorical()
- {
- return getView().isHistorical();
- }
-
- public boolean isReadOnly()
- {
- return transaction == null;
- }
-
- public CDOResource createResource(String path)
- {
- return (CDOResource)getResourceSet().createResource(CDOUtil.createURI(path));
- }
-
- public CDOResource getResource(String path)
- {
- return (CDOResource)getResourceSet().getResource(CDOUtil.createURI(path), true);
- }
-
- public CDOResourceImpl getResource(CDOID resourceID)
- {
- if (resourceID == null || resourceID == CDOID.NULL)
- {
- throw new ImplementationError("resourceID == null || resourceID == CDOID.NULL");
- }
-
- ResourceSet resourceSet = getResourceSet();
- EList<Resource> resources = resourceSet.getResources();
- for (Resource resource : resources)
- {
- if (resource instanceof CDOResourceImpl)
- {
- CDOResourceImpl cdoResource = (CDOResourceImpl)resource;
- if (resourceID.equals(cdoResource.cdoID()))
- {
- return cdoResource;
- }
- }
- }
-
- try
- {
- ResourcePathRequest signal = new ResourcePathRequest(getSession().getChannel(), resourceID);
- String path = signal.send();
-
- CDOResourceImpl resource = (CDOResourceImpl)EresourceFactory.eINSTANCE.createCDOResource();
- resource.setResourceSet(resourceSet);
- resource.setPath(path);
-
- CDOObjectImpl resourceObject = resource;
- resourceObject.setID(resourceID);
- resourceObject.setAdapter(this);
- resourceObject.setResource(resource);
- resourceObject.setState(CDOState.PROXY);
-
- return resource;
- }
- catch (Exception ex)
- {
- throw new TransportException(ex);
- }
- }
-
- public CDOObject lookupObject(CDOID id)
- {
- if (TRACER.isEnabled())
- {
- TRACER.format("Looking up object {0}", id);
- }
-
- CDOObjectImpl object = objects.get(id);
- if (object == null)
- {
- object = createObjectFromView(id);
- registerObject(object);
- }
-
- return object;
- }
-
- public void registerObject(CDOObjectImpl object)
- {
- if (TRACER.isEnabled())
- {
- TRACER.format("Registering object {0}", object);
- }
-
- CDOObjectImpl old = objects.put(object.cdoID(), object);
- if (old != null)
- {
- throw new IllegalStateException("Duplicate ID: " + object);
- }
- }
-
- public void deregisterObject(CDOObjectImpl object)
- {
- if (TRACER.isEnabled())
- {
- TRACER.format("Deregistering object {0}", object);
- }
-
- CDOObjectImpl old = objects.remove(object.cdoID());
- if (old == null)
- {
- throw new IllegalStateException("Unknown ID: " + object);
- }
- }
-
- public void remapObject(CDOID oldID)
- {
- CDOObjectImpl object = objects.remove(oldID);
- CDOID newID = object.cdoID();
- objects.put(newID, object);
- if (TRACER.isEnabled())
- {
- TRACER.format("Remapping object: {0} --> {1}", oldID, newID);
- }
- }
-
- /**
- * Turns registered objects into proxies and synchronously delivers
- * invalidation events to registered event listeners.
- * <p>
- * <b>Implementation note:</b> This implementation guarantees that exceptions
- * from listener code don't propagate up to the caller of this method. Runtime
- * exceptions from the implementation of the {@link CDOStateMachine} are
- * propagated to the caller of this method but this should not happen in the
- * absence of implementation errors.
- *
- * @param timeStamp
- * The point in time when the newly committed revision have been
- * created.
- * @param dirtyOIDs
- * A set of the object IDs to be invalidated. <b>Implementation note:</b>
- * This implementation expects the dirtyOIDs set to be unmodifiable.
- * It does not wrap the set (again).
- */
- public void notifyInvalidation(long timeStamp, Set<CDOID> dirtyOIDs)
- {
- for (CDOID dirtyOID : dirtyOIDs)
- {
- CDOObjectImpl object = objects.get(dirtyOID);
- if (object != null)
- {
- CDOStateMachine.INSTANCE.invalidate(object, timeStamp);
- }
- }
-
- fireObjectEvent(new CDOInvalidationEventImpl(timeStamp, dirtyOIDs));
- }
-
- public void commit()
- {
- checkWritable();
- transaction.commit();
- }
-
- public void rollback()
- {
- checkWritable();
- transaction.rollback();
- }
-
- public void detach()
- {
- session.adapterDetached(this);
- }
-
- @Override
- public String toString()
- {
- return MessageFormat.format("CDOAdapter({0}, {1})", view.toString(), isReadOnly() ? "readOnly" : "readWrite");
- }
-
- public boolean isAdapterForType(Object type)
- {
- return type instanceof ResourceSet;
- }
-
- public Notifier getTarget()
- {
- return resourceSet;
- }
-
- public void setTarget(Notifier newTarget)
- {
- ResourceSet resourceSet = (ResourceSet)newTarget;
- if (TRACER.isEnabled())
- {
- TRACER.trace("Attaching CDO adapter to " + resourceSet);
- }
-
- this.resourceSet = resourceSet;
- for (Resource resource : resourceSet.getResources())
- {
- if (resource instanceof CDOResourceImpl)
- {
- CDOResourceImpl cdoResource = (CDOResourceImpl)resource;
- CDOStateMachine.INSTANCE.attach(cdoResource, cdoResource, this);
- }
- }
- }
-
- public void unsetTarget(Notifier oldTarget)
- {
- ResourceSet resourceSet = (ResourceSet)oldTarget;
- for (Resource resource : resourceSet.getResources())
- {
- if (resource instanceof CDOResourceImpl)
- {
- CDOResourceImpl cdoResource = (CDOResourceImpl)resource;
- CDOStateMachine.INSTANCE.detach(cdoResource, cdoResource, this);
- }
- }
-
- if (TRACER.isEnabled())
- {
- TRACER.trace("Detaching CDO adapter from " + resourceSet);
- }
-
- if (resourceSet == oldTarget)
- {
- setTarget(null);
- }
- }
-
- public void notifyChanged(Notification msg)
- {
- switch (msg.getEventType())
- {
- case Notification.ADD:
- notifyAdd(msg);
- break;
-
- case Notification.ADD_MANY:
- notifyAddMany(msg);
- break;
-
- case Notification.REMOVE:
- notifyRemove(msg);
- break;
-
- case Notification.REMOVE_MANY:
- notifyRemoveMany(msg);
- break;
- }
- }
-
- private void notifyAdd(Notification msg)
- {
- if (msg.getNewValue() instanceof CDOResourceImpl)
- {
- CDOResourceImpl cdoResource = (CDOResourceImpl)msg.getNewValue();
- CDOStateMachine.INSTANCE.attach(cdoResource, cdoResource, this);
- }
- }
-
- private void notifyAddMany(Notification msg)
- {
- EList<Resource> newResources = (EList<Resource>)msg.getNewValue();
- EList<Resource> oldResources = (EList<Resource>)msg.getOldValue();
- for (Resource newResource : newResources)
- {
- if (newResource instanceof CDOResourceImpl)
- {
- if (!oldResources.contains(newResource))
- {
- CDOResourceImpl cdoResource = (CDOResourceImpl)newResource;
- CDOStateMachine.INSTANCE.attach(cdoResource, cdoResource, this);
- }
- }
- }
- }
-
- private void notifyRemove(Notification msg)
- {
- if (msg.getOldValue() instanceof CDOResourceImpl)
- {
- CDOResourceImpl cdoResource = (CDOResourceImpl)msg.getOldValue();
- CDOStateMachine.INSTANCE.detach(cdoResource, cdoResource, this);
- }
- }
-
- private void notifyRemoveMany(Notification msg)
- {
- EList<Resource> newResources = (EList<Resource>)msg.getNewValue();
- EList<Resource> oldResources = (EList<Resource>)msg.getOldValue();
- for (Resource oldResource : oldResources)
- {
- if (oldResource instanceof CDOResourceImpl)
- {
- if (!newResources.contains(oldResource))
- {
- CDOResourceImpl cdoResource = (CDOResourceImpl)oldResource;
- CDOStateMachine.INSTANCE.detach(cdoResource, cdoResource, this);
- }
- }
- }
- }
-
- private CDOObjectImpl createObjectFromView(CDOID id)
- {
- if (TRACER.isEnabled())
- {
- TRACER.format("Creating object from view: ID={0}", id);
- }
-
- CDORevisionImpl revision = view.resolve(id);
- CDOClass cdoClass = revision.getCDOClass();
- CDOID resourceID = revision.getResourceID();
-
- CDOObjectImpl object = (CDOObjectImpl)CDOUtil.createObject(cdoClass);
- if (object instanceof CDOResourceImpl)
- {
- object.setResource((CDOResourceImpl)object);
- }
- else
- {
- CDOResourceImpl resource = getResource(resourceID);
- object.setResource(resource);
- }
-
- object.setRevision(revision);
- object.setID(revision.getID());
- object.setState(CDOState.CLEAN);
- return object;
- }
-
- private void checkWritable()
- {
- if (isReadOnly())
- {
- throw new IllegalStateException("CDO adapter is read only");
- }
- }
-
- public static class CDOInvalidationEventImpl extends CDOEventImpl implements CDOInvalidationEvent
- {
- private long timeStamp;
-
- private Set<CDOID> dirtyOIDs;
-
- public CDOInvalidationEventImpl(long timeStamp, Set<CDOID> dirtyOIDs)
- {
- this.timeStamp = timeStamp;
- this.dirtyOIDs = dirtyOIDs;
- }
-
- public long getTimeStamp()
- {
- return timeStamp;
- }
-
- public Set<CDOID> getDirtyOIDs()
- {
- return dirtyOIDs;
- }
-
- @Override
- public String toString()
- {
- return "CDOInvalidationEvent" + dirtyOIDs;
- }
- }
-}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java
index 3912956..a582cd2 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java
@@ -73,9 +73,9 @@ public class CDOObjectImpl extends EStoreEObjectImpl implements CDOObject
return state;
}
- public CDOAdapterImpl cdoAdapter()
+ public CDOViewImpl cdoView()
{
- return resource != null ? resource.cdoAdapter() : null;
+ return resource != null ? resource.cdoView() : null;
}
public CDOResourceImpl cdoResource()
@@ -127,7 +127,7 @@ public class CDOObjectImpl extends EStoreEObjectImpl implements CDOObject
}
}
- void setAdapter(CDOAdapterImpl adapter)
+ void setAdapter(CDOViewImpl adapter)
{
if (this instanceof CDOResourceImpl)
{
@@ -207,7 +207,7 @@ public class CDOObjectImpl extends EStoreEObjectImpl implements CDOObject
TRACER.format("Finalizing revision for {0}", this);
}
- CDOAdapterImpl adapter = cdoAdapter();
+ CDOViewImpl adapter = cdoView();
revision.setVersion(1);
revision.setContainerID(eContainer == null ? CDOID.NULL : ((CDOObjectImpl)eContainer).cdoID());
revision.setContainingFeature(eContainerFeatureID);
@@ -226,7 +226,7 @@ public class CDOObjectImpl extends EStoreEObjectImpl implements CDOObject
}
}
- private void finalizeRevisionFeature(CDOAdapterImpl adapter, CDORevisionImpl revision, int i, Object setting,
+ private void finalizeRevisionFeature(CDOViewImpl adapter, CDORevisionImpl revision, int i, Object setting,
EStructuralFeature eFeature)
{
CDOFeatureImpl cdoFeature = EMFUtil.getCDOFeature(eFeature);
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 e6f9417..5bbea9b 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
@@ -10,7 +10,7 @@
**************************************************************************/
package org.eclipse.emf.internal.cdo;
-import org.eclipse.emf.cdo.CDOAdapter;
+import org.eclipse.emf.cdo.CDOView;
import org.eclipse.emf.cdo.CDOSession;
import org.eclipse.emf.cdo.CDOSessionAdaptersEvent;
import org.eclipse.emf.cdo.protocol.CDOID;
@@ -60,7 +60,7 @@ public class CDOSessionImpl extends Lifecycle implements CDOSession
private CDORevisionManagerImpl revisionManager;
- private Map<ResourceSet, CDOAdapterImpl> adapters = new HashMap();
+ private Map<ResourceSet, CDOViewImpl> adapters = new HashMap();
private IListener channelListener = new LifecycleEventAdapter()
{
@@ -134,36 +134,36 @@ public class CDOSessionImpl extends Lifecycle implements CDOSession
return revisionManager;
}
- public CDOAdapterImpl attach(ResourceSet resourceSet)
+ public CDOViewImpl openView(ResourceSet resourceSet)
{
- return attach(resourceSet, false);
+ return openView(resourceSet, false);
}
- public CDOAdapterImpl attach(ResourceSet resourceSet, boolean readOnly)
+ public CDOViewImpl openView(ResourceSet resourceSet, boolean readOnly)
{
prepare(resourceSet);
- return attach(resourceSet, new CDOAdapterImpl(this, readOnly));
+ return attach(resourceSet, new CDOViewImpl(this, readOnly));
}
- public CDOAdapterImpl attach(ResourceSet resourceSet, long timeStamp)
+ public CDOViewImpl openView(ResourceSet resourceSet, long timeStamp)
{
prepare(resourceSet);
- return attach(resourceSet, new CDOAdapterImpl(this, timeStamp));
+ return attach(resourceSet, new CDOViewImpl(this, timeStamp));
}
- public CDOAdapterImpl[] getAdapters()
+ public CDOViewImpl[] getViews()
{
- Collection<CDOAdapterImpl> values;
+ Collection<CDOViewImpl> values;
synchronized (adapters)
{
values = adapters.values();
}
- return values.toArray(new CDOAdapterImpl[values.size()]);
+ return values.toArray(new CDOViewImpl[values.size()]);
}
- public CDOAdapter[] getElements()
+ public CDOView[] getElements()
{
- return getAdapters();
+ return getViews();
}
public boolean isEmpty()
@@ -171,7 +171,7 @@ public class CDOSessionImpl extends Lifecycle implements CDOSession
return adapters.isEmpty();
}
- public void adapterDetached(CDOAdapterImpl adapter)
+ public void adapterDetached(CDOViewImpl adapter)
{
synchronized (adapters)
{
@@ -180,16 +180,16 @@ public class CDOSessionImpl extends Lifecycle implements CDOSession
}
}
- public void notifyInvalidation(long timeStamp, Set<CDOID> dirtyOIDs, CDOAdapterImpl excludedAdapter)
+ public void notifyInvalidation(long timeStamp, Set<CDOID> dirtyOIDs, CDOViewImpl excludedAdapter)
{
- CDOAdapterImpl[] values;
+ CDOViewImpl[] values;
synchronized (adapters)
{
- values = adapters.values().toArray(new CDOAdapterImpl[adapters.size()]);
+ values = adapters.values().toArray(new CDOViewImpl[adapters.size()]);
}
Set<CDOID> unmodifiableSet = Collections.unmodifiableSet(dirtyOIDs);
- for (CDOAdapterImpl adapter : values)
+ for (CDOViewImpl adapter : values)
{
if (adapter != excludedAdapter)
{
@@ -240,7 +240,7 @@ public class CDOSessionImpl extends Lifecycle implements CDOSession
private void prepare(ResourceSet resourceSet)
{
- CDOAdapter adapter = CDOUtil.getAdapter(resourceSet);
+ CDOView adapter = CDOUtil.getAdapter(resourceSet);
if (adapter != null)
{
throw new IllegalStateException("CDO adapter already present: " + adapter);
@@ -249,7 +249,7 @@ public class CDOSessionImpl extends Lifecycle implements CDOSession
CDOUtil.addResourceFactory(resourceSet);
}
- private CDOAdapterImpl attach(ResourceSet resourceSet, CDOAdapterImpl adapter)
+ private CDOViewImpl attach(ResourceSet resourceSet, CDOViewImpl adapter)
{
synchronized (adapters)
{
@@ -264,12 +264,12 @@ public class CDOSessionImpl extends Lifecycle implements CDOSession
/**
* @author Eike Stepper
*/
- private static class CDOSessionAdaptersEventImpl extends SingleDeltaContainerEvent<CDOAdapter> implements
+ private static class CDOSessionAdaptersEventImpl extends SingleDeltaContainerEvent<CDOView> implements
CDOSessionAdaptersEvent
{
private static final long serialVersionUID = 1L;
- public CDOSessionAdaptersEventImpl(CDOSession session, CDOAdapter adapter, Kind kind)
+ public CDOSessionAdaptersEventImpl(CDOSession session, CDOView adapter, Kind kind)
{
super(session, adapter, kind);
}
@@ -279,7 +279,7 @@ public class CDOSessionImpl extends Lifecycle implements CDOSession
return (CDOSession)getContainer();
}
- public CDOAdapter getAdapter()
+ public CDOView getAdapter()
{
return getDeltaElement();
}
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 7277f76..785c9fd 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
@@ -60,7 +60,7 @@ public final class CDOStateMachine
}
}
- public void attach(CDOObjectImpl object, CDOResourceImpl resource, CDOAdapterImpl adapter)
+ public void attach(CDOObjectImpl object, CDOResourceImpl resource, CDOViewImpl adapter)
{
if (TRACER.isEnabled())
{
@@ -79,7 +79,7 @@ public final class CDOStateMachine
INSTANCE.processEvent(object, Event.FINALIZE_ATTACH, resource, adapter);
}
- public void detach(CDOObjectImpl object, CDOResourceImpl resource, CDOAdapterImpl adapter)
+ public void detach(CDOObjectImpl object, CDOResourceImpl resource, CDOViewImpl adapter)
{
// TODO Implement method CDOStateMachine.detach()
throw new UnsupportedOperationException("Not yet implemented");
@@ -223,7 +223,7 @@ public final class CDOStateMachine
transition.execute(object, event, data1, data2);
}
- private static CDOTransactionImpl getTransaction(CDOAdapterImpl adapter)
+ private static CDOTransactionImpl getTransaction(CDOViewImpl adapter)
{
CDOTransactionImpl transaction = adapter.getTransaction();
if (transaction == null)
@@ -301,7 +301,7 @@ public final class CDOStateMachine
protected void doExecute(CDOObjectImpl object, Event event, Object data1, Object data2)
{
CDOResourceImpl resource = (CDOResourceImpl)data1;
- CDOAdapterImpl adapter = (CDOAdapterImpl)data2;
+ CDOViewImpl adapter = (CDOViewImpl)data2;
CDOTransactionImpl transaction = getTransaction(adapter);
// Create new revision
@@ -374,7 +374,7 @@ public final class CDOStateMachine
{
protected void doExecute(CDOObjectImpl object, Event event, Object data1, Object data2)
{
- CDOAdapterImpl adapter = object.cdoAdapter();
+ CDOViewImpl adapter = object.cdoView();
CommitTransactionResult result = (CommitTransactionResult)data1;
Map<CDOID, CDOID> idMappings = result.getIdMappings();
@@ -409,7 +409,7 @@ public final class CDOStateMachine
CDORevisionImpl revision = object.copyRevision();
revision.increaseVersion();
- CDOAdapterImpl adapter = object.cdoAdapter();
+ CDOViewImpl adapter = object.cdoView();
CDOTransactionImpl transaction = getTransaction(adapter);
transaction.registerDirty(object);
@@ -445,9 +445,8 @@ public final class CDOStateMachine
protected void doExecute(CDOObjectImpl object, Event event, Object data1, Object data2)
{
CDOID id = object.cdoID();
- CDOAdapterImpl adapter = object.cdoAdapter();
- CDOViewImpl view = adapter.getView();
- CDORevisionImpl revision = view.resolve(id);
+ CDOViewImpl adapter = object.cdoView();
+ CDORevisionImpl revision = adapter.resolve(id);
object.setRevision(revision);
object.setState(CDOState.CLEAN);
@@ -466,7 +465,7 @@ public final class CDOStateMachine
protected void doExecute(CDOObjectImpl object, Event event, Object data1, Object data2)
{
CDOResourceImpl resource = (CDOResourceImpl)data1;
- CDOAdapterImpl adapter = (CDOAdapterImpl)data2;
+ CDOViewImpl adapter = (CDOViewImpl)data2;
CDOID id = requestID(resource, adapter);
if (id == CDOID.NULL)
{
@@ -483,7 +482,7 @@ public final class CDOStateMachine
adapter.registerObject(object);
}
- private CDOID requestID(CDOResourceImpl resource, CDOAdapterImpl adapter)
+ private CDOID requestID(CDOResourceImpl resource, CDOViewImpl adapter)
{
String path = CDOUtil.extractPath(resource.getURI());
ResourceIDRequest signal = new ResourceIDRequest(adapter.getSession().getChannel(), path);
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStore.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStore.java
index 45aeaf8..d2b442b 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStore.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStore.java
@@ -10,7 +10,7 @@
**************************************************************************/
package org.eclipse.emf.internal.cdo;
-import org.eclipse.emf.cdo.CDOAdapter;
+import org.eclipse.emf.cdo.CDOView;
import org.eclipse.emf.cdo.CDOObject;
import org.eclipse.emf.cdo.internal.protocol.model.CDOFeatureImpl;
import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
@@ -51,7 +51,7 @@ public final class CDOStore implements EStore
CDORevisionImpl revision = getRevisionForReading(cdoObject);
CDOID id = revision.getContainerID();
- return (InternalEObject)convertToObject(cdoObject.cdoAdapter(), id);
+ return (InternalEObject)convertToObject(cdoObject.cdoView(), id);
}
public int getContainingFeatureID(InternalEObject eObject)
@@ -74,7 +74,7 @@ public final class CDOStore implements EStore
TRACER.format("setContainer({0}, {1}, {2})", cdoObject, newContainer, newContainerFeatureID);
}
- CDOID containerID = (CDOID)convertToID(cdoObject.cdoAdapter(), newContainer);
+ CDOID containerID = (CDOID)convertToID(cdoObject.cdoView(), newContainer);
CDORevisionImpl revision = getRevisionForWriting(cdoObject);
revision.setContainerID(containerID);
@@ -99,7 +99,7 @@ public final class CDOStore implements EStore
Object result = revision.get(cdoFeature, index);
if (cdoFeature.isReference())
{
- result = convertToObject(cdoObject.cdoAdapter(), result);
+ result = convertToObject(cdoObject.cdoView(), result);
}
return result;
@@ -155,7 +155,7 @@ public final class CDOStore implements EStore
if (cdoFeature.isReference())
{
- value = convertToID(cdoObject.cdoAdapter(), value);
+ value = convertToID(cdoObject.cdoView(), value);
}
CDORevisionImpl revision = getRevisionForReading(cdoObject);
@@ -173,7 +173,7 @@ public final class CDOStore implements EStore
if (cdoFeature.isReference())
{
- value = convertToID(cdoObject.cdoAdapter(), value);
+ value = convertToID(cdoObject.cdoView(), value);
}
CDORevisionImpl revision = getRevisionForReading(cdoObject);
@@ -191,7 +191,7 @@ public final class CDOStore implements EStore
if (cdoFeature.isReference())
{
- value = convertToID(cdoObject.cdoAdapter(), value);
+ value = convertToID(cdoObject.cdoView(), value);
}
CDORevisionImpl revision = getRevisionForReading(cdoObject);
@@ -226,7 +226,7 @@ public final class CDOStore implements EStore
{
for (int i = 0; i < result.length; i++)
{
- result[i] = convertToObject(cdoObject.cdoAdapter(), result[i]);
+ result[i] = convertToObject(cdoObject.cdoView(), result[i]);
}
}
@@ -255,14 +255,14 @@ public final class CDOStore implements EStore
handleContainmentAdd(cdoObject, cdoFeature, value);
}
- value = convertToID(cdoObject.cdoAdapter(), value);
+ value = convertToID(cdoObject.cdoView(), value);
}
CDORevisionImpl revision = getRevisionForWriting(cdoObject);
Object result = revision.set(cdoFeature, index, value);
if (cdoFeature.isReference())
{
- result = convertToObject(cdoObject.cdoAdapter(), result);
+ result = convertToObject(cdoObject.cdoView(), result);
}
return result;
@@ -297,7 +297,7 @@ public final class CDOStore implements EStore
handleContainmentAdd(cdoObject, cdoFeature, value);
}
- value = convertToID(cdoObject.cdoAdapter(), value);
+ value = convertToID(cdoObject.cdoView(), value);
}
CDORevisionImpl revision = getRevisionForWriting(cdoObject);
@@ -317,7 +317,7 @@ public final class CDOStore implements EStore
Object result = revision.remove(cdoFeature, index);
if (cdoFeature.isReference())
{
- result = convertToObject(cdoObject.cdoAdapter(), result);
+ result = convertToObject(cdoObject.cdoView(), result);
}
return result;
@@ -349,7 +349,7 @@ public final class CDOStore implements EStore
Object result = revision.move(cdoFeature, target, source);
if (cdoFeature.isReference())
{
- result = convertToObject(cdoObject.cdoAdapter(), result);
+ result = convertToObject(cdoObject.cdoView(), result);
}
return result;
@@ -366,12 +366,12 @@ public final class CDOStore implements EStore
return "PersistentStore";
}
- public static Object convertToID(CDOAdapter adapter, Object potentialObject)
+ public static Object convertToID(CDOView adapter, Object potentialObject)
{
if (potentialObject instanceof CDOObject)
{
CDOObject object = (CDOObject)potentialObject;
- if (object.cdoAdapter() == adapter)
+ if (object.cdoView() == adapter)
{
return object.cdoID();
}
@@ -388,7 +388,7 @@ public final class CDOStore implements EStore
/**
* TODO Move to adapter
*/
- public static Object convertToObject(CDOAdapter adapter, Object potentialID)
+ public static Object convertToObject(CDOView adapter, Object potentialID)
{
if (potentialID instanceof CDOID)
{
@@ -398,7 +398,7 @@ public final class CDOStore implements EStore
}
CDOID id = (CDOID)potentialID;
- CDOObject result = ((CDOAdapterImpl)adapter).lookupObject(id);
+ CDOObject result = ((CDOViewImpl)adapter).lookupObject(id);
if (result == null)
{
throw new ImplementationError("ID not registered: " + id);
@@ -437,8 +437,8 @@ public final class CDOStore implements EStore
{
CDOObjectImpl container = cdoObject;
CDOObjectImpl contained = (CDOObjectImpl)value;
- CDOAdapterImpl containerAdapter = cdoObject.cdoAdapter();
- CDOAdapterImpl containedAdapter = contained.cdoAdapter();
+ CDOViewImpl containerAdapter = cdoObject.cdoView();
+ CDOViewImpl containedAdapter = contained.cdoView();
if (containedAdapter != containerAdapter)
{
if (containedAdapter != null)
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 962c4c2..476078f 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
@@ -10,7 +10,6 @@
**************************************************************************/
package org.eclipse.emf.internal.cdo;
-import org.eclipse.emf.cdo.CDOTransaction;
import org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.util.ImplementationError;
@@ -27,7 +26,7 @@ import java.util.Map;
/**
* @author Eike Stepper
*/
-public class CDOTransactionImpl implements CDOTransaction
+public class CDOTransactionImpl
{
private static final ContextTracer TRACER = new ContextTracer(CDO.DEBUG_TRANSCTION, CDOTransactionImpl.class);
@@ -35,7 +34,7 @@ public class CDOTransactionImpl implements CDOTransaction
private long nextTemporaryID = INITIAL_TEMPORARY_ID;
- private CDOAdapterImpl adapter;
+ private CDOViewImpl adapter;
private Map<CDOID, CDOResourceImpl> newResources = new HashMap();
@@ -43,12 +42,12 @@ public class CDOTransactionImpl implements CDOTransaction
private Map<CDOID, CDOObjectImpl> dirtyObjects = new HashMap();
- public CDOTransactionImpl(CDOAdapterImpl adapter)
+ public CDOTransactionImpl(CDOViewImpl adapter)
{
this.adapter = adapter;
}
- public CDOAdapterImpl getAdapter()
+ public CDOViewImpl getAdapter()
{
return adapter;
}
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 58cfa07..c398deb 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
@@ -11,31 +11,85 @@
package org.eclipse.emf.internal.cdo;
import org.eclipse.emf.cdo.CDOView;
+import org.eclipse.emf.cdo.CDOObject;
+import org.eclipse.emf.cdo.CDOState;
+import org.eclipse.emf.cdo.eresource.CDOResource;
+import org.eclipse.emf.cdo.eresource.EresourceFactory;
+import org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl;
+import org.eclipse.emf.cdo.internal.protocol.event.CDOEventImpl;
+import org.eclipse.emf.cdo.internal.protocol.event.CDOEventSourceImpl;
import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
import org.eclipse.emf.cdo.protocol.CDOID;
+import org.eclipse.emf.cdo.protocol.event.CDOInvalidationEvent;
+import org.eclipse.emf.cdo.protocol.model.CDOClass;
import org.eclipse.emf.cdo.protocol.revision.CDORevisionResolver;
+import org.eclipse.emf.cdo.protocol.util.ImplementationError;
+import org.eclipse.emf.cdo.protocol.util.TransportException;
+import org.eclipse.emf.cdo.util.CDOUtil;
+
+import org.eclipse.net4j.util.om.trace.ContextTracer;
+
+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.common.util.EList;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.internal.cdo.bundle.CDO;
+import org.eclipse.emf.internal.cdo.protocol.ResourcePathRequest;
import java.text.MessageFormat;
import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
/**
* @author Eike Stepper
*/
-public class CDOViewImpl implements CDOView
+public class CDOViewImpl extends CDOEventSourceImpl implements CDOView, Adapter.Internal
{
- private CDOAdapterImpl adapter;
+ private static final ContextTracer TRACER = new ContextTracer(CDO.DEBUG_ADAPTER, CDOViewImpl.class);
+
+ private CDOSessionImpl session;
+
+ private ResourceSet resourceSet;
private long timeStamp;
- public CDOViewImpl(CDOAdapterImpl adapter, long timeStamp)
+ private CDOTransactionImpl transaction;
+
+ private Map<CDOID, CDOObjectImpl> objects = new HashMap();
+
+ public CDOViewImpl(CDOSessionImpl session, boolean readOnly)
+ {
+ this.session = session;
+ timeStamp = UNSPECIFIED_DATE;
+ if (!readOnly)
+ {
+ transaction = new CDOTransactionImpl(this);
+ }
+ }
+
+ public CDOViewImpl(CDOSessionImpl session, long timeStamp)
{
- this.adapter = adapter;
+ this.session = session;
this.timeStamp = timeStamp;
}
- public CDOAdapterImpl getAdapter()
+ public ResourceSet getResourceSet()
{
- return adapter;
+ return resourceSet;
+ }
+
+ public CDOSessionImpl getSession()
+ {
+ return session;
+ }
+
+ public CDOTransactionImpl getTransaction()
+ {
+ return transaction;
}
public long getTimeStamp()
@@ -43,20 +97,25 @@ public class CDOViewImpl implements CDOView
return timeStamp;
}
- public boolean isActual()
+ public boolean isHistorical()
{
- return timeStamp == UNSPECIFIED_DATE;
+ return timeStamp != CDOView.UNSPECIFIED_DATE;
}
- public boolean isHistorical()
+ public boolean isReadWrite()
+ {
+ return timeStamp == CDOView.UNSPECIFIED_DATE;
+ }
+
+ public boolean isReadOnly()
{
- return !isActual();
+ return transaction == null;
}
public CDORevisionImpl resolve(CDOID id)
{
- CDORevisionResolver revisionManager = adapter.getSession().getRevisionManager();
- if (isActual())
+ CDORevisionResolver revisionManager = session.getRevisionManager();
+ if (isReadWrite())
{
return (CDORevisionImpl)revisionManager.getActualRevision(id);
}
@@ -64,14 +123,360 @@ public class CDOViewImpl implements CDOView
return (CDORevisionImpl)revisionManager.getHistoricalRevision(id, timeStamp);
}
+ public CDOResource createResource(String path)
+ {
+ return (CDOResource)getResourceSet().createResource(CDOUtil.createURI(path));
+ }
+
+ public CDOResource getResource(String path)
+ {
+ return (CDOResource)getResourceSet().getResource(CDOUtil.createURI(path), true);
+ }
+
+ public CDOResourceImpl getResource(CDOID resourceID)
+ {
+ if (resourceID == null || resourceID == CDOID.NULL)
+ {
+ throw new ImplementationError("resourceID == null || resourceID == CDOID.NULL");
+ }
+
+ ResourceSet resourceSet = getResourceSet();
+ EList<Resource> resources = resourceSet.getResources();
+ for (Resource resource : resources)
+ {
+ if (resource instanceof CDOResourceImpl)
+ {
+ CDOResourceImpl cdoResource = (CDOResourceImpl)resource;
+ if (resourceID.equals(cdoResource.cdoID()))
+ {
+ return cdoResource;
+ }
+ }
+ }
+
+ try
+ {
+ ResourcePathRequest signal = new ResourcePathRequest(getSession().getChannel(), resourceID);
+ String path = signal.send();
+
+ CDOResourceImpl resource = (CDOResourceImpl)EresourceFactory.eINSTANCE.createCDOResource();
+ resource.setResourceSet(resourceSet);
+ resource.setPath(path);
+
+ CDOObjectImpl resourceObject = resource;
+ resourceObject.setID(resourceID);
+ resourceObject.setAdapter(this);
+ resourceObject.setResource(resource);
+ resourceObject.setState(CDOState.PROXY);
+
+ return resource;
+ }
+ catch (Exception ex)
+ {
+ throw new TransportException(ex);
+ }
+ }
+
+ public CDOObject lookupObject(CDOID id)
+ {
+ if (TRACER.isEnabled())
+ {
+ TRACER.format("Looking up object {0}", id);
+ }
+
+ CDOObjectImpl object = objects.get(id);
+ if (object == null)
+ {
+ object = createObjectFromView(id);
+ registerObject(object);
+ }
+
+ return object;
+ }
+
+ public void registerObject(CDOObjectImpl object)
+ {
+ if (TRACER.isEnabled())
+ {
+ TRACER.format("Registering object {0}", object);
+ }
+
+ CDOObjectImpl old = objects.put(object.cdoID(), object);
+ if (old != null)
+ {
+ throw new IllegalStateException("Duplicate ID: " + object);
+ }
+ }
+
+ public void deregisterObject(CDOObjectImpl object)
+ {
+ if (TRACER.isEnabled())
+ {
+ TRACER.format("Deregistering object {0}", object);
+ }
+
+ CDOObjectImpl old = objects.remove(object.cdoID());
+ if (old == null)
+ {
+ throw new IllegalStateException("Unknown ID: " + object);
+ }
+ }
+
+ public void remapObject(CDOID oldID)
+ {
+ CDOObjectImpl object = objects.remove(oldID);
+ CDOID newID = object.cdoID();
+ objects.put(newID, object);
+ if (TRACER.isEnabled())
+ {
+ TRACER.format("Remapping object: {0} --> {1}", oldID, newID);
+ }
+ }
+
+ /**
+ * Turns registered objects into proxies and synchronously delivers
+ * invalidation events to registered event listeners.
+ * <p>
+ * <b>Implementation note:</b> This implementation guarantees that exceptions
+ * from listener code don't propagate up to the caller of this method. Runtime
+ * exceptions from the implementation of the {@link CDOStateMachine} are
+ * propagated to the caller of this method but this should not happen in the
+ * absence of implementation errors.
+ *
+ * @param timeStamp
+ * The point in time when the newly committed revision have been
+ * created.
+ * @param dirtyOIDs
+ * A set of the object IDs to be invalidated. <b>Implementation note:</b>
+ * This implementation expects the dirtyOIDs set to be unmodifiable.
+ * It does not wrap the set (again).
+ */
+ public void notifyInvalidation(long timeStamp, Set<CDOID> dirtyOIDs)
+ {
+ for (CDOID dirtyOID : dirtyOIDs)
+ {
+ CDOObjectImpl object = objects.get(dirtyOID);
+ if (object != null)
+ {
+ CDOStateMachine.INSTANCE.invalidate(object, timeStamp);
+ }
+ }
+
+ fireObjectEvent(new CDOInvalidationEventImpl(timeStamp, dirtyOIDs));
+ }
+
+ public void commit()
+ {
+ checkWritable();
+ transaction.commit();
+ }
+
+ public void rollback()
+ {
+ checkWritable();
+ transaction.rollback();
+ }
+
+ public void close()
+ {
+ session.adapterDetached(this);
+ }
+
@Override
public String toString()
{
- if (isActual())
+ return MessageFormat.format("CDOView({0}, {1})", isHistorical() ? new Date(timeStamp) : (isReadOnly() ? "readOnly"
+ : "readWrite"));
+ }
+
+ public boolean isAdapterForType(Object type)
+ {
+ return type instanceof ResourceSet;
+ }
+
+ public Notifier getTarget()
+ {
+ return resourceSet;
+ }
+
+ public void setTarget(Notifier newTarget)
+ {
+ ResourceSet resourceSet = (ResourceSet)newTarget;
+ if (TRACER.isEnabled())
+ {
+ TRACER.trace("Attaching CDO adapter to " + resourceSet);
+ }
+
+ this.resourceSet = resourceSet;
+ for (Resource resource : resourceSet.getResources())
+ {
+ if (resource instanceof CDOResourceImpl)
+ {
+ CDOResourceImpl cdoResource = (CDOResourceImpl)resource;
+ CDOStateMachine.INSTANCE.attach(cdoResource, cdoResource, this);
+ }
+ }
+ }
+
+ public void unsetTarget(Notifier oldTarget)
+ {
+ ResourceSet resourceSet = (ResourceSet)oldTarget;
+ for (Resource resource : resourceSet.getResources())
+ {
+ if (resource instanceof CDOResourceImpl)
+ {
+ CDOResourceImpl cdoResource = (CDOResourceImpl)resource;
+ CDOStateMachine.INSTANCE.detach(cdoResource, cdoResource, this);
+ }
+ }
+
+ if (TRACER.isEnabled())
+ {
+ TRACER.trace("Detaching CDO adapter from " + resourceSet);
+ }
+
+ if (resourceSet == oldTarget)
+ {
+ setTarget(null);
+ }
+ }
+
+ public void notifyChanged(Notification msg)
+ {
+ switch (msg.getEventType())
+ {
+ case Notification.ADD:
+ notifyAdd(msg);
+ break;
+
+ case Notification.ADD_MANY:
+ notifyAddMany(msg);
+ break;
+
+ case Notification.REMOVE:
+ notifyRemove(msg);
+ break;
+
+ case Notification.REMOVE_MANY:
+ notifyRemoveMany(msg);
+ break;
+ }
+ }
+
+ private void notifyAdd(Notification msg)
+ {
+ if (msg.getNewValue() instanceof CDOResourceImpl)
+ {
+ CDOResourceImpl cdoResource = (CDOResourceImpl)msg.getNewValue();
+ CDOStateMachine.INSTANCE.attach(cdoResource, cdoResource, this);
+ }
+ }
+
+ private void notifyAddMany(Notification msg)
+ {
+ EList<Resource> newResources = (EList<Resource>)msg.getNewValue();
+ EList<Resource> oldResources = (EList<Resource>)msg.getOldValue();
+ for (Resource newResource : newResources)
+ {
+ if (newResource instanceof CDOResourceImpl)
+ {
+ if (!oldResources.contains(newResource))
+ {
+ CDOResourceImpl cdoResource = (CDOResourceImpl)newResource;
+ CDOStateMachine.INSTANCE.attach(cdoResource, cdoResource, this);
+ }
+ }
+ }
+ }
+
+ private void notifyRemove(Notification msg)
+ {
+ if (msg.getOldValue() instanceof CDOResourceImpl)
+ {
+ CDOResourceImpl cdoResource = (CDOResourceImpl)msg.getOldValue();
+ CDOStateMachine.INSTANCE.detach(cdoResource, cdoResource, this);
+ }
+ }
+
+ private void notifyRemoveMany(Notification msg)
+ {
+ EList<Resource> newResources = (EList<Resource>)msg.getNewValue();
+ EList<Resource> oldResources = (EList<Resource>)msg.getOldValue();
+ for (Resource oldResource : oldResources)
+ {
+ if (oldResource instanceof CDOResourceImpl)
+ {
+ if (!newResources.contains(oldResource))
+ {
+ CDOResourceImpl cdoResource = (CDOResourceImpl)oldResource;
+ CDOStateMachine.INSTANCE.detach(cdoResource, cdoResource, this);
+ }
+ }
+ }
+ }
+
+ private CDOObjectImpl createObjectFromView(CDOID id)
+ {
+ if (TRACER.isEnabled())
+ {
+ TRACER.format("Creating object from view: ID={0}", id);
+ }
+
+ CDORevisionImpl revision = resolve(id);
+ CDOClass cdoClass = revision.getCDOClass();
+ CDOID resourceID = revision.getResourceID();
+
+ CDOObjectImpl object = (CDOObjectImpl)CDOUtil.createObject(cdoClass);
+ if (object instanceof CDOResourceImpl)
+ {
+ object.setResource((CDOResourceImpl)object);
+ }
+ else
{
- return "ActualView";
+ CDOResourceImpl resource = getResource(resourceID);
+ object.setResource(resource);
}
- return MessageFormat.format("HistoricalView({0})", new Date(timeStamp));
+ object.setRevision(revision);
+ object.setID(revision.getID());
+ object.setState(CDOState.CLEAN);
+ return object;
+ }
+
+ private void checkWritable()
+ {
+ if (isReadOnly())
+ {
+ throw new IllegalStateException("CDO adapter is read only");
+ }
+ }
+
+ public static class CDOInvalidationEventImpl extends CDOEventImpl implements CDOInvalidationEvent
+ {
+ private long timeStamp;
+
+ private Set<CDOID> dirtyOIDs;
+
+ public CDOInvalidationEventImpl(long timeStamp, Set<CDOID> dirtyOIDs)
+ {
+ this.timeStamp = timeStamp;
+ this.dirtyOIDs = dirtyOIDs;
+ }
+
+ public long getTimeStamp()
+ {
+ return timeStamp;
+ }
+
+ public Set<CDOID> getDirtyOIDs()
+ {
+ return dirtyOIDs;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "CDOInvalidationEvent" + dirtyOIDs;
+ }
}
}