diff options
author | Eike Stepper | 2015-07-17 09:03:31 +0000 |
---|---|---|
committer | Eike Stepper | 2015-07-17 09:03:31 +0000 |
commit | 504b4e687c057d5b29bc7ff461dea2e840602185 (patch) | |
tree | dcba411e7495f982f5e1db45164d2c2aab615040 /plugins | |
parent | 0d7c85286fc360c149c5f3f2e93c6193a4892a3f (diff) | |
download | cdo-504b4e687c057d5b29bc7ff461dea2e840602185.tar.gz cdo-504b4e687c057d5b29bc7ff461dea2e840602185.tar.xz cdo-504b4e687c057d5b29bc7ff461dea2e840602185.zip |
[472924] Problems with explicit locking and high-frequency session open/close
https://bugs.eclipse.org/bugs/show_bug.cgi?id=472924
Diffstat (limited to 'plugins')
33 files changed, 855 insertions, 164 deletions
diff --git a/plugins/org.eclipse.emf.cdo.common/.settings/.api_filters b/plugins/org.eclipse.emf.cdo.common/.settings/.api_filters index 6c0a1fc2af..885b598dee 100644 --- a/plugins/org.eclipse.emf.cdo.common/.settings/.api_filters +++ b/plugins/org.eclipse.emf.cdo.common/.settings/.api_filters @@ -177,6 +177,13 @@ <message_argument value="19"/> </message_arguments> </filter> + <filter id="388194388"> + <message_arguments> + <message_argument value="org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants"/> + <message_argument value="PROTOCOL_VERSION"/> + <message_argument value="26"/> + </message_arguments> + </filter> </resource> <resource path="src/org/eclipse/emf/cdo/spi/common/id/AbstractCDOID.java" type="org.eclipse.emf.cdo.spi.common.id.AbstractCDOID"> <filter id="337682486"> diff --git a/plugins/org.eclipse.emf.cdo.common/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.common/META-INF/MANIFEST.MF index 3c0340ef51..f9852b96bc 100644 --- a/plugins/org.eclipse.emf.cdo.common/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.emf.cdo.common/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-SymbolicName: org.eclipse.emf.cdo.common -Bundle-Version: 4.4.0.qualifier +Bundle-Version: 4.5.0.qualifier Bundle-Name: %pluginName Bundle-Vendor: %providerName Bundle-Localization: plugin @@ -14,21 +14,21 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)";visibili org.eclipse.emf.ecore.change;bundle-version="[2.5.0,3.0.0)";visibility:=reexport, org.eclipse.emf.ecore.xmi;bundle-version="[2.5.0,3.0.0)";visibility:=reexport, org.eclipse.net4j.util;bundle-version="[3.0.0,4.0.0)";visibility:=reexport -Export-Package: org.eclipse.emf.cdo.common;version="4.4.0", - org.eclipse.emf.cdo.common.admin;version="4.4.0", - org.eclipse.emf.cdo.common.branch;version="4.4.0", - org.eclipse.emf.cdo.common.commit;version="4.4.0", - org.eclipse.emf.cdo.common.commit.handler;version="4.4.0", - org.eclipse.emf.cdo.common.id;version="4.4.0", - org.eclipse.emf.cdo.common.lob;version="4.4.0", - org.eclipse.emf.cdo.common.lock;version="4.4.0", - org.eclipse.emf.cdo.common.model;version="4.4.0", - org.eclipse.emf.cdo.common.protocol;version="4.4.0", - org.eclipse.emf.cdo.common.revision;version="4.4.0", - org.eclipse.emf.cdo.common.revision.delta;version="4.4.0", - org.eclipse.emf.cdo.common.security;version="4.4.0", - org.eclipse.emf.cdo.common.util;version="4.4.0", - org.eclipse.emf.cdo.internal.common;version="4.4.0"; +Export-Package: org.eclipse.emf.cdo.common;version="4.5.0", + org.eclipse.emf.cdo.common.admin;version="4.5.0", + org.eclipse.emf.cdo.common.branch;version="4.5.0", + org.eclipse.emf.cdo.common.commit;version="4.5.0", + org.eclipse.emf.cdo.common.commit.handler;version="4.5.0", + org.eclipse.emf.cdo.common.id;version="4.5.0", + org.eclipse.emf.cdo.common.lob;version="4.5.0", + org.eclipse.emf.cdo.common.lock;version="4.5.0", + org.eclipse.emf.cdo.common.model;version="4.5.0", + org.eclipse.emf.cdo.common.protocol;version="4.5.0", + org.eclipse.emf.cdo.common.revision;version="4.5.0", + org.eclipse.emf.cdo.common.revision.delta;version="4.5.0", + org.eclipse.emf.cdo.common.security;version="4.5.0", + org.eclipse.emf.cdo.common.util;version="4.5.0", + org.eclipse.emf.cdo.internal.common;version="4.5.0"; x-friends:="org.eclipse.emf.cdo.common, org.eclipse.emf.cdo.common.db, org.eclipse.emf.cdo, @@ -38,11 +38,11 @@ Export-Package: org.eclipse.emf.cdo.common;version="4.4.0", org.eclipse.emf.cdo.ui, org.eclipse.emf.cdo.tests, org.eclipse.emf.cdo.server.hibernate", - org.eclipse.emf.cdo.internal.common.branch;version="4.4.0"; + org.eclipse.emf.cdo.internal.common.branch;version="4.5.0"; x-friends:="org.eclipse.emf.cdo.tests, org.eclipse.emf.cdo.server.hibernate", - org.eclipse.emf.cdo.internal.common.bundle;version="4.4.0";x-internal:=true, - org.eclipse.emf.cdo.internal.common.commit;version="4.4.0"; + org.eclipse.emf.cdo.internal.common.bundle;version="4.5.0";x-internal:=true, + org.eclipse.emf.cdo.internal.common.commit;version="4.5.0"; x-friends:="org.eclipse.emf.cdo.common, org.eclipse.emf.cdo.common.db, org.eclipse.emf.cdo, @@ -51,7 +51,7 @@ Export-Package: org.eclipse.emf.cdo.common;version="4.4.0", org.eclipse.emf.cdo.server.net4j, org.eclipse.emf.cdo.ui, org.eclipse.emf.cdo.tests", - org.eclipse.emf.cdo.internal.common.id;version="4.4.0"; + org.eclipse.emf.cdo.internal.common.id;version="4.5.0"; x-friends:="org.eclipse.emf.cdo.common, org.eclipse.emf.cdo.common.db, org.eclipse.emf.cdo, @@ -62,9 +62,9 @@ Export-Package: org.eclipse.emf.cdo.common;version="4.4.0", org.eclipse.emf.cdo.tests, org.eclipse.emf.cdo.admin, org.eclipse.emf.cdo.server.admin", - org.eclipse.emf.cdo.internal.common.lock;version="4.4.0";x-internal:=true, - org.eclipse.emf.cdo.internal.common.messages;version="4.4.0";x-internal:=true, - org.eclipse.emf.cdo.internal.common.model;version="4.4.0"; + org.eclipse.emf.cdo.internal.common.lock;version="4.5.0";x-internal:=true, + org.eclipse.emf.cdo.internal.common.messages;version="4.5.0";x-internal:=true, + org.eclipse.emf.cdo.internal.common.model;version="4.5.0"; x-friends:="org.eclipse.emf.cdo.common, org.eclipse.emf.cdo.common.db, org.eclipse.emf.cdo, @@ -73,7 +73,7 @@ Export-Package: org.eclipse.emf.cdo.common;version="4.4.0", org.eclipse.emf.cdo.server.net4j, org.eclipse.emf.cdo.ui, org.eclipse.emf.cdo.tests", - org.eclipse.emf.cdo.internal.common.revision;version="4.4.0"; + org.eclipse.emf.cdo.internal.common.revision;version="4.5.0"; x-friends:="org.eclipse.emf.cdo.common, org.eclipse.emf.cdo.common.db, org.eclipse.emf.cdo, @@ -82,7 +82,7 @@ Export-Package: org.eclipse.emf.cdo.common;version="4.4.0", org.eclipse.emf.cdo.server.net4j, org.eclipse.emf.cdo.ui, org.eclipse.emf.cdo.tests", - org.eclipse.emf.cdo.internal.common.revision.delta;version="4.4.0"; + org.eclipse.emf.cdo.internal.common.revision.delta;version="4.5.0"; x-friends:="org.eclipse.emf.cdo.common, org.eclipse.emf.cdo.common.db, org.eclipse.emf.cdo, @@ -91,12 +91,12 @@ Export-Package: org.eclipse.emf.cdo.common;version="4.4.0", org.eclipse.emf.cdo.server.net4j, org.eclipse.emf.cdo.ui, org.eclipse.emf.cdo.tests", - org.eclipse.emf.cdo.spi.common;version="4.4.0", - org.eclipse.emf.cdo.spi.common.admin;version="4.4.0", - org.eclipse.emf.cdo.spi.common.branch;version="4.4.0", - org.eclipse.emf.cdo.spi.common.commit;version="4.4.0", - org.eclipse.emf.cdo.spi.common.id;version="4.4.0", - org.eclipse.emf.cdo.spi.common.lock;version="4.4.0", - org.eclipse.emf.cdo.spi.common.model;version="4.4.0", - org.eclipse.emf.cdo.spi.common.protocol;version="4.4.0", - org.eclipse.emf.cdo.spi.common.revision;version="4.4.0" + org.eclipse.emf.cdo.spi.common;version="4.5.0", + org.eclipse.emf.cdo.spi.common.admin;version="4.5.0", + org.eclipse.emf.cdo.spi.common.branch;version="4.5.0", + org.eclipse.emf.cdo.spi.common.commit;version="4.5.0", + org.eclipse.emf.cdo.spi.common.id;version="4.5.0", + org.eclipse.emf.cdo.spi.common.lock;version="4.5.0", + org.eclipse.emf.cdo.spi.common.model;version="4.5.0", + org.eclipse.emf.cdo.spi.common.protocol;version="4.5.0", + org.eclipse.emf.cdo.spi.common.revision;version="4.5.0" diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDOProtocolConstants.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDOProtocolConstants.java index 4f1b92e476..731e600bc9 100644 --- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDOProtocolConstants.java +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDOProtocolConstants.java @@ -30,8 +30,9 @@ public interface CDOProtocolConstants * @since 4.2 * @noreference This field is not intended to be referenced by clients. */ - public static final int PROTOCOL_VERSION = 26; // Add prefetch depth in LockStateRequest/Indication + public static final int PROTOCOL_VERSION = 27; // SIGNAL_OPENED_SESSION + // public static final int PROTOCOL_VERSION = 26; // Add prefetch depth in LockStateRequest/Indication // public static final int PROTOCOL_VERSION = 25; // OpenSessionResponse.repositoryAuthenticating // public static final int PROTOCOL_VERSION = 24; // SIGNAL_LOAD_OBJECT_LIFETIME // public static final int PROTOCOL_VERSION = 23; // Fix branch renaming @@ -300,6 +301,11 @@ public interface CDOProtocolConstants */ public static final short SIGNAL_LOAD_OBJECT_LIFETIME = 59; + /** + * @since 4.5 + */ + public static final short SIGNAL_OPENED_SESSION = 60; + // ////////////////////////////////////////////////////////////////////// // Session Refresh diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/CDONet4jSessionImpl.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/CDONet4jSessionImpl.java index 7fbbed067d..afaa833c4a 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/CDONet4jSessionImpl.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/CDONet4jSessionImpl.java @@ -200,6 +200,7 @@ public class CDONet4jSessionImpl extends CDOSessionImpl implements org.eclipse.e } repository.getTimeStamp(true); + sessionProtocol.openedSession(); } private CDOClientProtocol createProtocol() diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/RecoveringCDOSessionImpl.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/RecoveringCDOSessionImpl.java index 770a02c1f3..4507aafe4d 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/RecoveringCDOSessionImpl.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/RecoveringCDOSessionImpl.java @@ -206,6 +206,9 @@ public abstract class RecoveringCDOSessionImpl extends CDONet4jSessionImpl updateConnectorAndRepositoryName(); openSession(); + CDOSessionProtocol sessionProtocol = getSessionProtocol(); + sessionProtocol.openedSession(); + return runnables; } catch (RuntimeException ex) diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CDOClientProtocol.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CDOClientProtocol.java index dc7a16c263..899bbdf821 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CDOClientProtocol.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CDOClientProtocol.java @@ -49,6 +49,7 @@ import org.eclipse.emf.cdo.view.CDOView; import org.eclipse.emf.internal.cdo.session.CDOSessionImpl; import org.eclipse.net4j.signal.RemoteException; +import org.eclipse.net4j.signal.Request; import org.eclipse.net4j.signal.RequestWithConfirmation; import org.eclipse.net4j.signal.RequestWithMonitoring; import org.eclipse.net4j.signal.SignalReactor; @@ -131,6 +132,11 @@ public class CDOClientProtocol extends AuthenticatingSignalProtocol<CDOSessionIm return send(new RepositoryTimeRequest(this)); } + public void openedSession() + { + send(new OpenedSessionRequest(this)); + } + public EPackage[] loadPackages(CDOPackageUnit packageUnit) { return send(new LoadPackagesRequest(this, (InternalCDOPackageUnit)packageUnit)); @@ -527,6 +533,22 @@ public class CDOClientProtocol extends AuthenticatingSignalProtocol<CDOSessionIm } } + private void send(Request request) + { + try + { + request.sendAsync(); + } + catch (RuntimeException ex) + { + throw ex; + } + catch (Exception ex) + { + throw new TransportException(ex); + } + } + private <RESULT> RESULT send(RequestWithConfirmation<RESULT> request) { try diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/OpenedSessionRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/OpenedSessionRequest.java new file mode 100644 index 0000000000..ee055c7eff --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/OpenedSessionRequest.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2009-2013, 2015 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 + * Simon McDuff - bug 230832 + */ +package org.eclipse.emf.cdo.internal.net4j.protocol; + +import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants; + +import org.eclipse.net4j.signal.Request; +import org.eclipse.net4j.util.io.ExtendedDataOutputStream; + +/** + * @author Eike Stepper + */ +public class OpenedSessionRequest extends Request +{ + public OpenedSessionRequest(CDOClientProtocol protocol) + { + super(protocol, CDOProtocolConstants.SIGNAL_OPENED_SESSION); + } + + @Override + protected void requesting(ExtendedDataOutputStream out) throws Exception + { + out.writeBoolean(true); + } +} diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.server.net4j/META-INF/MANIFEST.MF index 9a286e1b00..048d55afcd 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.emf.cdo.server.net4j/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-SymbolicName: org.eclipse.emf.cdo.server.net4j;singleton:=true -Bundle-Version: 4.1.200.qualifier +Bundle-Version: 4.1.300.qualifier Bundle-Name: %pluginName Bundle-Vendor: %providerName Bundle-Localization: plugin @@ -12,6 +12,6 @@ Bundle-ClassPath: . Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)";resolution:=optional, org.eclipse.emf.cdo.server;bundle-version="[4.0.0,5.0.0)";visibility:=reexport, org.eclipse.net4j;bundle-version="[4.0.0,5.0.0)";visibility:=reexport -Export-Package: org.eclipse.emf.cdo.server.internal.net4j.bundle;version="4.1.200";x-internal:=true, - org.eclipse.emf.cdo.server.internal.net4j.protocol;version="4.1.200";x-friends:="org.eclipse.emf.cdo.tests", - org.eclipse.emf.cdo.server.net4j;version="4.1.200" +Export-Package: org.eclipse.emf.cdo.server.internal.net4j.bundle;version="4.1.300";x-internal:=true, + org.eclipse.emf.cdo.server.internal.net4j.protocol;version="4.1.300";x-friends:="org.eclipse.emf.cdo.tests", + org.eclipse.emf.cdo.server.net4j;version="4.1.300" diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerProtocol.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerProtocol.java index 1f3f8cba50..88bbb15734 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerProtocol.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerProtocol.java @@ -34,6 +34,7 @@ import org.eclipse.net4j.signal.security.AuthenticationRequest; import org.eclipse.net4j.util.io.StringCompressor; import org.eclipse.net4j.util.io.StringIO; import org.eclipse.net4j.util.lifecycle.LifecycleUtil; +import org.eclipse.net4j.util.om.trace.ContextTracer; import org.eclipse.net4j.util.security.CredentialsUpdateOperation; import org.eclipse.net4j.util.security.DiffieHellman.Client.Response; import org.eclipse.net4j.util.security.DiffieHellman.Server.Challenge; @@ -45,6 +46,8 @@ public class CDOServerProtocol extends SignalProtocol<InternalSession>implements { public static final long DEFAULT_NEGOTIATION_TIMEOUT = 15 * 1000; + private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG_PROTOCOL, CDOServerProtocol.class); + private long negotiationTimeout = DEFAULT_NEGOTIATION_TIMEOUT; private IRepositoryProvider repositoryProvider; @@ -220,7 +223,10 @@ public class CDOServerProtocol extends SignalProtocol<InternalSession>implements protected void handleInactiveSession() { - OM.LOG.warn("Session channel is inactive: " + this); //$NON-NLS-1$ + if (TRACER.isEnabled()) + { + TRACER.trace("Session channel is inactive: " + this); //$NON-NLS-1$ + } } @Override @@ -378,6 +384,9 @@ public class CDOServerProtocol extends SignalProtocol<InternalSession>implements case SIGNAL_LOAD_OBJECT_LIFETIME: return new LoadObjectLifetimeIndication(this); + case SIGNAL_OPENED_SESSION: + return new OpenedSessionNotification(this); + default: return super.createSignalReactor(signalID); } 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 4681bdfa03..23822b846a 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,6 +46,11 @@ 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 { @@ -66,11 +71,6 @@ public class LockObjectsIndication extends CDOServerWriteIndication result = repository.lock((InternalView)view, lockType, revisionKeys, recursive, timeout); } - protected IView getView(int viewID) - { - return getSession().getView(viewID); - } - @Override protected void responding(CDODataOutput out) throws IOException { diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/OpenSessionIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/OpenSessionIndication.java index 4078fed6a3..7c02e8cefd 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/OpenSessionIndication.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/OpenSessionIndication.java @@ -192,7 +192,7 @@ public class OpenSessionIndication extends CDOServerIndicationWithMonitoring } out.writeLong(repository.getCreationTime()); - out.writeLong(repository.getLastCommitTimeStamp()); + out.writeLong(session.getFirstUpdateTime()); out.writeCDOID(repository.getRootResourceID()); out.writeBoolean(repository.isAuthenticating()); out.writeBoolean(repository.isSupportingAudits()); diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/OpenedSessionNotification.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/OpenedSessionNotification.java new file mode 100644 index 0000000000..9750edb2ce --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/OpenedSessionNotification.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2009-2013, 2015 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 + * Christian W. Damus (CEA LIST) - bug 418454 + */ +package org.eclipse.emf.cdo.server.internal.net4j.protocol; + +import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants; +import org.eclipse.emf.cdo.spi.server.InternalSession; + +import org.eclipse.net4j.signal.Indication; +import org.eclipse.net4j.util.io.ExtendedDataInputStream; + +/** + * @author Eike Stepper + */ +public class OpenedSessionNotification extends Indication +{ + public OpenedSessionNotification(CDOServerProtocol protocol) + { + super(protocol, CDOProtocolConstants.SIGNAL_OPENED_SESSION); + } + + @Override + protected void indicating(ExtendedDataInputStream in) throws Exception + { + CDOServerProtocol protocol = (CDOServerProtocol)getProtocol(); + InternalSession session = protocol.getSession(); + + if (in.readBoolean()) + { + session.setOpenOnClientSide(); + } + else + { + // Can't possibly happen. + session.close(); + } + } +} diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/RepositoryTimeIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/RepositoryTimeIndication.java index 19f6bda99a..6a124f709a 100644 --- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/RepositoryTimeIndication.java +++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/RepositoryTimeIndication.java @@ -42,13 +42,13 @@ public class RepositoryTimeIndication extends CDOServerIndication @Override protected void indicating(CDODataInput in) throws IOException { - indicated = System.currentTimeMillis(); + indicated = getRepository().getTimeStamp(); } @Override protected void responding(CDODataOutput out) throws IOException { - long responded = System.currentTimeMillis(); + long responded = getRepository().getTimeStamp(); if (TRACER.isEnabled()) { TRACER.format("Writing indicated: {0}", CDOCommonUtil.formatTimeStamp(indicated)); //$NON-NLS-1$ diff --git a/plugins/org.eclipse.emf.cdo.server/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.server/META-INF/MANIFEST.MF index 02091e9c4a..8a287f1d7e 100644 --- a/plugins/org.eclipse.emf.cdo.server/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.emf.cdo.server/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-SymbolicName: org.eclipse.emf.cdo.server;singleton:=true -Bundle-Version: 4.4.0.qualifier +Bundle-Version: 4.5.0.qualifier Bundle-Name: %pluginName Bundle-Vendor: %providerName Bundle-Localization: plugin @@ -10,18 +10,18 @@ Bundle-Activator: org.eclipse.emf.cdo.internal.server.bundle.OM$Activator Bundle-RequiredExecutionEnvironment: J2SE-1.5 Bundle-ClassPath: . Require-Bundle: org.eclipse.emf.cdo;bundle-version="[4.0.0,5.0.0)";visibility:=reexport -Export-Package: org.eclipse.emf.cdo.internal.server;version="4.4.0"; +Export-Package: org.eclipse.emf.cdo.internal.server;version="4.5.0"; x-friends:="org.eclipse.emf.cdo.server.db, org.eclipse.emf.cdo.server.net4j, org.eclipse.emf.cdo.tests, org.eclipse.emf.cdo.workspace, org.eclipse.emf.cdo.server.hibernate", - org.eclipse.emf.cdo.internal.server.bundle;version="4.4.0";x-internal:=true, - org.eclipse.emf.cdo.internal.server.embedded;version="4.4.0";x-friends:="org.eclipse.emf.cdo.tests", - org.eclipse.emf.cdo.internal.server.mem;version="4.4.0";x-friends:="org.eclipse.emf.cdo.tests", - org.eclipse.emf.cdo.internal.server.messages;version="4.4.0";x-internal:=true, - org.eclipse.emf.cdo.internal.server.syncing;version="4.4.0";x-friends:="org.eclipse.emf.cdo.tests", - org.eclipse.emf.cdo.server;version="4.4.0", - org.eclipse.emf.cdo.server.embedded;version="4.4.0", - org.eclipse.emf.cdo.server.mem;version="4.4.0", - org.eclipse.emf.cdo.spi.server;version="4.4.0" + org.eclipse.emf.cdo.internal.server.bundle;version="4.5.0";x-internal:=true, + org.eclipse.emf.cdo.internal.server.embedded;version="4.5.0";x-friends:="org.eclipse.emf.cdo.tests", + org.eclipse.emf.cdo.internal.server.mem;version="4.5.0";x-friends:="org.eclipse.emf.cdo.tests", + org.eclipse.emf.cdo.internal.server.messages;version="4.5.0";x-internal:=true, + org.eclipse.emf.cdo.internal.server.syncing;version="4.5.0";x-friends:="org.eclipse.emf.cdo.tests", + org.eclipse.emf.cdo.server;version="4.5.0", + org.eclipse.emf.cdo.server.embedded;version="4.5.0", + org.eclipse.emf.cdo.server.mem;version="4.5.0", + org.eclipse.emf.cdo.spi.server;version="4.5.0" diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java index f20c26fd32..4b01cdf59d 100644 --- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java +++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java @@ -208,6 +208,8 @@ public class Repository extends Container<Object>implements InternalRepository // Bug 297940 private TimeStampAuthority timeStampAuthority = new TimeStampAuthority(this); + private long lastTreeRestructuringCommit = -1; + @ExcludeFromDump private transient Object commitTransactionLock = new Object(); @@ -1101,7 +1103,13 @@ public class Repository extends Container<Object>implements InternalRepository timeStampAuthority.failCommit(timestamp); } - private long lastTreeRestructuringCommit = -1; + public void executeOutsideStartCommit(Runnable runnable) + { + synchronized (timeStampAuthority) + { + runnable.run(); + } + } public void commit(InternalCommitContext commitContext, OMMonitor monitor) { @@ -1780,7 +1788,8 @@ public class Repository extends Container<Object>implements InternalRepository if (!revKey.equals(rev)) { - staleRevisions.add(revKey); + // Send back the *expected* revision keys, so that the client can check that it really has loaded those. + staleRevisions.add(CDORevisionUtil.copyRevisionKey(rev)); requiredTimestamp[0] = Math.max(requiredTimestamp[0], rev.getTimeStamp()); } } diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java index 368f3833e9..776eae1ed0 100644 --- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java +++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java @@ -34,6 +34,7 @@ import org.eclipse.emf.cdo.common.revision.CDORevisionUtil; import org.eclipse.emf.cdo.common.revision.delta.CDORevisionDelta; import org.eclipse.emf.cdo.common.security.CDOPermission; import org.eclipse.emf.cdo.internal.common.commit.DelegatingCommitInfo; +import org.eclipse.emf.cdo.internal.server.bundle.OM; import org.eclipse.emf.cdo.server.IPermissionManager; import org.eclipse.emf.cdo.server.IView; import org.eclipse.emf.cdo.session.remote.CDORemoteSessionMessage; @@ -64,11 +65,10 @@ import org.eclipse.emf.ecore.EReference; import org.eclipse.emf.ecore.EStructuralFeature; import java.text.MessageFormat; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentMap; import java.util.concurrent.atomic.AtomicInteger; /** @@ -90,12 +90,16 @@ public class Session extends Container<IView>implements InternalSession private LockNotificationMode lockNotificationMode = LockNotificationMode.IF_REQUIRED_BY_VIEWS; + private boolean openOnClientSide; + + private long firstUpdateTime; + private long lastUpdateTime; @ExcludeFromDump private Object lastUpdateTimeLock = new Object(); - private ConcurrentMap<Integer, InternalView> views = new ConcurrentHashMap<Integer, InternalView>(); + private Map<Integer, InternalView> views = new HashMap<Integer, InternalView>(); private AtomicInteger lastTempViewID = new AtomicInteger(); @@ -261,6 +265,27 @@ public class Session extends Container<IView>implements InternalSession } } + public long getFirstUpdateTime() + { + return firstUpdateTime; + } + + public void setFirstUpdateTime(long firstUpdateTime) + { + this.firstUpdateTime = firstUpdateTime; + } + + public boolean isOpenOnClientSide() + { + return openOnClientSide; + } + + public void setOpenOnClientSide() + { + openOnClientSide = true; + manager.openedOnClientSide(this); + } + public InternalView[] getElements() { checkActive(); @@ -271,7 +296,11 @@ public class Session extends Container<IView>implements InternalSession public boolean isEmpty() { checkActive(); - return views.isEmpty(); + + synchronized (views) + { + return views.isEmpty(); + } } public InternalView[] getViews() @@ -282,13 +311,20 @@ public class Session extends Container<IView>implements InternalSession private InternalView[] getViewsArray() { - return views.values().toArray(new InternalView[views.size()]); + synchronized (views) + { + return views.values().toArray(new InternalView[views.size()]); + } } public InternalView getView(int viewID) { checkActive(); - return views.get(viewID); + + synchronized (views) + { + return views.get(viewID); + } } /** @@ -329,7 +365,12 @@ public class Session extends Container<IView>implements InternalSession { checkActive(); int viewID = view.getViewID(); - views.put(viewID, view); + + synchronized (views) + { + views.put(viewID, view); + } + fireElementAddedEvent(view); } @@ -339,7 +380,14 @@ public class Session extends Container<IView>implements InternalSession public void viewClosed(InternalView view) { int viewID = view.getViewID(); - if (views.remove(viewID) == view) + InternalView removedView; + + synchronized (views) + { + removedView = views.remove(viewID); + } + + if (removedView == view) { view.doClose(); fireElementRemovedEvent(view); @@ -505,13 +553,23 @@ public class Session extends Container<IView>implements InternalSession // only then do we send the lockChangeInfo. for (InternalView view : getViews()) { - if (view.options().isLockNotificationEnabled()) + try { - CDOBranch affectedBranch = lockChangeInfo.getBranch(); - if (view.getBranch() == affectedBranch || affectedBranch == null) + if (view.options().isLockNotificationEnabled()) { - protocol.sendLockNotification(lockChangeInfo); - break; + CDOBranch affectedBranch = lockChangeInfo.getBranch(); + if (view.getBranch() == affectedBranch || affectedBranch == null) + { + protocol.sendLockNotification(lockChangeInfo); + break; + } + } + } + catch (Exception ex) + { + if (!view.isClosed()) + { + OM.LOG.warn("A problem occured while notifying view " + view, ex); } } } @@ -523,9 +581,19 @@ public class Session extends Container<IView>implements InternalSession { for (InternalView view : views) { - if (view.hasSubscription(id)) + try + { + if (view.hasSubscription(id)) + { + return true; + } + } + catch (Exception ex) { - return true; + if (!view.isClosed()) + { + OM.LOG.warn("A problem occured while checking subscriptions of view " + view, ex); + } } } diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionManager.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionManager.java index ae138dc858..14f55322d7 100644 --- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionManager.java +++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionManager.java @@ -36,7 +36,10 @@ import org.eclipse.emf.cdo.spi.server.InternalSessionManager; import org.eclipse.net4j.util.ObjectUtil; import org.eclipse.net4j.util.container.Container; +import org.eclipse.net4j.util.event.IListener; import org.eclipse.net4j.util.io.ExtendedDataInputStream; +import org.eclipse.net4j.util.lifecycle.ILifecycle; +import org.eclipse.net4j.util.lifecycle.LifecycleEventAdapter; import org.eclipse.net4j.util.lifecycle.LifecycleUtil; import org.eclipse.net4j.util.om.trace.ContextTracer; import org.eclipse.net4j.util.security.CredentialsUpdateOperation; @@ -74,6 +77,20 @@ public class SessionManager extends Container<ISession>implements InternalSessio private final AtomicInteger lastSessionID = new AtomicInteger(); + private final Map<InternalSession, List<CommitNotificationInfo>> commitNotificationInfoQueues = new HashMap<InternalSession, List<CommitNotificationInfo>>(); + + private final IListener sessionListener = new LifecycleEventAdapter() + { + @Override + protected void onDeactivated(ILifecycle lifecycle) + { + synchronized (commitNotificationInfoQueues) + { + commitNotificationInfoQueues.remove(lifecycle); + } + } + }; + /** * @since 2.0 */ @@ -191,19 +208,28 @@ public class SessionManager extends Container<ISession>implements InternalSessio */ public InternalSession openSession(ISessionProtocol sessionProtocol) { - int id = lastSessionID.incrementAndGet(); + final int id = lastSessionID.incrementAndGet(); if (TRACER.isEnabled()) { TRACER.trace("Opening session " + id); //$NON-NLS-1$ } String userID = authenticateUser(sessionProtocol); - InternalSession session = createSession(id, userID, sessionProtocol); + final InternalSession session = createSession(id, userID, sessionProtocol); LifecycleUtil.activate(session); synchronized (sessions) { - sessions.put(id, session); + repository.executeOutsideStartCommit(new Runnable() + { + public void run() + { + long firstUpdateTime = repository.getLastCommitTimeStamp(); + session.setFirstUpdateTime(firstUpdateTime); + + sessions.put(id, session); + } + }); } fireElementAddedEvent(session); @@ -232,6 +258,11 @@ public class SessionManager extends Container<ISession>implements InternalSessio } } + public void openedOnClientSide(InternalSession session) + { + processQueuedCommitNotifications(session); + } + public void sendRepositoryTypeNotification(CDOCommonRepository.Type oldType, CDOCommonRepository.Type newType) { for (InternalSession session : getSessions()) @@ -312,18 +343,67 @@ public class SessionManager extends Container<ISession>implements InternalSessio { if (session != sender) { - try + if (session.isOpenOnClientSide()) { - session.sendCommitNotification(info); + processQueuedCommitNotifications(session); + doSendCommitNotification(session, info); } - catch (Exception ex) + else { - handleNotificationProblem(session, ex); + queueCommitNotification(session, info); } } } } + private void doSendCommitNotification(InternalSession session, CommitNotificationInfo info) + { + try + { + session.sendCommitNotification(info); + } + catch (Exception ex) + { + handleNotificationProblem(session, ex); + } + } + + private void queueCommitNotification(InternalSession session, CommitNotificationInfo info) + { + synchronized (commitNotificationInfoQueues) + { + List<CommitNotificationInfo> queue = commitNotificationInfoQueues.get(session); + if (queue == null) + { + queue = new ArrayList<CommitNotificationInfo>(); + commitNotificationInfoQueues.put(session, queue); + + session.addListener(sessionListener); + } + + queue.add(info); + } + } + + private void processQueuedCommitNotifications(InternalSession session) + { + List<CommitNotificationInfo> queue; + synchronized (commitNotificationInfoQueues) + { + queue = commitNotificationInfoQueues.remove(session); + } + + if (queue != null && !session.isClosed()) + { + session.removeListener(sessionListener); + + for (CommitNotificationInfo queuedInfo : queue) + { + doSendCommitNotification(session, queuedInfo); + } + } + } + public void sendLockNotification(InternalSession sender, CDOLockChangeInfo lockChangeInfo) { for (InternalSession session : getSessions()) @@ -399,7 +479,17 @@ public class SessionManager extends Container<ISession>implements InternalSessio protected void handleNotificationProblem(InternalSession session, Throwable t) { - OM.LOG.warn("A problem occured while notifying session " + session, t); + if (session.isClosed()) + { + if (TRACER.isEnabled()) + { + TRACER.trace("A problem occured while notifying session " + session, t); + } + } + else + { + OM.LOG.warn("A problem occured while notifying session " + session, t); + } } public String authenticateUser(IAuthenticationProtocol protocol) throws SecurityException diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/TransactionCommitContext.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/TransactionCommitContext.java index ddd68c4447..b697e32cdc 100644 --- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/TransactionCommitContext.java +++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/TransactionCommitContext.java @@ -1108,6 +1108,7 @@ public class TransactionCommitContext implements InternalCommitContext detachedObjectsToUnlock.add(unlockable); } } + lockManager.unlock2(true, LockType.WRITE, transaction, detachedObjectsToUnlock, false); } } @@ -1144,6 +1145,7 @@ public class TransactionCommitContext implements InternalCommitContext CDOID id = delta.getID(); InternalCDORevision oldRevision = null; + String problem = null; try { @@ -1152,21 +1154,25 @@ public class TransactionCommitContext implements InternalCommitContext { if (oldRevision.getBranch() != delta.getBranch() || oldRevision.getVersion() != delta.getVersion()) { - oldRevision = null; + problem = "Attempt by " + transaction + " to modify historical revision: " + delta; } } } catch (Exception ex) { OM.LOG.error(ex); - oldRevision = null; + + problem = ex.getMessage(); + if (problem == null) + { + problem = ex.getClass().getName(); + } } - if (oldRevision == null) + if (problem != null) { // If the object is logically locked (see lockObjects) but has a wrong (newer) version, someone else modified it - throw new RollbackException(CDOProtocolConstants.ROLLBACK_REASON_COMMIT_CONFLICT, - "Attempt by " + transaction + " to modify historical revision: " + delta); + throw new RollbackException(CDOProtocolConstants.ROLLBACK_REASON_COMMIT_CONFLICT, problem); } // Make sure all chunks are loaded diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedClientSessionProtocol.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedClientSessionProtocol.java index 00f2f1d9c9..a038d9c92c 100644 --- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedClientSessionProtocol.java +++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedClientSessionProtocol.java @@ -166,6 +166,11 @@ public class EmbeddedClientSessionProtocol extends Lifecycle implements CDOSessi return result; } + public void openedSession() + { + throw new UnsupportedOperationException(); + } + @Deprecated public CDOLockState[] getLockStates(int viewID, Collection<CDOID> ids) { diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalRepository.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalRepository.java index a54fbaa582..c86b01b557 100644 --- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalRepository.java +++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalRepository.java @@ -65,7 +65,7 @@ import java.util.concurrent.Semaphore; * @noimplement This interface is not intended to be implemented by clients. */ public interface InternalRepository extends IRepository, PackageProcessor, PackageLoader, BranchLoader3, -RevisionLoader2, CommitInfoLoader, CDORevisionUnchunker + RevisionLoader2, CommitInfoLoader, CDORevisionUnchunker { public void setName(String name); @@ -168,6 +168,11 @@ RevisionLoader2, CommitInfoLoader, CDORevisionUnchunker public void failCommit(long timeStamp); /** + * @since 4.5 + */ + public void executeOutsideStartCommit(Runnable runnable); + + /** * @since 4.2 */ public void commit(InternalCommitContext commitContext, OMMonitor monitor); diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalSession.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalSession.java index 3d9c0bc3b8..22ac32b5a2 100644 --- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalSession.java +++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalSession.java @@ -48,6 +48,26 @@ public interface InternalSession extends ISession, CDOIDProvider, CDOPermissionP */ public void setUserID(String userID); + /** + * @since 4.5 + */ + public long getFirstUpdateTime(); + + /** + * @since 4.5 + */ + public void setFirstUpdateTime(long firstUpdateTime); + + /** + * @since 4.5 + */ + public boolean isOpenOnClientSide(); + + /** + * @since 4.5 + */ + public void setOpenOnClientSide(); + public InternalView[] getViews(); public InternalView getView(int viewID); diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalSessionManager.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalSessionManager.java index 9d57436952..9a0675f187 100644 --- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalSessionManager.java +++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalSessionManager.java @@ -116,6 +116,11 @@ public interface InternalSessionManager extends ISessionManager public void sessionClosed(InternalSession session); + /** + * @since 4.5 + */ + public void openedOnClientSide(InternalSession session); + public void sendRepositoryTypeNotification(CDOCommonRepository.Type oldType, CDOCommonRepository.Type newType); /** diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllConfigs.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllConfigs.java index 1598df139e..9199408d87 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllConfigs.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllConfigs.java @@ -97,6 +97,7 @@ public class AllConfigs extends ConfigTestSuite testClasses.add(LockingManagerRestartRepositoryTest.class); testClasses.add(LockingNotificationsTest.class); testClasses.add(LockingSequenceTest.class); + testClasses.add(LockingSequenceWithChildListTest.class); testClasses.add(MultiValuedOfAttributeTest.class); testClasses.add(MapTest.class); testClasses.add(FeatureMapTest.class); diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/LockingSequenceWithChildListTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/LockingSequenceWithChildListTest.java new file mode 100644 index 0000000000..465f41eb4b --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/LockingSequenceWithChildListTest.java @@ -0,0 +1,302 @@ +/* + * Copyright (c) 2015 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.emf.cdo.tests; + +import org.eclipse.emf.cdo.CDOLock; +import org.eclipse.emf.cdo.CDOObject; +import org.eclipse.emf.cdo.eresource.CDOResource; +import org.eclipse.emf.cdo.session.CDOSession; +import org.eclipse.emf.cdo.tests.config.IModelConfig; +import org.eclipse.emf.cdo.tests.config.ISessionConfig; +import org.eclipse.emf.cdo.tests.config.impl.ConfigTest.Requires; +import org.eclipse.emf.cdo.tests.model1.Category; +import org.eclipse.emf.cdo.tests.model1.Company; +import org.eclipse.emf.cdo.transaction.CDOTransaction; +import org.eclipse.emf.cdo.util.CDOUtil; + +import org.eclipse.net4j.util.io.IOUtil; + +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; + +/** + * Implementation based on LockingSequenceTest. + * + * @author Eike Stepper + */ +@Requires({ ISessionConfig.CAPABILITY_NET4J_JVM, IModelConfig.CAPABILITY_NATIVE }) +public class LockingSequenceWithChildListTest extends AbstractLockingTest +{ + private static final int USERS = 10; + + private static final int ADDITIONS = 100; + + private static final int RETRIES = 5; + + private static final long LOCK_TIMEOUT = 5000; + + private static final boolean LOG = false; + + @Override + protected void doSetUp() throws Exception + { + disableConsole(); + super.doSetUp(); + } + + @Override + protected void doTearDown() throws Exception + { + disableConsole(); + super.doTearDown(); + } + + public void testSafeCounter() throws Exception + { + disableConsole(); + final Company company = getModel1Factory().createCompany(); + + final CDOSession session = openSession(); + CDOTransaction transaction = session.openTransaction(); + CDOResource resource = transaction.createResource(getResourcePath("/res1")); + resource.getContents().add(company); + transaction.commit(); + + CountDownLatch latch = new CountDownLatch(USERS); + User[] users = new User[USERS]; + + for (int userID = 0; userID < USERS; userID++) + { + users[userID] = new User(userID, latch, company); + } + + for (int userID = 0; userID < USERS; userID++) + { + users[userID].start(); + } + + // A maximum of USERS x ADDITIONS x RETRIES calls to .lock() : should not last more than USERS x ADDITIONS x + // RETRIES x LOCK_TIMEOUT milliseconds... + // Let's leave them twice as long, just to be sure! + long TIMEOUT = 2 * USERS * ADDITIONS * RETRIES * LOCK_TIMEOUT; + latch.await(TIMEOUT, TimeUnit.MILLISECONDS); + + IOUtil.OUT().println("FINISHED"); + + // + // CHECK UP TIME! + // + + CDOObject cdoObject = CDOUtil.getCDOObject(company); + CDOLock lock = cdoObject.cdoWriteLock(); + assertEquals("Lock hasn't been released!", false, lock.isLockedByOthers()); + + assertEquals("There are unfinished users", 0, latch.getCount()); + + Exception exception = null; + for (int userID = 0; userID < USERS; userID++) + { + Exception ex = users[userID].getException(); + if (ex != null) + { + exception = ex; + ex.printStackTrace(); + } + } + + if (exception != null) + { + throw exception; + } + + for (User user : users) + { + if (null == user.getException()) + { + assertEquals(ADDITIONS, user.getAdditions()); + } + } + + IOUtil.OUT().println("SUCCESS"); + } + + private final class User extends Thread + { + private final CountDownLatch latch; + + private Company c; + + private int additions; + + private Exception exception; + + public User(int userID, CountDownLatch latch, Company company) + { + super("User" + userID); + this.latch = latch; + c = company; + } + + public Exception getException() + { + return exception; + } + + public int getAdditions() + { + return additions; + } + + @Override + public void run() + { + try + { + for (int allocation = 0; allocation < ADDITIONS; allocation++) + { + CDOSession session = LockingSequenceWithChildListTest.this.openSession(); + CDOTransaction transaction = session.openTransaction(); + + try + { + synchronized (transaction) + { + for (int retry = 0; retry < RETRIES; ++retry) + { + Company company = transaction.getObject(c); + CDOObject cdoObject = CDOUtil.getCDOObject(company); + CDOLock lock = cdoObject.cdoWriteLock(); + + TimerThread timerThread = new TimerThread(getName() + ": lock(" + LOCK_TIMEOUT + ")"); + + try + { + timerThread.start(); + lock.lock(LOCK_TIMEOUT); + + Category category = getModel1Factory().createCategory(); + company.getCategories().add(category); + + try + { + int version = cdoObject.cdoRevision().getVersion() + 1; + System.out.println(getName() + ": committing version " + version); + + transaction.setCommitComment(getName() + ": version " + version); + transaction.commit(); + + ++additions; + msg("Category added " + getAdditions()); + break; // No more retries. + } + catch (Exception ex) + { + exception = ex; + return; + } + } + catch (TimeoutException ex) + { + msg("Lock timed out."); + + exception = ex; + if (retry == RETRIES - 1) + { + msg("Exhausted!"); + return; + } + + msg("Trying again..."); + } + finally + { + timerThread.done(); + } + } + } + } + finally + { + session.close(); + } + } + } + finally + { + latch.countDown(); + } + } + + private void msg(String string) + { + if (LOG) + { + IOUtil.OUT().println(getName() + ": " + string); + } + } + } + + private final class TimerThread extends Thread + { + private final long timeout = LOCK_TIMEOUT * 4; + + private boolean done; + + public TimerThread(String name) + { + super(name); + } + + public void done() + { + done = true; + } + + @Override + public void run() + { + long start = System.currentTimeMillis(); + + while (!done) + { + long now = System.currentTimeMillis(); + if (now - start > timeout) + { + System.out.println(); + System.out.println( + getName() + " is taking more time than required : " + (now - start) + " ms > " + timeout + " ms."); + } + + try + { + sleep(10); + } + catch (InterruptedException ex) + { + ex.printStackTrace(); + if (LOG) + { + System.out.println(getName() + " : interrupted"); + } + + return; + } + } + + long end = System.currentTimeMillis(); + if (LOG) + { + System.out.println("" + getName() + " took " + (end - start) + " ms."); + } + } + } +} diff --git a/plugins/org.eclipse.emf.cdo/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo/META-INF/MANIFEST.MF index be8cc10765..f777ba29c3 100644 --- a/plugins/org.eclipse.emf.cdo/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.emf.cdo/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.emf.cdo; singleton:=true -Bundle-Version: 4.4.100.qualifier +Bundle-Version: 4.5.0.qualifier Bundle-ClassPath: . Bundle-Vendor: %providerName Bundle-Localization: plugin @@ -10,29 +10,29 @@ Bundle-Activator: org.eclipse.emf.internal.cdo.bundle.Activator$Implementation Bundle-RequiredExecutionEnvironment: J2SE-1.5 Require-Bundle: org.eclipse.core.expressions;bundle-version="[3.4.0,4.0.0)";resolution:=optional, org.eclipse.emf.cdo.common;bundle-version="[4.0.0,5.0.0)";visibility:=reexport -Export-Package: org.eclipse.emf.cdo;version="4.4.100", - org.eclipse.emf.cdo.eresource;version="4.4.100", - org.eclipse.emf.cdo.eresource.impl;version="4.4.100", - org.eclipse.emf.cdo.eresource.util;version="4.4.100", - org.eclipse.emf.cdo.eresource.validation;version="4.4.100", - org.eclipse.emf.cdo.etypes;version="4.4.100", - org.eclipse.emf.cdo.etypes.impl;version="4.4.100", - org.eclipse.emf.cdo.etypes.util;version="4.4.100", - org.eclipse.emf.cdo.session;version="4.4.100", - org.eclipse.emf.cdo.session.remote;version="4.4.100", - org.eclipse.emf.cdo.transaction;version="4.4.100", - org.eclipse.emf.cdo.util;version="4.4.100", - org.eclipse.emf.cdo.view;version="4.4.100", - org.eclipse.emf.internal.cdo;version="4.4.100", - org.eclipse.emf.internal.cdo.analyzer;version="4.4.100"; +Export-Package: org.eclipse.emf.cdo;version="4.5.0", + org.eclipse.emf.cdo.eresource;version="4.5.0", + org.eclipse.emf.cdo.eresource.impl;version="4.5.0", + org.eclipse.emf.cdo.eresource.util;version="4.5.0", + org.eclipse.emf.cdo.eresource.validation;version="4.5.0", + org.eclipse.emf.cdo.etypes;version="4.5.0", + org.eclipse.emf.cdo.etypes.impl;version="4.5.0", + org.eclipse.emf.cdo.etypes.util;version="4.5.0", + org.eclipse.emf.cdo.session;version="4.5.0", + org.eclipse.emf.cdo.session.remote;version="4.5.0", + org.eclipse.emf.cdo.transaction;version="4.5.0", + org.eclipse.emf.cdo.util;version="4.5.0", + org.eclipse.emf.cdo.view;version="4.5.0", + org.eclipse.emf.internal.cdo;version="4.5.0", + org.eclipse.emf.internal.cdo.analyzer;version="4.5.0"; x-friends:="org.eclipse.emf.cdo.net4j, org.eclipse.emf.cdo.server, org.eclipse.emf.cdo.tests, org.eclipse.emf.cdo.defs, org.eclipse.emf.cdo.ui", - org.eclipse.emf.internal.cdo.bundle;version="4.4.100";x-friends:="org.eclipse.emf.cdo.ui", - org.eclipse.emf.internal.cdo.messages;version="4.4.100";x-internal:=true, - org.eclipse.emf.internal.cdo.object;version="4.4.100"; + org.eclipse.emf.internal.cdo.bundle;version="4.5.0";x-friends:="org.eclipse.emf.cdo.ui", + org.eclipse.emf.internal.cdo.messages;version="4.5.0";x-internal:=true, + org.eclipse.emf.internal.cdo.object;version="4.5.0"; x-friends:="org.eclipse.emf.cdo.net4j, org.eclipse.emf.cdo.server, org.eclipse.emf.cdo.tests, @@ -42,14 +42,14 @@ Export-Package: org.eclipse.emf.cdo;version="4.4.100", org.eclipse.emf.cdo.explorer, org.eclipse.emf.cdo.explorer.ui, org.eclipse.emf.cdo.edit", - org.eclipse.emf.internal.cdo.query;version="4.4.100"; + org.eclipse.emf.internal.cdo.query;version="4.5.0"; x-friends:="org.eclipse.emf.cdo.net4j, org.eclipse.emf.cdo.server, org.eclipse.emf.cdo.tests, org.eclipse.emf.cdo.defs, org.eclipse.emf.cdo.ui, org.eclipse.emf.cdo.tests.objectivity", - org.eclipse.emf.internal.cdo.session;version="4.4.100"; + org.eclipse.emf.internal.cdo.session;version="4.5.0"; x-friends:="org.eclipse.emf.cdo.net4j, org.eclipse.emf.cdo.server, org.eclipse.emf.cdo.tests, @@ -60,25 +60,25 @@ Export-Package: org.eclipse.emf.cdo;version="4.4.100", org.eclipse.emf.cdo.security.ui, org.eclipse.emf.cdo.explorer, org.eclipse.emf.cdo.explorer.ui", - org.eclipse.emf.internal.cdo.session.remote;version="4.4.100"; + org.eclipse.emf.internal.cdo.session.remote;version="4.5.0"; x-friends:="org.eclipse.emf.cdo.net4j, org.eclipse.emf.cdo.server, org.eclipse.emf.cdo.tests, org.eclipse.emf.cdo.defs, org.eclipse.emf.cdo.ui", - org.eclipse.emf.internal.cdo.transaction;version="4.4.100"; + org.eclipse.emf.internal.cdo.transaction;version="4.5.0"; x-friends:="org.eclipse.emf.cdo.net4j, org.eclipse.emf.cdo.server, org.eclipse.emf.cdo.tests, org.eclipse.emf.cdo.defs, org.eclipse.emf.cdo.ui", - org.eclipse.emf.internal.cdo.util;version="4.4.100"; + org.eclipse.emf.internal.cdo.util;version="4.5.0"; x-friends:="org.eclipse.emf.cdo.net4j, org.eclipse.emf.cdo.server, org.eclipse.emf.cdo.tests, org.eclipse.emf.cdo.defs, org.eclipse.emf.cdo.ui", - org.eclipse.emf.internal.cdo.view;version="4.4.100"; + org.eclipse.emf.internal.cdo.view;version="4.5.0"; x-friends:="org.eclipse.emf.cdo.net4j, org.eclipse.emf.cdo.server, org.eclipse.emf.cdo.tests, @@ -87,5 +87,5 @@ Export-Package: org.eclipse.emf.cdo;version="4.4.100", org.eclipse.emf.cdo.ui.ide, org.eclipse.emf.cdo.explorer, org.eclipse.emf.cdo.explorer.ui", - org.eclipse.emf.spi.cdo;version="4.4.100" + org.eclipse.emf.spi.cdo;version="4.5.0" Bundle-ActivationPolicy: lazy diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java index 8d44eb8d1b..9062449980 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java @@ -1781,11 +1781,6 @@ public abstract class CDOSessionImpl extends CDOTransactionContainerImpl impleme public synchronized void reorderInvalidations(CDOCommitInfo commitInfo, InternalCDOTransaction sender, boolean clearResourcePathCache, byte securityImpact, Map<CDOID, CDOPermission> newPermissions) { - if (!isActive()) - { - return; - } - Invalidation invalidation = new Invalidation(commitInfo, sender, clearResourcePathCache, securityImpact, newPermissions); @@ -1950,7 +1945,7 @@ public abstract class CDOSessionImpl extends CDOTransactionContainerImpl impleme } finally { - // setLastUpdateTimeStamp() is not synchronized with the Invalidator. + // setLastUpdateTime() is not synchronized with the Invalidator. // Give the Invalidator another chance to schedule Invalidations. invalidator.scheduleInvalidations(); } diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/DelegatingSessionProtocol.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/DelegatingSessionProtocol.java index 18ef32154f..f271273012 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/DelegatingSessionProtocol.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/DelegatingSessionProtocol.java @@ -404,6 +404,23 @@ public class DelegatingSessionProtocol extends Lifecycle implements CDOSessionPr } } + public void openedSession() + { + int attempt = 0; + for (;;) + { + try + { + delegate.openedSession(); + return; + } + catch (Exception ex) + { + handleException(++attempt, ex); + } + } + } + @Deprecated public CDOLockState[] getLockStates(int viewID, Collection<CDOID> ids) { diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java index 03c2c13af6..8b6cd1ca12 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java @@ -37,6 +37,7 @@ import org.eclipse.emf.cdo.common.util.CDOException; import org.eclipse.emf.cdo.spi.common.branch.CDOBranchUtil; import org.eclipse.emf.cdo.spi.common.lock.InternalCDOLockState; import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevision; +import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevisionDelta; import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevisionManager; import org.eclipse.emf.cdo.transaction.CDOCommitContext; import org.eclipse.emf.cdo.transaction.CDOTransaction; @@ -352,11 +353,33 @@ public class CDOViewImpl extends AbstractCDOView if (!session.options().isPassiveUpdateEnabled()) { throw new AssertionError( - "Lock result requires client to wait, but client does not have passiveUpdates enabled."); + "Lock result requires client to wait, but client does not have passiveUpdates enabled"); } long requiredTimestamp = result.getRequiredTimestamp(); - waitForUpdate(requiredTimestamp); + if (!waitForUpdate(requiredTimestamp, 10000L)) + { + throw new AssertionError("Lock result requires client to wait for commit " + requiredTimestamp + + ", but client did not receive invalidations after " + lastUpdateTime); + } + + InternalCDOSession session = this.session; + InternalCDORevisionManager revisionManager = session.getRevisionManager(); + + for (CDORevisionKey requiredKey : result.getStaleRevisions()) + { + CDOID id = requiredKey.getID(); + InternalCDOObject object = getObject(id); + + CDORevision revision = object.cdoRevision(true); + if (!requiredKey.equals(revision)) + { + InternalCDORevision requiredRevision = revisionManager.getRevisionByVersion(id, requiredKey, + CDORevision.UNCHUNKED, true); + InternalCDORevisionDelta revisionDelta = requiredRevision.compare(revision); + CDOStateMachine.INSTANCE.invalidate(object, revisionDelta); + } + } } } @@ -976,19 +999,6 @@ public class CDOViewImpl extends AbstractCDOView public QueueRunner getInvalidationRunner() { - try - { - invalidationRunner.activate(); - } - catch (LifecycleException ex) - { - // Don't pollute the log if the worker thread is interrupted due to asynchronous view.close() - if (!(ex.getCause() instanceof InterruptedException)) - { - throw ex; - } - } - return invalidationRunner; } @@ -1265,6 +1275,25 @@ public class CDOViewImpl extends AbstractCDOView } @Override + protected void doAfterActivate() throws Exception + { + super.doAfterActivate(); + + try + { + invalidationRunner.activate(); + } + catch (LifecycleException ex) + { + // Don't pollute the log if the worker thread is interrupted due to asynchronous view.close() + if (!(ex.getCause() instanceof InterruptedException)) + { + throw ex; + } + } + } + + @Override protected void doBeforeDeactivate() throws Exception { // Detach viewset from the view diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/CDOSessionProtocol.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/CDOSessionProtocol.java index 25b2a24cc6..8ef89d8f25 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/CDOSessionProtocol.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/CDOSessionProtocol.java @@ -86,6 +86,11 @@ public interface CDOSessionProtocol extends CDOProtocol, PackageLoader, BranchLo public RepositoryTimeResult getRepositoryTime(); /** + * @since 4.5 + */ + public void openedSession(); + + /** * @since 3.0 */ public void disablePassiveUpdate(); diff --git a/plugins/org.eclipse.net4j.tests/META-INF/MANIFEST.MF b/plugins/org.eclipse.net4j.tests/META-INF/MANIFEST.MF index 58c0b74a24..a131dc475b 100644 --- a/plugins/org.eclipse.net4j.tests/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.net4j.tests/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-SymbolicName: org.eclipse.net4j.tests;singleton:=true -Bundle-Version: 4.1.300.qualifier +Bundle-Version: 4.1.400.qualifier Bundle-Name: %pluginName Bundle-Vendor: %providerName Bundle-Localization: plugin @@ -17,13 +17,13 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)";visibili org.eclipse.net4j.defs;bundle-version="[4.0.0,5.0.0)";visibility:=reexport, org.eclipse.net4j.util.defs;bundle-version="[4.0.0,5.0.0)";visibility:=reexport, org.junit;bundle-version="[4.0.0,5.0.0)";visibility:=reexport -Export-Package: org.eclipse.net4j.tests;version="4.1.300", - org.eclipse.net4j.tests.apps;version="4.1.300", - org.eclipse.net4j.tests.bugzilla;version="4.1.300", - org.eclipse.net4j.tests.bundle;version="4.1.300";x-internal:=true, - org.eclipse.net4j.tests.data;version="4.1.300", - org.eclipse.net4j.tests.defs;version="4.1.300", - org.eclipse.net4j.tests.signal;version="4.1.300", +Export-Package: org.eclipse.net4j.tests;version="4.1.400", + org.eclipse.net4j.tests.apps;version="4.1.400", + org.eclipse.net4j.tests.bugzilla;version="4.1.400", + org.eclipse.net4j.tests.bundle;version="4.1.400";x-internal:=true, + org.eclipse.net4j.tests.data;version="4.1.400", + org.eclipse.net4j.tests.defs;version="4.1.400", + org.eclipse.net4j.tests.signal;version="4.1.400", org.eclipse.net4j.util.tests;version="4.1.0", org.eclipse.net4j.util.tests.cache;version="4.1.0", org.eclipse.net4j.util.tests.defs;version="4.1.0", diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/AbstractOMTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/AbstractOMTest.java index 69caaf57dd..78f60077cf 100644 --- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/AbstractOMTest.java +++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/AbstractOMTest.java @@ -430,7 +430,7 @@ public abstract class AbstractOMTest extends TestCase deleteFiles(); } - public void deleteFiles() + public synchronized void deleteFiles() { for (File file : filesToDelete) { @@ -440,7 +440,7 @@ public abstract class AbstractOMTest extends TestCase filesToDelete.clear(); } - public void addFileToDelete(File file) + public synchronized void addFileToDelete(File file) { filesToDelete.add(file); } diff --git a/plugins/org.eclipse.net4j/META-INF/MANIFEST.MF b/plugins/org.eclipse.net4j/META-INF/MANIFEST.MF index a71a151acd..5cdff1a0c1 100644 --- a/plugins/org.eclipse.net4j/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.net4j/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-SymbolicName: org.eclipse.net4j;singleton:=true -Bundle-Version: 4.4.0.qualifier +Bundle-Version: 4.4.100.qualifier Bundle-Name: %pluginName Bundle-Vendor: %providerName Bundle-Localization: plugin @@ -11,7 +11,7 @@ Bundle-RequiredExecutionEnvironment: J2SE-1.5 Bundle-ClassPath: . Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)";resolution:=optional, org.eclipse.net4j.util;bundle-version="[3.0.0,4.0.0)";visibility:=reexport -Export-Package: org.eclipse.internal.net4j;version="4.4.0"; +Export-Package: org.eclipse.internal.net4j;version="4.4.100"; x-friends:="org.eclipse.net4j.http.server, org.eclipse.net4j.jvm, org.eclipse.net4j.tcp, @@ -20,7 +20,7 @@ Export-Package: org.eclipse.internal.net4j;version="4.4.0"; org.eclipse.net4j.http.tests, org.eclipse.net4j.tests, org.eclipse.net4j.defs", - org.eclipse.internal.net4j.buffer;version="4.4.0"; + org.eclipse.internal.net4j.buffer;version="4.4.100"; x-friends:="org.eclipse.net4j.http.server, org.eclipse.net4j.jvm, org.eclipse.net4j.tcp, @@ -29,17 +29,17 @@ Export-Package: org.eclipse.internal.net4j;version="4.4.0"; org.eclipse.net4j.http.tests, org.eclipse.net4j.tests, org.eclipse.net4j.defs", - org.eclipse.internal.net4j.bundle;version="4.4.0";x-internal:=true, - org.eclipse.net4j;version="4.4.0", - org.eclipse.net4j.acceptor;version="4.4.0", - org.eclipse.net4j.buffer;version="4.4.0", - org.eclipse.net4j.channel;version="4.4.0", - org.eclipse.net4j.connector;version="4.4.0", - org.eclipse.net4j.protocol;version="4.4.0", - org.eclipse.net4j.signal;version="4.4.0", - org.eclipse.net4j.signal.confirmation;version="4.4.0", - org.eclipse.net4j.signal.heartbeat;version="4.4.0", - org.eclipse.net4j.signal.security;version="4.4.0", - org.eclipse.net4j.signal.wrapping;version="4.4.0", - org.eclipse.spi.net4j;version="4.4.0" + org.eclipse.internal.net4j.bundle;version="4.4.100";x-internal:=true, + org.eclipse.net4j;version="4.4.100", + org.eclipse.net4j.acceptor;version="4.4.100", + org.eclipse.net4j.buffer;version="4.4.100", + org.eclipse.net4j.channel;version="4.4.100", + org.eclipse.net4j.connector;version="4.4.100", + org.eclipse.net4j.protocol;version="4.4.100", + org.eclipse.net4j.signal;version="4.4.100", + org.eclipse.net4j.signal.confirmation;version="4.4.100", + org.eclipse.net4j.signal.heartbeat;version="4.4.100", + org.eclipse.net4j.signal.security;version="4.4.100", + org.eclipse.net4j.signal.wrapping;version="4.4.100", + org.eclipse.spi.net4j;version="4.4.100" Eclipse-BuddyPolicy: registered diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/buffer/BufferInputStream.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/buffer/BufferInputStream.java index 5a36fa67a5..e3676f8794 100644 --- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/buffer/BufferInputStream.java +++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/buffer/BufferInputStream.java @@ -48,8 +48,14 @@ public class BufferInputStream extends InputStream implements IBufferHandler private IBuffer currentBuffer; + /** + * End Of Stream. + */ private boolean eos; + /** + * Close Channel After Me. + */ private boolean ccam; private RemoteException exception; @@ -141,7 +147,7 @@ public class BufferInputStream extends InputStream implements IBufferHandler if (tracerEnabled) { TRACER.trace("<-- " + HexUtil.formatByte(result) //$NON-NLS-1$ - + (result >= 32 ? " " + Character.toString((char)result) : "")); //$NON-NLS-1$ //$NON-NLS-2$ + + (result >= 32 ? " " + Character.toString((char)result) : "")); //$NON-NLS-1$ //$NON-NLS-2$ } if (!byteBuffer.hasRemaining()) |