summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-07-06 03:41:20 (EDT)
committerEike Stepper2007-07-06 03:41:20 (EDT)
commitcb890827c5dbceaa66036b9b3c8e882ed385ef78 (patch)
tree2d5180490fd189b601131f5618406f752daf8ece
parenta1441354f38bc8c0cae61da8667dd739debdcb74 (diff)
downloadcdo-cb890827c5dbceaa66036b9b3c8e882ed385ef78.zip
cdo-cb890827c5dbceaa66036b9b3c8e882ed385ef78.tar.gz
cdo-cb890827c5dbceaa66036b9b3c8e882ed385ef78.tar.bz2
task 1: Develop 0.8.0
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/RevisionManagerImpl.java7
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadObjectIndication.java8
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOItemProvider.java2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDORevisionManagerImpl.java14
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadObjectRequest.java13
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/Signal.java5
6 files changed, 33 insertions, 16 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/RevisionManagerImpl.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/RevisionManagerImpl.java
index fe5f241..0ffb65a 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/RevisionManagerImpl.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/RevisionManagerImpl.java
@@ -50,4 +50,11 @@ public class RevisionManagerImpl extends CDORevisionResolverImpl implements Revi
// TODO Implement method RevisionManagerImpl.loadActual()
throw new UnsupportedOperationException("Not yet implemented");
}
+
+ @Override
+ protected CDORevisionImpl loadHistorical(CDOID id, long timeStamp)
+ {
+ // TODO Implement method RevisionManagerImpl.loadHistorical()
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadObjectIndication.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadObjectIndication.java
index a414485..26672b1 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadObjectIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadObjectIndication.java
@@ -33,9 +33,7 @@ public class LoadObjectIndication extends CDOServerIndication
private CDOID id;
- private boolean historical;
-
- private long timeStamp;
+ private Long timeStamp;
public LoadObjectIndication()
{
@@ -51,7 +49,7 @@ public class LoadObjectIndication extends CDOServerIndication
PROTOCOL.format("Read ID: {0}", id);
}
- historical = in.readBoolean();
+ boolean historical = in.readBoolean();
if (historical)
{
timeStamp = in.readLong();
@@ -66,7 +64,7 @@ public class LoadObjectIndication extends CDOServerIndication
protected void responding(ExtendedDataOutputStream out) throws IOException
{
RevisionManagerImpl rm = getRevisionManager();
- CDORevisionImpl revision = historical ? rm.getHistoricalRevision(id, timeStamp) : rm.getActualRevision(id);
+ CDORevisionImpl revision = timeStamp != null ? rm.getHistoricalRevision(id, timeStamp) : rm.getActualRevision(id);
revision.write(out, null);
}
}
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 08d2678..0f782d3 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
@@ -184,7 +184,7 @@ public class CDOItemProvider extends ContainerItemProvider
CDOView view = (CDOView)obj;
return (view.isDirty() ? "*" : "")
+ (view.isHistorical() ? new Date(view.getTimeStamp()).toString() : view.isReadOnly() ? "View"
- : "Transaction") + "[" + view.getID() + "]";
+ : "Transaction") + " [" + view.getID() + "]";
}
if (obj instanceof CDOViewHistory.Entry)
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDORevisionManagerImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDORevisionManagerImpl.java
index 7bb4d5c..758b133 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDORevisionManagerImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDORevisionManagerImpl.java
@@ -48,4 +48,18 @@ public class CDORevisionManagerImpl extends CDORevisionResolverImpl implements C
throw new TransportException(ex);
}
}
+
+ @Override
+ protected CDORevisionImpl loadHistorical(CDOID id, long timeStamp)
+ {
+ try
+ {
+ LoadObjectRequest signal = new LoadObjectRequest(session.getChannel(), id, timeStamp);
+ return signal.send();
+ }
+ catch (Exception ex)
+ {
+ throw new TransportException(ex);
+ }
+ }
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadObjectRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadObjectRequest.java
index 2292cd5..aae1add 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadObjectRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadObjectRequest.java
@@ -32,9 +32,7 @@ public class LoadObjectRequest extends CDOClientRequest<CDORevisionImpl>
private CDOID id;
- private boolean historical;
-
- private long timeStamp;
+ private Long timeStamp;
public LoadObjectRequest(IChannel channel, CDOID id)
{
@@ -46,7 +44,6 @@ public class LoadObjectRequest extends CDOClientRequest<CDORevisionImpl>
{
this(channel, id);
this.timeStamp = timeStamp;
- historical = true;
}
@Override
@@ -58,16 +55,20 @@ public class LoadObjectRequest extends CDOClientRequest<CDORevisionImpl>
}
CDOIDImpl.write(out, id);
- out.writeBoolean(historical);
- if (historical)
+ if (timeStamp != null)
{
if (PROTOCOL.isEnabled())
{
PROTOCOL.format("Writing timeStamp: {0}", timeStamp);
}
+ out.writeBoolean(true);
out.writeLong(timeStamp);
}
+ else
+ {
+ out.writeBoolean(false);
+ }
}
@Override
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/Signal.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/Signal.java
index 320b715..415abe6 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/Signal.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/Signal.java
@@ -24,6 +24,7 @@ import java.util.concurrent.TimeoutException;
*/
public abstract class Signal implements Runnable
{
+ @SuppressWarnings("unused")
private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG_SIGNAL, Signal.class);
private SignalProtocol protocol;
@@ -67,10 +68,6 @@ public abstract class Signal implements Runnable
catch (Exception ex)
{
OM.LOG.error(ex);
- if (TRACER.isEnabled())
- {
- TRACER.trace(ex);
- }
}
}