Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2016-01-25 05:26:50 -0500
committerEike Stepper2016-01-25 05:26:50 -0500
commit45b55081f4200d675e18ec5cbd4a120b1b52bfe4 (patch)
tree3c3a876f1f7396f4e0ee9fbeba7cab05327f83d6
parentbcc19d0a8cbbd2132f5bab85ecf04282ceef3fe6 (diff)
downloadcdo-45b55081f4200d675e18ec5cbd4a120b1b52bfe4.tar.gz
cdo-45b55081f4200d675e18ec5cbd4a120b1b52bfe4.tar.xz
cdo-45b55081f4200d675e18ec5cbd4a120b1b52bfe4.zip
[Releng] Factor getView(id) into CDOServerIndication
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionUtil.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerIndication.java7
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerIndicationWithMonitoring.java7
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ChangeSubscriptionIndication.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CloseViewIndication.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CommitTransactionIndication.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/EnableLockNotificationIndication.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockAreaIndication.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockDelegationIndication.java3
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockObjectsIndication.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockStateIndication.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ObjectLockedIndication.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/QueryIndication.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ResetTransactionIndication.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/SwitchTargetIndication.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/UnlockDelegationIndication.java3
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/UnlockObjectsIndication.java5
-rw-r--r--plugins/org.eclipse.net4j.util/.settings/.api_filters9
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/ConcurrencyUtil.java29
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/lifecycle/IDeactivateable.java21
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/lifecycle/ILifecycle.java2
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/lifecycle/LifecycleUtil.java4
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/buffer/Buffer.java17
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/buffer/BufferPool.java3
24 files changed, 108 insertions, 36 deletions
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionUtil.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionUtil.java
index ebf583c476..5cccda0ea2 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionUtil.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionUtil.java
@@ -353,7 +353,8 @@ public final class CDORevisionUtil
{
return null;
}
- else if (parentID == revision.getID())
+
+ if (parentID == revision.getID())
{
// This must be the root resource!
return null;
@@ -486,6 +487,7 @@ public final class CDORevisionUtil
{
container = getParentRevision(revision, provider);
}
+
if (container != null)
{
getResourceNodePath(container, provider, result);
@@ -515,6 +517,7 @@ public final class CDORevisionUtil
{
return null;
}
+
if (CDOIDUtil.isNull(resourceID))
{
CDOID parentID = null;
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerIndication.java
index 1ac10430ea..7e0d7ef288 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerIndication.java
@@ -28,6 +28,7 @@ import org.eclipse.emf.cdo.spi.common.protocol.CDODataOutputImpl;
import org.eclipse.emf.cdo.spi.common.revision.CDORevisionUnchunker;
import org.eclipse.emf.cdo.spi.server.InternalRepository;
import org.eclipse.emf.cdo.spi.server.InternalSession;
+import org.eclipse.emf.cdo.spi.server.InternalView;
import org.eclipse.net4j.signal.IndicationWithResponse;
import org.eclipse.net4j.util.io.ExtendedDataInputStream;
@@ -80,6 +81,12 @@ public abstract class CDOServerIndication extends IndicationWithResponse
return store;
}
+ protected InternalView getView(int viewID)
+ {
+ InternalSession session = getSession();
+ return session.getView(viewID);
+ }
+
@Override
protected void indicating(ExtendedDataInputStream in) throws Exception
{
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerIndicationWithMonitoring.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerIndicationWithMonitoring.java
index bcc4df1982..ea3d2fac37 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerIndicationWithMonitoring.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerIndicationWithMonitoring.java
@@ -30,6 +30,7 @@ import org.eclipse.emf.cdo.spi.common.protocol.CDODataOutputImpl;
import org.eclipse.emf.cdo.spi.common.revision.CDORevisionUnchunker;
import org.eclipse.emf.cdo.spi.server.InternalRepository;
import org.eclipse.emf.cdo.spi.server.InternalSession;
+import org.eclipse.emf.cdo.spi.server.InternalView;
import org.eclipse.net4j.signal.IndicationWithMonitoring;
import org.eclipse.net4j.util.io.ExtendedDataInputStream;
@@ -100,6 +101,12 @@ public abstract class CDOServerIndicationWithMonitoring extends IndicationWithMo
return store;
}
+ protected InternalView getView(int viewID)
+ {
+ InternalSession session = getSession();
+ return session.getView(viewID);
+ }
+
@Override
protected final void indicating(ExtendedDataInputStream in, OMMonitor monitor) throws Exception
{
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ChangeSubscriptionIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ChangeSubscriptionIndication.java
index 6149377c5c..ae54ac32a4 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ChangeSubscriptionIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ChangeSubscriptionIndication.java
@@ -48,7 +48,7 @@ public class ChangeSubscriptionIndication extends CDOServerReadIndication
size = -size;
}
- InternalView view = getSession().getView(viewID);
+ InternalView view = getView(viewID);
if (clear)
{
if (TRACER.isEnabled())
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CloseViewIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CloseViewIndication.java
index de3c8b1364..c2cb7dcde1 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CloseViewIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CloseViewIndication.java
@@ -14,7 +14,6 @@ import org.eclipse.emf.cdo.common.protocol.CDODataInput;
import org.eclipse.emf.cdo.common.protocol.CDODataOutput;
import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants;
import org.eclipse.emf.cdo.server.IView;
-import org.eclipse.emf.cdo.spi.server.InternalSession;
import java.io.IOException;
@@ -32,8 +31,7 @@ public class CloseViewIndication extends CDOServerReadIndication
protected void indicating(CDODataInput in) throws IOException
{
int viewID = in.readInt();
- InternalSession session = getSession();
- IView view = session.getView(viewID);
+ IView view = getView(viewID);
if (view != null)
{
view.close();
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CommitTransactionIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CommitTransactionIndication.java
index 8a1c87ca88..e0f91a7daa 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CommitTransactionIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CommitTransactionIndication.java
@@ -447,7 +447,7 @@ public class CommitTransactionIndication extends CDOServerIndicationWithMonitori
protected InternalTransaction getTransaction(int viewID)
{
- InternalView view = getSession().getView(viewID);
+ InternalView view = getView(viewID);
if (view instanceof InternalTransaction)
{
return (InternalTransaction)view;
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/EnableLockNotificationIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/EnableLockNotificationIndication.java
index 9514d55768..97f0e0d7bf 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/EnableLockNotificationIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/EnableLockNotificationIndication.java
@@ -33,7 +33,7 @@ public class EnableLockNotificationIndication extends CDOServerIndication
int viewID = in.readInt();
boolean enable = in.readBoolean();
- InternalView view = getSession().getView(viewID);
+ InternalView view = getView(viewID);
view.options().setLockNotificationEnabled(enable);
}
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockAreaIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockAreaIndication.java
index 67c65d0d80..cb2daf858d 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockAreaIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockAreaIndication.java
@@ -37,7 +37,7 @@ public class LockAreaIndication extends CDOServerWriteIndication
InternalLockManager lockManager = getRepository().getLockingManager();
int viewID = in.readInt();
- InternalView view = getSession().getView(viewID);
+ InternalView view = getView(viewID);
boolean create = in.readBoolean();
if (create)
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockDelegationIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockDelegationIndication.java
index ebf2de8565..442fbe5005 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockDelegationIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockDelegationIndication.java
@@ -14,7 +14,6 @@ import org.eclipse.emf.cdo.common.branch.CDOBranch;
import org.eclipse.emf.cdo.common.protocol.CDODataInput;
import org.eclipse.emf.cdo.common.protocol.CDODataOutput;
import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants;
-import org.eclipse.emf.cdo.server.IView;
import org.eclipse.emf.cdo.spi.server.InternalLockManager;
import org.eclipse.emf.cdo.spi.server.InternalSession;
import org.eclipse.emf.cdo.spi.server.InternalView;
@@ -60,7 +59,7 @@ public class LockDelegationIndication extends LockObjectsIndication
}
@Override
- protected IView getView(int viewID)
+ protected InternalView getView(int viewID)
{
// The viewID received as an argument, is the ID of the client's view, which
// does not exist on the master. So we ignore this argument and open a new
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockObjectsIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockObjectsIndication.java
index fc7a4d3414..2bcd0d7428 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockObjectsIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockObjectsIndication.java
@@ -46,11 +46,6 @@ public class LockObjectsIndication extends CDOServerWriteIndication
super(protocol, signalID);
}
- protected IView getView(int viewID)
- {
- return getSession().getView(viewID);
- }
-
@Override
protected void indicating(CDODataInput in) throws IOException
{
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockStateIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockStateIndication.java
index 92c85979ba..9c5a4c365f 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockStateIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockStateIndication.java
@@ -50,7 +50,7 @@ public class LockStateIndication extends CDOServerReadIndication
protected void indicating(CDODataInput in) throws IOException
{
int viewID = in.readInt();
- InternalView view = getSession().getView(viewID);
+ InternalView view = getView(viewID);
if (view == null)
{
throw new IllegalStateException("View not found");
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ObjectLockedIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ObjectLockedIndication.java
index 2ef7001468..53028c6f92 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ObjectLockedIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ObjectLockedIndication.java
@@ -39,7 +39,7 @@ public class ObjectLockedIndication extends CDOServerReadIndication
protected void indicating(CDODataInput in) throws IOException
{
int viewID = in.readInt();
- IView view = getSession().getView(viewID);
+ IView view = getView(viewID);
InternalLockManager lockManager = getRepository().getLockingManager();
LockType lockType = in.readCDOLockType();
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/QueryIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/QueryIndication.java
index a248fa2047..1dc0281e8e 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/QueryIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/QueryIndication.java
@@ -48,7 +48,7 @@ public class QueryIndication extends CDOServerReadIndication
protected void indicating(CDODataInput in) throws IOException
{
int viewID = in.readInt();
- InternalView view = getSession().getView(viewID);
+ InternalView view = getView(viewID);
CDOQueryInfo queryInfo = new CDOQueryInfoImpl(in);
xrefs = queryInfo.getQueryLanguage().equals(CDOProtocolConstants.QUERY_LANGUAGE_XREFS);
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ResetTransactionIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ResetTransactionIndication.java
index fa45694a26..c9a7fc133a 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ResetTransactionIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ResetTransactionIndication.java
@@ -14,7 +14,6 @@ import org.eclipse.emf.cdo.common.protocol.CDODataInput;
import org.eclipse.emf.cdo.common.protocol.CDODataOutput;
import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants;
import org.eclipse.emf.cdo.server.internal.net4j.bundle.OM;
-import org.eclipse.emf.cdo.spi.server.InternalSession;
import org.eclipse.emf.cdo.spi.server.InternalTransaction;
import org.eclipse.emf.cdo.spi.server.InternalTransaction.CommitAttempt;
@@ -57,8 +56,7 @@ public class ResetTransactionIndication extends CDOServerReadIndication
@Override
protected void responding(CDODataOutput out) throws IOException
{
- InternalSession session = getSession();
- InternalTransaction transaction = (InternalTransaction)session.getView(transactionID);
+ InternalTransaction transaction = (InternalTransaction)getView(transactionID);
CommitAttempt lastCommitSuccess = transaction.getLastCommitAttempt();
if (lastCommitSuccess != null && lastCommitSuccess.getCommitNumber() == commitNumber)
{
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/SwitchTargetIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/SwitchTargetIndication.java
index 31a34781d7..4d008bd179 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/SwitchTargetIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/SwitchTargetIndication.java
@@ -60,7 +60,7 @@ public class SwitchTargetIndication extends CDOServerReadIndicationWithMonitorin
invalidObjects.add(id);
}
- InternalView view = getSession().getView(viewID);
+ InternalView view = getView(viewID);
view.changeTarget(branchPoint, invalidObjects, allChangedObjects, allDetachedObjects);
}
finally
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/UnlockDelegationIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/UnlockDelegationIndication.java
index 956db46caa..b9f26b7bb2 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/UnlockDelegationIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/UnlockDelegationIndication.java
@@ -13,7 +13,6 @@ package org.eclipse.emf.cdo.server.internal.net4j.protocol;
import org.eclipse.emf.cdo.common.protocol.CDODataInput;
import org.eclipse.emf.cdo.common.protocol.CDODataOutput;
import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants;
-import org.eclipse.emf.cdo.server.IView;
import org.eclipse.emf.cdo.spi.server.InternalLockManager;
import org.eclipse.emf.cdo.spi.server.InternalSession;
import org.eclipse.emf.cdo.spi.server.InternalView;
@@ -55,7 +54,7 @@ public class UnlockDelegationIndication extends UnlockObjectsIndication
}
@Override
- protected IView getView(int viewID)
+ protected InternalView getView(int viewID)
{
InternalLockManager lockManager = getRepository().getLockingManager();
InternalSession session = getSession();
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/UnlockObjectsIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/UnlockObjectsIndication.java
index 945b0b8600..e0c5e8cc08 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/UnlockObjectsIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/UnlockObjectsIndication.java
@@ -83,9 +83,4 @@ public class UnlockObjectsIndication extends CDOServerWriteIndication
out.writeCDOLockState(state);
}
}
-
- protected IView getView(int viewID)
- {
- return getSession().getView(viewID);
- }
}
diff --git a/plugins/org.eclipse.net4j.util/.settings/.api_filters b/plugins/org.eclipse.net4j.util/.settings/.api_filters
index ea95b5f2b1..717e5483be 100644
--- a/plugins/org.eclipse.net4j.util/.settings/.api_filters
+++ b/plugins/org.eclipse.net4j.util/.settings/.api_filters
@@ -77,4 +77,13 @@
</message_arguments>
</filter>
</resource>
+ <resource path="src/org/eclipse/net4j/util/lifecycle/ILifecycle.java" type="org.eclipse.net4j.util.lifecycle.ILifecycle">
+ <filter id="403984517">
+ <message_arguments>
+ <message_argument value="org.eclipse.net4j.util.lifecycle.ILifecycle"/>
+ <message_argument value="org.eclipse.net4j.util.lifecycle.IDeactivateable"/>
+ <message_argument value="deactivate()"/>
+ </message_arguments>
+ </filter>
+ </resource>
</component>
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/ConcurrencyUtil.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/ConcurrencyUtil.java
index 5a9905e821..89e21dfc26 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/ConcurrencyUtil.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/ConcurrencyUtil.java
@@ -12,6 +12,7 @@ package org.eclipse.net4j.util.concurrent;
import org.eclipse.net4j.util.container.IManagedContainer;
+import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
/**
@@ -86,4 +87,32 @@ public final class ConcurrencyUtil
return null;
}
+
+ /**
+ * @since 3.6
+ */
+ public static void execute(Object executor, Runnable runnable)
+ {
+ if (executor instanceof Executor)
+ {
+ ((Executor)executor).execute(runnable);
+ return;
+ }
+
+ ExecutorService executorService = getExecutorService(executor);
+ if (executorService == null && executor instanceof IManagedContainer)
+ {
+ executorService = getExecutorService((IManagedContainer)executor);
+ }
+
+ if (executorService != null)
+ {
+ executorService.execute(runnable);
+ return;
+ }
+
+ Thread thread = new Thread(runnable, runnable.getClass().getSimpleName());
+ thread.setDaemon(true);
+ thread.start();
+ }
}
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/lifecycle/IDeactivateable.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/lifecycle/IDeactivateable.java
new file mode 100644
index 0000000000..ea76f046fc
--- /dev/null
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/lifecycle/IDeactivateable.java
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2016 Eike Stepper (Berlin, Germany) and others.
+ * 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.net4j.util.lifecycle;
+
+/**
+ * @author Eike Stepper
+ * @apiviz.excludeSubtypes
+ * @since 3.6
+ */
+public interface IDeactivateable
+{
+ public Exception deactivate();
+}
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/lifecycle/ILifecycle.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/lifecycle/ILifecycle.java
index 7751399a3f..b1972e4f30 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/lifecycle/ILifecycle.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/lifecycle/ILifecycle.java
@@ -27,7 +27,7 @@ import org.eclipse.net4j.util.event.INotifier;
* @apiviz.uses {@link ILifecycleEvent} - - fires
* @apiviz.excludeSubtypes
*/
-public interface ILifecycle extends INotifier
+public interface ILifecycle extends IDeactivateable, INotifier
{
public void activate() throws LifecycleException;
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/lifecycle/LifecycleUtil.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/lifecycle/LifecycleUtil.java
index 05672b8e28..df36132e3b 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/lifecycle/LifecycleUtil.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/lifecycle/LifecycleUtil.java
@@ -229,9 +229,9 @@ public final class LifecycleUtil
*/
public static Exception deactivate(Object object, boolean useAnnotation)
{
- if (object instanceof ILifecycle)
+ if (object instanceof IDeactivateable)
{
- return ((ILifecycle)object).deactivate();
+ return ((IDeactivateable)object).deactivate();
}
else if (object != null && useAnnotation)
{
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/buffer/Buffer.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/buffer/Buffer.java
index 8a3e6d0058..df0ae7eb06 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/buffer/Buffer.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/buffer/Buffer.java
@@ -465,12 +465,21 @@ public class Buffer implements InternalBuffer
public void handleError(Throwable t)
{
- if (errorHandler != null)
+ try
{
- errorHandler.handleError(t);
+ if (errorHandler != null)
+ {
+ errorHandler.handleError(t);
+ }
+ else if (TRACER.isEnabled())
+ {
+ TRACER.trace(t);
+ }
+ }
+ finally
+ {
+ release();
}
-
- release();
}
private static void readChannel(SocketChannel socketChannel, ByteBuffer buffer) throws ClosedChannelException
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/buffer/BufferPool.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/buffer/BufferPool.java
index a4171cf20b..de85b923d6 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/buffer/BufferPool.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/buffer/BufferPool.java
@@ -187,6 +187,9 @@ public class BufferPool extends BufferProvider implements IBufferPool.Introspect
++pooledBuffers;
}
+ /**
+ * @author Eike Stepper
+ */
private static final class BufferRef extends SoftReference<IBuffer>
{
public BufferRef(IBuffer buffer, ReferenceQueue<IBuffer> queue)

Back to the top