summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-02-15 14:30:47 (EST)
committerEike Stepper2007-02-15 14:30:47 (EST)
commit6bc40c97e03599fb218a5909d61c905b9b0d4d5f (patch)
tree3701bc49c91e26ed37bf2d8d7061dab4e3d74980
parentb727d39bfdfdd597107910027a979f2be0221798 (diff)
downloadcdo-6bc40c97e03599fb218a5909d61c905b9b0d4d5f.zip
cdo-6bc40c97e03599fb218a5909d61c905b9b0d4d5f.tar.gz
cdo-6bc40c97e03599fb218a5909d61c905b9b0d4d5f.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.net4j.debug/src/org/eclipse/net4j/internal/debug/RemoteTraceManager.java2
-rw-r--r--plugins/org.eclipse.net4j.debug/src/org/eclipse/net4j/internal/debug/bundle/Activator.java2
-rw-r--r--plugins/org.eclipse.net4j.debug/src/org/eclipse/net4j/internal/debug/views/RemoteTraceView.java2
-rw-r--r--plugins/org.eclipse.net4j.tests/META-INF/MANIFEST.MF3
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AbstractOMTest.java2
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AbstractTCPTest.java105
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/HugeData.java4
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/SignalTest.java136
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/SynchronizingCorrelatorTest.java15
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TCPTransportTest.java335
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TestProtocolFactory.java6
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TinyData.java4
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/bundle/Activator.java2
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/signal/Indication1.java2
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/signal/Indication2.java2
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/signal/Request1.java2
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/signal/Request2.java2
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/signal/TestSignalProtocol.java6
-rw-r--r--plugins/org.eclipse.net4j/.options2
-rw-r--r--plugins/org.eclipse.net4j/META-INF/MANIFEST.MF4
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/AbstractOMBundle.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/AbstractOMPlatform.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/Activator.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/LegacyBundle.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/LegacyPlatform.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/Net4j.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/OMLoggerImpl.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/OMTraceHandlerEventImpl.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/OMTracerImpl.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/OSGiBundle.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/OSGiPlatform.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/AbstractAcceptor.java245
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/AbstractConnector.java252
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/AbstractProtocol.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/AbstractProtocolFactory.java14
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/BufferFactoryImpl.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/BufferImpl.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/BufferPoolImpl.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/BufferProviderImpl.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/BufferUtil.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/ChannelImpl.java18
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/ConnectorCredentialsImpl.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/DescriptionUtil.java58
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/ProtocolFactoryIDImpl.java23
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/container/AbstractContainer.java336
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/container/AbstractContainerAdapter.java (renamed from plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/container/ContainerAdapterImpl.java)16
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/container/ContainerAdapterIDImpl.java75
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/container/ContainerImpl.java65
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/container/DefaultContainer.java111
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/container/TransportContainerAdapter.java49
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/embedded/AbstractEmbeddedConnector.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/embedded/ClientEmbeddedConnectorImpl.java7
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/embedded/ServerEmbeddedConnectorImpl.java7
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/AbstractCachingMap.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/AbstractDelegatingMap.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/HashBag.java (renamed from plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/HashBag.java)4
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/Value.java (renamed from plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/Value.java)4
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/concurrent/AsynchronousWorkSerializer.java (renamed from plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/concurrent/AsynchronousWorkSerializer.java)7
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/concurrent/ResultSynchronizer.java (renamed from plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/concurrent/ResultSynchronizer.java)8
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/concurrent/SynchronizingCorrelator.java (renamed from plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/concurrent/SynchronizingCorrelator.java)27
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/concurrent/SynchronousWorkSerializer.java (renamed from plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/concurrent/SynchronousWorkSerializer.java)8
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/event/EventImpl.java34
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/event/NotifierImpl.java71
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/registry/AbstractDelegatingRegistry.java (renamed from plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/registry/AbstractDelegatingRegistry.java)6
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/registry/AbstractRegistry.java (renamed from plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/registry/AbstractRegistry.java)8
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/registry/HashMapDelegatingRegistry.java (renamed from plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/registry/HashMapDelegatingRegistry.java)6
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/registry/HashMapRegistry.java (renamed from plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/registry/HashMapRegistry.java)4
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/message/MessageDeserializer.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/message/MessageSerializer.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/remote/ServiceExporter.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/remote/ServiceImporter.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/Indication.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/IndicationWithResponse.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/Request.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/RequestWithConfirmation.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/Signal.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/SignalActor.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/SignalProtocol.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/SignalReactor.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/stream/BufferInputStream.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/stream/BufferOutputStream.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/stream/ChannelInputStream.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/stream/ChannelOutputStream.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/Acceptor.java23
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/AcceptorConnectorsEvent.java (renamed from plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/container/ContainerAdapterID.java)17
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/AcceptorFactory.java (renamed from plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ConnectorDescription.java)8
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/Buffer.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/BufferHandler.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/BufferPool.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/BufferProvider.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/Channel.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ChannelID.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/Connector.java68
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ConnectorChannelsEvent.java31
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ConnectorCredentials.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ConnectorException.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ConnectorFactory.java8
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ConnectorLocation.java9
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ConnectorNegotiator.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ConnectorState.java9
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ConnectorStateEvent.java23
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/Protocol.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ProtocolFactory.java16
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ProtocolFactoryID.java6
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/container/Container.java67
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/container/ContainerAdapter.java11
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/container/ContainerAdapterFactory.java9
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/container/ContainerUtil.java42
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/user/Credentials.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/user/User.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/HexUtil.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/IOUtil.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/ObjectUtil.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/ReflectUtil.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/StringUtil.java14
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/concurrent/ICorrelator.java (renamed from plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/concurrent/Correlator.java)4
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/concurrent/ISynchronizer.java (renamed from plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/concurrent/Synchronizer.java)10
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/concurrent/IWorkSerializer.java (renamed from plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/concurrent/WorkSerializer.java)4
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/event/IEvent.java19
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/event/IListener.java21
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/event/INotifier.java29
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/Activator.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/Deactivator.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/Lifecycle.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/LifecycleImpl.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/LifecycleListener.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/LifecycleNotifier.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/LifecycleUtil.java24
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/Singleton.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/OMBundle.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/OMLogHandler.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/OMLogger.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/OMPlatform.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/OMTraceHandler.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/OMTracer.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/log/EclipseLoggingBridge.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/log/OSGiLoggingBridge.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/log/PrintLogHandler.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/trace/ContextTracer.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/trace/PrintTraceHandler.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/trace/RemoteTraceHandler.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/trace/RemoteTraceServer.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/registry/IRegistry.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/registry/IRegistryDelta.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/registry/IRegistryEvent.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/stream/ExtendedDataInput.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/stream/ExtendedDataInputStream.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/stream/ExtendedDataOutput.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/stream/ExtendedDataOutputStream.java2
149 files changed, 1789 insertions, 944 deletions
diff --git a/plugins/org.eclipse.net4j.debug/src/org/eclipse/net4j/internal/debug/RemoteTraceManager.java b/plugins/org.eclipse.net4j.debug/src/org/eclipse/net4j/internal/debug/RemoteTraceManager.java
index b5a63a5..46de575 100644
--- a/plugins/org.eclipse.net4j.debug/src/org/eclipse/net4j/internal/debug/RemoteTraceManager.java
+++ b/plugins/org.eclipse.net4j.debug/src/org/eclipse/net4j/internal/debug/RemoteTraceManager.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j.debug/src/org/eclipse/net4j/internal/debug/bundle/Activator.java b/plugins/org.eclipse.net4j.debug/src/org/eclipse/net4j/internal/debug/bundle/Activator.java
index bf3da4c..7de2840 100644
--- a/plugins/org.eclipse.net4j.debug/src/org/eclipse/net4j/internal/debug/bundle/Activator.java
+++ b/plugins/org.eclipse.net4j.debug/src/org/eclipse/net4j/internal/debug/bundle/Activator.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j.debug/src/org/eclipse/net4j/internal/debug/views/RemoteTraceView.java b/plugins/org.eclipse.net4j.debug/src/org/eclipse/net4j/internal/debug/views/RemoteTraceView.java
index 91fd4db..ea59858 100644
--- a/plugins/org.eclipse.net4j.debug/src/org/eclipse/net4j/internal/debug/views/RemoteTraceView.java
+++ b/plugins/org.eclipse.net4j.debug/src/org/eclipse/net4j/internal/debug/views/RemoteTraceView.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j.tests/META-INF/MANIFEST.MF b/plugins/org.eclipse.net4j.tests/META-INF/MANIFEST.MF
index 2b858bd..4167f88 100644
--- a/plugins/org.eclipse.net4j.tests/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.net4j.tests/META-INF/MANIFEST.MF
@@ -8,5 +8,6 @@ Bundle-Activator: org.eclipse.net4j.tests.bundle.Activator
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.eclipse.core.runtime,
+ org.junit,
org.eclipse.net4j,
- org.junit
+ org.eclipse.net4j.tcp
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AbstractOMTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AbstractOMTest.java
index ba33eaf..06f033a 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AbstractOMTest.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AbstractOMTest.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AbstractTCPTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AbstractTCPTest.java
new file mode 100644
index 0000000..517e0fc
--- /dev/null
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/AbstractTCPTest.java
@@ -0,0 +1,105 @@
+/***************************************************************************
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ **************************************************************************/
+package org.eclipse.net4j.tests;
+
+import org.eclipse.net4j.internal.tcp.TCPContainerAdapterFactoryImpl;
+import org.eclipse.net4j.tcp.TCPUtil;
+import org.eclipse.net4j.transport.container.Container;
+import org.eclipse.net4j.transport.container.ContainerUtil;
+import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
+
+import org.eclipse.internal.net4j.transport.AbstractAcceptor;
+import org.eclipse.internal.net4j.transport.AbstractConnector;
+
+/**
+ * @author Eike Stepper
+ */
+public abstract class AbstractTCPTest extends AbstractOMTest
+{
+ protected static final String ACCEPTOR_DESCRIPTION = TCPUtil.createAcceptorDescription();
+
+ protected static final String CONNECTOR_DESCRIPTION = TCPUtil.createConnectorDescription("localhost");
+
+ protected Container container;
+
+ @SuppressWarnings("unused")
+ private AbstractAcceptor acceptor;
+
+ private AbstractConnector connector;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ container = createContainer();
+ LifecycleUtil.activate(container);
+
+ System.out.println();
+ System.out.println("---------------- START ----------------");
+ }
+
+ @Override
+ protected void tearDown() throws Exception
+ {
+ Thread.sleep(200);
+ System.out.println();
+ System.out.println("---------------- END ------------------");
+
+ try
+ {
+ LifecycleUtil.deactivate(container);
+ }
+ catch (Exception ex)
+ {
+ ex.printStackTrace();
+ }
+ finally
+ {
+ connector = null;
+ acceptor = null;
+ container = null;
+ super.tearDown();
+ }
+ }
+
+ protected Container createContainer()
+ {
+ Container container = ContainerUtil.createContainer();
+ container.register(new TCPContainerAdapterFactoryImpl());
+ return container;
+ }
+
+ protected AbstractAcceptor getAcceptor()
+ {
+ if (acceptor == null)
+ {
+ acceptor = (AbstractAcceptor)container.getAcceptor(ACCEPTOR_DESCRIPTION);
+ }
+
+ return acceptor;
+ }
+
+ protected AbstractConnector getConnector()
+ {
+ if (connector == null)
+ {
+ connector = (AbstractConnector)container.getConnector(CONNECTOR_DESCRIPTION);
+ }
+
+ return connector;
+ }
+
+ protected void startTransport()
+ {
+ assertTrue(getAcceptor().isActive());
+ assertTrue(getConnector().isActive());
+ }
+}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/HugeData.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/HugeData.java
index eb4e5aa..8c8e1b3 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/HugeData.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/HugeData.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -37,7 +37,7 @@ public final class HugeData
public static String getText()
{
return "/***************************************************************************" + NL
- + " * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany." + NL
+ + " * Copyright (c) 2004-2007 Eike Stepper, Germany." + NL
+ " * All rights reserved. This program and the accompanying materials" + NL
+ " * are made available under the terms of the Eclipse Public License v1.0" + NL
+ " * which accompanies this distribution, and is available at" + NL
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/SignalTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/SignalTest.java
index e6bff21..ab0aed7 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/SignalTest.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/SignalTest.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,125 +13,28 @@ package org.eclipse.net4j.tests;
import org.eclipse.net4j.tests.signal.Request1;
import org.eclipse.net4j.tests.signal.Request2;
import org.eclipse.net4j.tests.signal.TestSignalProtocol;
-import org.eclipse.net4j.transport.BufferProvider;
import org.eclipse.net4j.transport.Channel;
-import org.eclipse.net4j.transport.ProtocolFactory;
-import org.eclipse.net4j.transport.ProtocolFactoryID;
-import org.eclipse.net4j.transport.Connector.Type;
-import org.eclipse.net4j.util.Net4jUtil;
-import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
-import org.eclipse.net4j.util.registry.IRegistry;
-
-import org.eclipse.internal.net4j.transport.AbstractConnector;
-import org.eclipse.internal.net4j.transport.tcp.TCPAcceptorImpl;
-import org.eclipse.internal.net4j.transport.tcp.TCPSelectorImpl;
+import org.eclipse.net4j.transport.container.Container;
import java.util.Arrays;
-import java.util.Map;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
/**
* @author Eike Stepper
*/
-public class SignalTest extends AbstractOMTest
+public class SignalTest extends AbstractTCPTest
{
- private BufferProvider bufferPool;
-
- private TCPSelectorImpl selector;
-
- private TCPAcceptorImpl acceptor;
-
- private AbstractConnector connector;
-
@Override
- protected void setUp() throws Exception
+ protected Container createContainer()
{
- super.setUp();
- bufferPool = Net4jUtil.createBufferPool((short)64);
- LifecycleUtil.activate(bufferPool);
- assertTrue(LifecycleUtil.isActive(bufferPool));
-
- selector = (TCPSelectorImpl)Net4jUtil.createTCPSelector();
- selector.activate();
- assertTrue(selector.isActive());
-
- acceptor = (TCPAcceptorImpl)Net4jUtil.createTCPAcceptor(bufferPool, selector);
- connector = (AbstractConnector)Net4jUtil.createTCPConnector(bufferPool, selector, "localhost");
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- try
- {
- if (connector != null)
- {
- connector.disconnect();
- assertFalse(LifecycleUtil.isActive(connector));
- assertFalse(connector.isConnected());
- connector = null;
- }
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
- }
-
- try
- {
- acceptor.deactivate();
- assertFalse(acceptor.isActive());
- acceptor = null;
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
- }
-
- try
- {
- selector.deactivate();
- selector = null;
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
- }
-
- try
- {
- LifecycleUtil.deactivate(bufferPool);
- bufferPool = null;
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
- }
-
- super.tearDown();
+ Container container = super.createContainer();
+ container.register(new TestSignalProtocol.Factory());
+ return container;
}
public void testInteger() throws Exception
{
- ExecutorService threadPool = Executors.newCachedThreadPool();
-
- Map<Type, IRegistry<ProtocolFactoryID, ProtocolFactory>> registries = //
- Net4jUtil.createProtocolFactoryRegistries(ProtocolFactory.SYMMETRIC);
-
- TestSignalProtocol.Factory factory = new TestSignalProtocol.Factory();
- Net4jUtil.registerProtocolFactory(factory, registries);
-
- acceptor.setReceiveExecutor(threadPool);
- acceptor.setProtocolFactoryRegistry(registries.get(Type.SERVER));
- acceptor.activate();
- assertTrue(acceptor.isActive());
-
- connector.setReceiveExecutor(threadPool);
- connector.setProtocolFactoryRegistry(registries.get(Type.CLIENT));
- assertTrue(connector.connect(1000));
-
- Channel channel = connector.openChannel(TestSignalProtocol.PROTOCOL_ID);
+ startTransport();
+ Channel channel = getConnector().openChannel(TestSignalProtocol.PROTOCOL_ID);
int data = 0x0a;
int result = new Request1(channel, data).send();
assertEquals(data, result);
@@ -139,27 +42,10 @@ public class SignalTest extends AbstractOMTest
public void testArray() throws Exception
{
- ExecutorService threadPool = Executors.newCachedThreadPool();
-
- Map<Type, IRegistry<ProtocolFactoryID, ProtocolFactory>> registries = //
- Net4jUtil.createProtocolFactoryRegistries(ProtocolFactory.SYMMETRIC);
-
- TestSignalProtocol.Factory factory = new TestSignalProtocol.Factory();
- Net4jUtil.registerProtocolFactory(factory, registries);
-
- acceptor.setReceiveExecutor(threadPool);
- acceptor.setProtocolFactoryRegistry(registries.get(Type.SERVER));
- acceptor.activate();
- assertTrue(acceptor.isActive());
-
- connector.setReceiveExecutor(threadPool);
- connector.setProtocolFactoryRegistry(registries.get(Type.CLIENT));
- assertTrue(connector.connect(1000));
-
- Channel channel = connector.openChannel(TestSignalProtocol.PROTOCOL_ID);
+ startTransport();
+ Channel channel = getConnector().openChannel(TestSignalProtocol.PROTOCOL_ID);
byte[] data = TinyData.getBytes();
byte[] result = new Request2(channel, data).send();
assertTrue(Arrays.equals(data, result));
-
}
}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/SynchronizingCorrelatorTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/SynchronizingCorrelatorTest.java
index 96b8851..6f3cd19 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/SynchronizingCorrelatorTest.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/SynchronizingCorrelatorTest.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,8 +10,9 @@
**************************************************************************/
package org.eclipse.net4j.tests;
-import org.eclipse.net4j.util.concurrent.Synchronizer;
-import org.eclipse.net4j.util.concurrent.SynchronizingCorrelator;
+import org.eclipse.net4j.util.concurrent.ISynchronizer;
+
+import org.eclipse.internal.net4j.util.concurrent.SynchronizingCorrelator;
/**
* @author Eike Stepper
@@ -27,7 +28,7 @@ public class SynchronizingCorrelatorTest extends AbstractOMTest
@Override
public void run()
{
- Synchronizer<Boolean> eike = correlator.correlate("eike");
+ ISynchronizer<Boolean> eike = correlator.correlate("eike");
result[0] = eike.get(5000);
System.out.println("RESULT: " + result[0]);
}
@@ -58,7 +59,7 @@ public class SynchronizingCorrelatorTest extends AbstractOMTest
@Override
public void run()
{
- Synchronizer<Boolean> eike = correlator.correlate("eike");
+ ISynchronizer<Boolean> eike = correlator.correlate("eike");
result[0] = eike.get(5000);
System.out.println("RESULT: " + result[0]);
}
@@ -94,7 +95,7 @@ public class SynchronizingCorrelatorTest extends AbstractOMTest
@Override
public void run()
{
- Synchronizer<Boolean> eike = correlator.correlate("eike");
+ ISynchronizer<Boolean> eike = correlator.correlate("eike");
result[0] = eike.get(5000);
System.out.println("RESULT: " + result[0]);
}
@@ -128,7 +129,7 @@ public class SynchronizingCorrelatorTest extends AbstractOMTest
@Override
public void run()
{
- Synchronizer<Boolean> eike = correlator.correlate("eike");
+ ISynchronizer<Boolean> eike = correlator.correlate("eike");
result[0] = eike.get(5000);
System.out.println("RESULT: " + result[0]);
}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TCPTransportTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TCPTransportTest.java
index 8f80b72..c91f173 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TCPTransportTest.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TCPTransportTest.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,23 +12,14 @@ package org.eclipse.net4j.tests;
import org.eclipse.net4j.stream.ChannelInputStream;
import org.eclipse.net4j.stream.ChannelOutputStream;
+import org.eclipse.net4j.tests.signal.TestSignalProtocol;
+import org.eclipse.net4j.transport.AcceptorConnectorsEvent;
import org.eclipse.net4j.transport.Buffer;
-import org.eclipse.net4j.transport.BufferProvider;
import org.eclipse.net4j.transport.Channel;
-import org.eclipse.net4j.transport.Connector;
-import org.eclipse.net4j.transport.ProtocolFactory;
-import org.eclipse.net4j.transport.ProtocolFactoryID;
-import org.eclipse.net4j.transport.Connector.Type;
-import org.eclipse.net4j.transport.tcp.TCPAcceptor;
-import org.eclipse.net4j.transport.tcp.TCPAcceptorListener;
-import org.eclipse.net4j.util.Net4jUtil;
-import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
-import org.eclipse.net4j.util.registry.HashMapRegistry;
-import org.eclipse.net4j.util.registry.IRegistry;
-
-import org.eclipse.internal.net4j.transport.tcp.AbstractTCPConnector;
-import org.eclipse.internal.net4j.transport.tcp.TCPAcceptorImpl;
-import org.eclipse.internal.net4j.transport.tcp.TCPSelectorImpl;
+import org.eclipse.net4j.transport.ConnectorChannelsEvent;
+import org.eclipse.net4j.transport.container.Container;
+import org.eclipse.net4j.util.event.IEvent;
+import org.eclipse.net4j.util.event.IListener;
import java.io.BufferedReader;
import java.io.DataInputStream;
@@ -39,112 +30,38 @@ import java.io.PrintStream;
import java.nio.ByteBuffer;
import java.util.StringTokenizer;
import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
/**
* @author Eike Stepper
*/
-public class TCPTransportTest extends AbstractOMTest
+public class TCPTransportTest extends AbstractTCPTest
{
- private BufferProvider bufferPool;
-
- private TCPSelectorImpl selector;
-
- private TCPAcceptorImpl acceptor;
-
- private AbstractTCPConnector connector;
-
@Override
- protected void setUp() throws Exception
+ protected Container createContainer()
{
- super.setUp();
- bufferPool = Net4jUtil.createBufferPool();
- LifecycleUtil.activate(bufferPool);
- assertTrue(LifecycleUtil.isActive(bufferPool));
-
- selector = (TCPSelectorImpl)Net4jUtil.createTCPSelector();
- selector.activate();
- assertTrue(selector.isActive());
-
- acceptor = (TCPAcceptorImpl)Net4jUtil.createTCPAcceptor(bufferPool, selector);
- connector = (AbstractTCPConnector)Net4jUtil.createTCPConnector(bufferPool, selector, "localhost");
-
- System.out.println("---------------- START ----------------");
+ Container container = super.createContainer();
+ container.register(new TestSignalProtocol.Factory());
+ return container;
}
- @Override
- protected void tearDown() throws Exception
+ protected Buffer provideBuffer()
{
- Thread.sleep(200);
- System.out.println("---------------- END ------------------");
-
- try
- {
- if (connector != null)
- {
- connector.disconnect();
- assertFalse(connector.isActive());
- assertFalse(connector.isConnected());
- connector = null;
- }
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
- }
-
- try
- {
- acceptor.deactivate();
- assertFalse(acceptor.isActive());
- acceptor = null;
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
- }
-
- try
- {
- selector.deactivate();
- selector = null;
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
- }
-
- try
- {
- LifecycleUtil.deactivate(bufferPool);
- bufferPool = null;
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
- }
-
- super.tearDown();
+ return container.getBufferProvider().provideBuffer();
}
public void testConnect() throws Exception
{
- acceptor.activate();
- assertTrue(acceptor.isActive());
- assertTrue(connector.connect(5000));
+ startTransport();
}
public void testSendBuffer() throws Exception
{
- acceptor.activate();
- assertTrue(acceptor.isActive());
- assertTrue(connector.connect(500000));
-
- Channel channel = connector.openChannel();
+ startTransport();
+ Channel channel = getConnector().openChannel();
for (int i = 0; i < 3; i++)
{
- Buffer buffer = bufferPool.provideBuffer();
+ Buffer buffer = provideBuffer();
ByteBuffer byteBuffer = buffer.startPutting(channel.getChannelIndex());
byteBuffer.putInt(1970);
channel.handleBuffer(buffer);
@@ -155,20 +72,13 @@ public class TCPTransportTest extends AbstractOMTest
{
final int COUNT = 3;
final CountDownLatch counter = new CountDownLatch(COUNT);
+ container.register(new TestProtocolFactory(counter));
+ startTransport();
- IRegistry<ProtocolFactoryID, ProtocolFactory> protocolFactoryRegistry = new HashMapRegistry();
- TestProtocolFactory factory = new TestProtocolFactory(counter);
- protocolFactoryRegistry.put(factory.createID(Type.SERVER), factory);
-
- acceptor.setProtocolFactoryRegistry(protocolFactoryRegistry);
- acceptor.activate();
- assertTrue(acceptor.isActive());
- assertTrue(connector.connect(5000));
-
- Channel channel = connector.openChannel(TestProtocolFactory.PROTOCOL_ID);
+ Channel channel = getConnector().openChannel(TestProtocolFactory.PROTOCOL_ID);
for (int i = 0; i < COUNT; i++)
{
- Buffer buffer = bufferPool.provideBuffer();
+ Buffer buffer = provideBuffer();
ByteBuffer byteBuffer = buffer.startPutting(channel.getChannelIndex());
byteBuffer.putInt(1970);
channel.handleBuffer(buffer);
@@ -196,7 +106,7 @@ public class TCPTransportTest extends AbstractOMTest
// Channel channel = connector.openChannel(TestProtocolFactory.PROTOCOL_ID);
// for (int i = 0; i < COUNT; i++)
// {
- // Buffer buffer = bufferPool.provideBuffer();
+ // Buffer buffer = provideBuffer();
// ByteBuffer byteBuffer = buffer.startPutting(channel.getChannelIndex());
// byteBuffer.putInt(1970);
// channel.handleBuffer(buffer);
@@ -224,7 +134,7 @@ public class TCPTransportTest extends AbstractOMTest
// Channel channel = connector.openChannel(TestProtocolFactory.PROTOCOL_ID);
// for (int i = 0; i < COUNT; i++)
// {
- // Buffer buffer = bufferPool.provideBuffer();
+ // Buffer buffer = provideBuffer();
// ByteBuffer byteBuffer = buffer.startPutting(channel.getChannelIndex());
// byteBuffer.putInt(1970);
// channel.handleBuffer(buffer);
@@ -233,68 +143,39 @@ public class TCPTransportTest extends AbstractOMTest
// assertTrue(counter.await(2, TimeUnit.SECONDS));
// }
- public void testReceiveThreadPool() throws Exception
- {
- final int COUNT = 3;
- final CountDownLatch counter = new CountDownLatch(COUNT);
-
- IRegistry<ProtocolFactoryID, ProtocolFactory> protocolFactoryRegistry = new HashMapRegistry();
- TestProtocolFactory factory = new TestProtocolFactory(counter);
- protocolFactoryRegistry.put(factory.createID(Type.SERVER), factory);
-
- acceptor.setProtocolFactoryRegistry(protocolFactoryRegistry);
- acceptor.setReceiveExecutor(Executors.newCachedThreadPool());
- acceptor.activate();
- assertTrue(acceptor.isActive());
- assertTrue(connector.connect(5000));
-
- Channel channel = connector.openChannel(TestProtocolFactory.PROTOCOL_ID);
- for (int i = 0; i < COUNT; i++)
- {
- Buffer buffer = bufferPool.provideBuffer();
- ByteBuffer byteBuffer = buffer.startPutting(channel.getChannelIndex());
- byteBuffer.putInt(1970);
- channel.handleBuffer(buffer);
- }
-
- assertTrue(counter.await(2, TimeUnit.SECONDS));
- }
-
public void testStreaming() throws Exception
{
final int COUNT = 1;
final CountDownLatch counter = new CountDownLatch(COUNT);
final ChannelInputStream[] inputStream = new ChannelInputStream[1];
- acceptor.setReceiveExecutor(Executors.newCachedThreadPool());
- acceptor.addAcceptorListener(new TCPAcceptorListener()
+ getAcceptor().addListener(new IListener()
{
- public void notifyConnectorAccepted(TCPAcceptor acceptor, Connector connector)
+ public void notifyEvent(IEvent event)
{
- connector.addChannelListener(new Connector.ChannelListener()
+ if (event instanceof AcceptorConnectorsEvent)
{
- public void notifyChannelAboutToOpen(Channel channel)
- {
- }
-
- public void notifyChannelClosing(Channel channel)
- {
- }
-
- public void notifyChannelOpened(Channel channel)
+ AcceptorConnectorsEvent e = (AcceptorConnectorsEvent)event;
+ e.getAcceptedConnector().addListener(new IListener()
{
- inputStream[0] = new ChannelInputStream(channel, 2000);
- counter.countDown();
- }
- });
+ public void notifyEvent(IEvent event)
+ {
+ if (event instanceof ConnectorChannelsEvent)
+ {
+ ConnectorChannelsEvent e = (ConnectorChannelsEvent)event;
+ if (e.getType() == ConnectorChannelsEvent.Type.OPENED)
+ {
+ inputStream[0] = new ChannelInputStream(e.getChannel(), 2000);
+ counter.countDown();
+ }
+ }
+ }
+ });
+ }
}
});
- acceptor.activate();
- assertTrue(acceptor.isActive());
- assertTrue(connector.connect(5000));
-
- Channel channel = connector.openChannel();
+ Channel channel = getConnector().openChannel();
assertTrue(counter.await(2, TimeUnit.SECONDS));
assertNotNull(inputStream[0]);
@@ -327,35 +208,33 @@ public class TCPTransportTest extends AbstractOMTest
final CountDownLatch counter = new CountDownLatch(COUNT);
final ChannelInputStream[] inputStream = new ChannelInputStream[1];
- acceptor.setReceiveExecutor(Executors.newCachedThreadPool());
- acceptor.addAcceptorListener(new TCPAcceptorListener()
+ getAcceptor().addListener(new IListener()
{
- public void notifyConnectorAccepted(TCPAcceptor acceptor, Connector connector)
+ public void notifyEvent(IEvent event)
{
- connector.addChannelListener(new Connector.ChannelListener()
+ if (event instanceof AcceptorConnectorsEvent)
{
- public void notifyChannelAboutToOpen(Channel channel)
- {
- }
-
- public void notifyChannelClosing(Channel channel)
+ AcceptorConnectorsEvent e = (AcceptorConnectorsEvent)event;
+ e.getAcceptedConnector().addListener(new IListener()
{
- }
-
- public void notifyChannelOpened(Channel channel)
- {
- inputStream[0] = new ChannelInputStream(channel, 2000);
- counter.countDown();
- }
- });
+ public void notifyEvent(IEvent event)
+ {
+ if (event instanceof ConnectorChannelsEvent)
+ {
+ ConnectorChannelsEvent e = (ConnectorChannelsEvent)event;
+ if (e.getType() == ConnectorChannelsEvent.Type.OPENED)
+ {
+ inputStream[0] = new ChannelInputStream(e.getChannel(), 2000);
+ counter.countDown();
+ }
+ }
+ }
+ });
+ }
}
});
- acceptor.activate();
- assertTrue(acceptor.isActive());
- assertTrue(connector.connect(5000));
-
- Channel channel = connector.openChannel();
+ Channel channel = getConnector().openChannel();
assertTrue(counter.await(2, TimeUnit.SECONDS));
assertNotNull(inputStream[0]);
@@ -395,35 +274,33 @@ public class TCPTransportTest extends AbstractOMTest
final CountDownLatch counter = new CountDownLatch(COUNT);
final ChannelInputStream[] inputStream = new ChannelInputStream[1];
- acceptor.setReceiveExecutor(Executors.newCachedThreadPool());
- acceptor.addAcceptorListener(new TCPAcceptorListener()
+ getAcceptor().addListener(new IListener()
{
- public void notifyConnectorAccepted(TCPAcceptor acceptor, Connector connector)
+ public void notifyEvent(IEvent event)
{
- connector.addChannelListener(new Connector.ChannelListener()
+ if (event instanceof AcceptorConnectorsEvent)
{
- public void notifyChannelAboutToOpen(Channel channel)
- {
- }
-
- public void notifyChannelClosing(Channel channel)
- {
- }
-
- public void notifyChannelOpened(Channel channel)
+ AcceptorConnectorsEvent e = (AcceptorConnectorsEvent)event;
+ e.getAcceptedConnector().addListener(new IListener()
{
- inputStream[0] = new ChannelInputStream(channel, 2000);
- counter.countDown();
- }
- });
+ public void notifyEvent(IEvent event)
+ {
+ if (event instanceof ConnectorChannelsEvent)
+ {
+ ConnectorChannelsEvent e = (ConnectorChannelsEvent)event;
+ if (e.getType() == ConnectorChannelsEvent.Type.OPENED)
+ {
+ inputStream[0] = new ChannelInputStream(e.getChannel(), 2000);
+ counter.countDown();
+ }
+ }
+ }
+ });
+ }
}
});
- acceptor.activate();
- assertTrue(acceptor.isActive());
- assertTrue(connector.connect(5000));
-
- final Channel channel = connector.openChannel();
+ final Channel channel = getConnector().openChannel();
assertTrue(counter.await(2, TimeUnit.SECONDS));
assertNotNull(inputStream[0]);
@@ -433,7 +310,7 @@ public class TCPTransportTest extends AbstractOMTest
{
try
{
- ChannelOutputStream outputStream = new ChannelOutputStream(channel, bufferPool);
+ ChannelOutputStream outputStream = new ChannelOutputStream(channel, container.getBufferProvider());
PrintStream printer = new PrintStream(outputStream);
StringTokenizer tokenizer = HugeData.getTokenizer();
while (tokenizer.hasMoreTokens())
@@ -477,35 +354,33 @@ public class TCPTransportTest extends AbstractOMTest
final CountDownLatch counter = new CountDownLatch(COUNT);
final ChannelInputStream[] inputStream = new ChannelInputStream[1];
- acceptor.setReceiveExecutor(Executors.newCachedThreadPool());
- acceptor.addAcceptorListener(new TCPAcceptorListener()
+ getAcceptor().addListener(new IListener()
{
- public void notifyConnectorAccepted(TCPAcceptor acceptor, Connector connector)
+ public void notifyEvent(IEvent event)
{
- connector.addChannelListener(new Connector.ChannelListener()
+ if (event instanceof AcceptorConnectorsEvent)
{
- public void notifyChannelAboutToOpen(Channel channel)
- {
- }
-
- public void notifyChannelClosing(Channel channel)
+ AcceptorConnectorsEvent e = (AcceptorConnectorsEvent)event;
+ e.getAcceptedConnector().addListener(new IListener()
{
- }
-
- public void notifyChannelOpened(Channel channel)
- {
- inputStream[0] = new ChannelInputStream(channel, 2000);
- counter.countDown();
- }
- });
+ public void notifyEvent(IEvent event)
+ {
+ if (event instanceof ConnectorChannelsEvent)
+ {
+ ConnectorChannelsEvent e = (ConnectorChannelsEvent)event;
+ if (e.getType() == ConnectorChannelsEvent.Type.OPENED)
+ {
+ inputStream[0] = new ChannelInputStream(e.getChannel(), 2000);
+ counter.countDown();
+ }
+ }
+ }
+ });
+ }
}
});
- acceptor.activate();
- assertTrue(acceptor.isActive());
- assertTrue(connector.connect(5000));
-
- Channel channel = connector.openChannel();
+ Channel channel = getConnector().openChannel();
assertTrue(counter.await(2, TimeUnit.SECONDS));
ChannelOutputStream outputStream = new ChannelOutputStream(channel);
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TestProtocolFactory.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TestProtocolFactory.java
index 198cb64..79cd120 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TestProtocolFactory.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TestProtocolFactory.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,9 +12,9 @@ package org.eclipse.net4j.tests;
import org.eclipse.net4j.transport.Buffer;
import org.eclipse.net4j.transport.Channel;
+import org.eclipse.net4j.transport.ConnectorLocation;
import org.eclipse.net4j.transport.Protocol;
import org.eclipse.net4j.transport.ProtocolFactory;
-import org.eclipse.net4j.transport.Connector.Type;
import org.eclipse.internal.net4j.transport.AbstractProtocol;
import org.eclipse.internal.net4j.transport.AbstractProtocolFactory;
@@ -41,7 +41,7 @@ public class TestProtocolFactory extends AbstractProtocolFactory implements Prot
return PROTOCOL_ID;
}
- public Set<Type> getConnectorTypes()
+ public Set<ConnectorLocation> getLocations()
{
return ProtocolFactory.SYMMETRIC;
}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TinyData.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TinyData.java
index 7e3da64..32f6def 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TinyData.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TinyData.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -36,6 +36,6 @@ public final class TinyData
public static String getText()
{
- return "Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany. All rights reserved.";
+ return "Copyright (c) 2004-2007 Eike Stepper, Germany. All rights reserved.";
}
}
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/bundle/Activator.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/bundle/Activator.java
index 463c315..513a76d 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/bundle/Activator.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/bundle/Activator.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/signal/Indication1.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/signal/Indication1.java
index 1027717..4d0680d 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/signal/Indication1.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/signal/Indication1.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/signal/Indication2.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/signal/Indication2.java
index 86be8c7..770718c 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/signal/Indication2.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/signal/Indication2.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/signal/Request1.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/signal/Request1.java
index 53b97bc..6f2f0f5 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/signal/Request1.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/signal/Request1.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/signal/Request2.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/signal/Request2.java
index 2618e1a..59d8a4c 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/signal/Request2.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/signal/Request2.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/signal/TestSignalProtocol.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/signal/TestSignalProtocol.java
index 01e1ff1..cfd37c4 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/signal/TestSignalProtocol.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/signal/TestSignalProtocol.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,9 +13,9 @@ package org.eclipse.net4j.tests.signal;
import org.eclipse.net4j.signal.SignalProtocol;
import org.eclipse.net4j.signal.SignalReactor;
import org.eclipse.net4j.transport.Channel;
+import org.eclipse.net4j.transport.ConnectorLocation;
import org.eclipse.net4j.transport.Protocol;
import org.eclipse.net4j.transport.ProtocolFactory;
-import org.eclipse.net4j.transport.Connector.Type;
import org.eclipse.internal.net4j.transport.AbstractProtocolFactory;
@@ -70,7 +70,7 @@ public class TestSignalProtocol extends SignalProtocol
return PROTOCOL_ID;
}
- public Set<Type> getConnectorTypes()
+ public Set<ConnectorLocation> getLocations()
{
return ProtocolFactory.SYMMETRIC;
}
diff --git a/plugins/org.eclipse.net4j/.options b/plugins/org.eclipse.net4j/.options
index 2d09c1c..d4803f3 100644
--- a/plugins/org.eclipse.net4j/.options
+++ b/plugins/org.eclipse.net4j/.options
@@ -1,4 +1,4 @@
-org.eclipse.net4j/debug = false
+org.eclipse.net4j/debug = true
org.eclipse.net4j/debug.lifecycle = true
org.eclipse.net4j/debug.lifecycle.dump = true
diff --git a/plugins/org.eclipse.net4j/META-INF/MANIFEST.MF b/plugins/org.eclipse.net4j/META-INF/MANIFEST.MF
index ed51d5e..6222771 100644
--- a/plugins/org.eclipse.net4j/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.net4j/META-INF/MANIFEST.MF
@@ -16,6 +16,9 @@ Export-Package: org.eclipse.internal.net4j.bundle;version="0.8.0",
org.eclipse.internal.net4j.transport.container;version="0.8.0",
org.eclipse.internal.net4j.transport.embedded;version="0.8.0",
org.eclipse.internal.net4j.util;version="0.8.0",
+ org.eclipse.internal.net4j.util.concurrent;version="0.8.0",
+ org.eclipse.internal.net4j.util.event;version="0.8.0",
+ org.eclipse.internal.net4j.util.registry;version="0.8.0",
org.eclipse.net4j;version="0.8.0",
org.eclipse.net4j.message;version="0.8.0",
org.eclipse.net4j.remote;version="0.8.0",
@@ -26,6 +29,7 @@ Export-Package: org.eclipse.internal.net4j.bundle;version="0.8.0",
org.eclipse.net4j.user;version="0.8.0",
org.eclipse.net4j.util;version="0.8.0",
org.eclipse.net4j.util.concurrent;version="0.8.0",
+ org.eclipse.net4j.util.event;version="0.8.0",
org.eclipse.net4j.util.lifecycle;version="0.8.0",
org.eclipse.net4j.util.om;version="0.8.0",
org.eclipse.net4j.util.om.log;version="0.8.0",
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/AbstractOMBundle.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/AbstractOMBundle.java
index ce6022f..2d9bb48 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/AbstractOMBundle.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/AbstractOMBundle.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/AbstractOMPlatform.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/AbstractOMPlatform.java
index 9481196..f71d1a7 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/AbstractOMPlatform.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/AbstractOMPlatform.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/Activator.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/Activator.java
index 2221c10..939b5e6 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/Activator.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/Activator.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/LegacyBundle.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/LegacyBundle.java
index e6f0cf9..0b66258 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/LegacyBundle.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/LegacyBundle.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/LegacyPlatform.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/LegacyPlatform.java
index f44add1..55892af 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/LegacyPlatform.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/LegacyPlatform.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/Net4j.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/Net4j.java
index 824d480..5d42179 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/Net4j.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/Net4j.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/OMLoggerImpl.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/OMLoggerImpl.java
index d705cdd..3afe0a8 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/OMLoggerImpl.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/OMLoggerImpl.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/OMTraceHandlerEventImpl.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/OMTraceHandlerEventImpl.java
index cde96bc..ac75e3c 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/OMTraceHandlerEventImpl.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/OMTraceHandlerEventImpl.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/OMTracerImpl.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/OMTracerImpl.java
index 402392f..59bfe3d 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/OMTracerImpl.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/OMTracerImpl.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/OSGiBundle.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/OSGiBundle.java
index ce33622..47a4262 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/OSGiBundle.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/OSGiBundle.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/OSGiPlatform.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/OSGiPlatform.java
index 8cf2b11..e313559 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/OSGiPlatform.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/bundle/OSGiPlatform.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/AbstractAcceptor.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/AbstractAcceptor.java
new file mode 100644
index 0000000..960292b
--- /dev/null
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/AbstractAcceptor.java
@@ -0,0 +1,245 @@
+/***************************************************************************
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ **************************************************************************/
+package org.eclipse.internal.net4j.transport;
+
+import org.eclipse.net4j.transport.Acceptor;
+import org.eclipse.net4j.transport.AcceptorConnectorsEvent;
+import org.eclipse.net4j.transport.Buffer;
+import org.eclipse.net4j.transport.BufferProvider;
+import org.eclipse.net4j.transport.Connector;
+import org.eclipse.net4j.transport.ProtocolFactory;
+import org.eclipse.net4j.transport.ProtocolFactoryID;
+import org.eclipse.net4j.util.event.IListener;
+import org.eclipse.net4j.util.event.INotifier;
+import org.eclipse.net4j.util.lifecycle.LifecycleImpl;
+import org.eclipse.net4j.util.lifecycle.LifecycleListener;
+import org.eclipse.net4j.util.lifecycle.LifecycleNotifier;
+import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
+import org.eclipse.net4j.util.om.trace.ContextTracer;
+import org.eclipse.net4j.util.registry.IRegistry;
+
+import org.eclipse.internal.net4j.bundle.Net4j;
+import org.eclipse.internal.net4j.util.event.EventImpl;
+import org.eclipse.internal.net4j.util.event.NotifierImpl;
+
+import java.nio.channels.Channel;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.concurrent.ExecutorService;
+
+/**
+ * @author Eike Stepper
+ */
+public abstract class AbstractAcceptor extends LifecycleImpl implements Acceptor, INotifier.Introspection
+
+{
+ private static final ContextTracer TRACER = new ContextTracer(Net4j.DEBUG_ACCEPTOR, AbstractAcceptor.class);
+
+ private String description;
+
+ private BufferProvider bufferProvider;
+
+ private IRegistry<ProtocolFactoryID, ProtocolFactory> protocolFactoryRegistry;
+
+ /**
+ * An optional executor to be used by the {@link Channel}s to process their
+ * {@link ChannelImpl#receiveQueue} instead of the current thread. If not
+ * <code>null</code> the calling thread of
+ * {@link ChannelImpl#handleBufferFromMultiplexer(Buffer)} becomes decoupled.
+ * <p>
+ */
+ private ExecutorService receiveExecutor;
+
+ private NotifierImpl notifier = new NotifierImpl();
+
+ private LifecycleListener connectorLifecycleListener = new LifecycleListener()
+ {
+ public void notifyLifecycleAboutToActivate(LifecycleNotifier notifier)
+ {
+ // Do nothing
+ }
+
+ public void notifyLifecycleActivated(LifecycleNotifier notifier)
+ {
+ // Do nothing
+ }
+
+ public void notifyLifecycleDeactivating(LifecycleNotifier notifier)
+ {
+ removeConnector((Connector)notifier);
+ }
+ };
+
+ private Set<Connector> acceptedConnectors = new HashSet(0);
+
+ public AbstractAcceptor()
+ {
+ }
+
+ public String getDescription()
+ {
+ return description;
+ }
+
+ public void setDescription(String description)
+ {
+ this.description = description;
+ }
+
+ public BufferProvider getBufferProvider()
+ {
+ return bufferProvider;
+ }
+
+ public void setBufferProvider(BufferProvider bufferProvider)
+ {
+ this.bufferProvider = bufferProvider;
+ }
+
+ public ExecutorService getReceiveExecutor()
+ {
+ return receiveExecutor;
+ }
+
+ public void setReceiveExecutor(ExecutorService receiveExecutor)
+ {
+ this.receiveExecutor = receiveExecutor;
+ }
+
+ public IRegistry<ProtocolFactoryID, ProtocolFactory> getProtocolFactoryRegistry()
+ {
+ return protocolFactoryRegistry;
+ }
+
+ public void setProtocolFactoryRegistry(IRegistry<ProtocolFactoryID, ProtocolFactory> protocolFactoryRegistry)
+ {
+ this.protocolFactoryRegistry = protocolFactoryRegistry;
+ }
+
+ public void addListener(IListener listener)
+ {
+ notifier.addListener(listener);
+ }
+
+ public void removeListener(IListener listener)
+ {
+ notifier.removeListener(listener);
+ }
+
+ public IListener[] getListeners()
+ {
+ return notifier.getListeners();
+ }
+
+ public Connector[] getAcceptedConnectors()
+ {
+ synchronized (acceptedConnectors)
+ {
+ return acceptedConnectors.toArray(new Connector[acceptedConnectors.size()]);
+ }
+ }
+
+ protected void addConnector(Connector connector)
+ {
+ try
+ {
+ LifecycleUtil.activate(connector);
+ LifecycleUtil.addListener(connector, connectorLifecycleListener);
+
+ synchronized (acceptedConnectors)
+ {
+ acceptedConnectors.add(connector);
+ }
+
+ if (TRACER.isEnabled())
+ {
+ TRACER.trace("Added connector " + connector); //$NON-NLS-1$
+ }
+
+ fireConnectorAccepted(connector);
+ }
+ catch (Exception ex)
+ {
+ Net4j.LOG.error(ex);
+ }
+ }
+
+ protected void removeConnector(Connector connector)
+ {
+ LifecycleUtil.removeListener(connector, connectorLifecycleListener);
+ synchronized (acceptedConnectors)
+ {
+ acceptedConnectors.remove(connector);
+ }
+
+ if (TRACER.isEnabled())
+ {
+ TRACER.trace("Removed connector " + connector); //$NON-NLS-1$
+ }
+ }
+
+ protected void fireConnectorAccepted(Connector connector)
+ {
+ notifier.fireEvent(new AcceptorConnectorsEventImpl(this, connector));
+ }
+
+ @Override
+ protected void onAboutToActivate() throws Exception
+ {
+ super.onAboutToActivate();
+ if (bufferProvider == null)
+ {
+ throw new IllegalStateException("bufferProvider == null"); //$NON-NLS-1$
+ }
+
+ if (protocolFactoryRegistry == null && TRACER.isEnabled())
+ {
+ TRACER.trace("protocolFactoryRegistry == null"); //$NON-NLS-1$
+ }
+
+ if (receiveExecutor == null && TRACER.isEnabled())
+ {
+ TRACER.trace("receiveExecutor == null"); //$NON-NLS-1$
+ }
+ }
+
+ @Override
+ protected void onDeactivate() throws Exception
+ {
+ for (Connector connector : getAcceptedConnectors())
+ {
+ LifecycleUtil.deactivate(connector);
+ }
+
+ super.onDeactivate();
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ private static class AcceptorConnectorsEventImpl extends EventImpl implements AcceptorConnectorsEvent
+ {
+ private static final long serialVersionUID = 1L;
+
+ private Connector acceptedConnector;
+
+ public AcceptorConnectorsEventImpl(INotifier notifier, Connector acceptedConnector)
+ {
+ super(notifier);
+ this.acceptedConnector = acceptedConnector;
+ }
+
+ public Connector getAcceptedConnector()
+ {
+ return acceptedConnector;
+ }
+ }
+}
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/AbstractConnector.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/AbstractConnector.java
index b2571c4..15bdbbb 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/AbstractConnector.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/AbstractConnector.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -14,13 +14,18 @@ import org.eclipse.net4j.transport.Buffer;
import org.eclipse.net4j.transport.BufferProvider;
import org.eclipse.net4j.transport.Channel;
import org.eclipse.net4j.transport.Connector;
+import org.eclipse.net4j.transport.ConnectorChannelsEvent;
import org.eclipse.net4j.transport.ConnectorCredentials;
-import org.eclipse.net4j.transport.ConnectorDescription;
import org.eclipse.net4j.transport.ConnectorException;
+import org.eclipse.net4j.transport.ConnectorLocation;
+import org.eclipse.net4j.transport.ConnectorState;
+import org.eclipse.net4j.transport.ConnectorStateEvent;
import org.eclipse.net4j.transport.Protocol;
import org.eclipse.net4j.transport.ProtocolFactory;
import org.eclipse.net4j.transport.ProtocolFactoryID;
import org.eclipse.net4j.transport.container.ContainerUtil;
+import org.eclipse.net4j.util.event.IListener;
+import org.eclipse.net4j.util.event.INotifier;
import org.eclipse.net4j.util.lifecycle.LifecycleImpl;
import org.eclipse.net4j.util.lifecycle.LifecycleListener;
import org.eclipse.net4j.util.lifecycle.LifecycleNotifier;
@@ -29,11 +34,12 @@ import org.eclipse.net4j.util.om.trace.ContextTracer;
import org.eclipse.net4j.util.registry.IRegistry;
import org.eclipse.internal.net4j.bundle.Net4j;
+import org.eclipse.internal.net4j.util.event.EventImpl;
+import org.eclipse.internal.net4j.util.event.NotifierImpl;
import java.util.ArrayList;
import java.util.List;
import java.util.Queue;
-import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit;
@@ -41,7 +47,7 @@ import java.util.concurrent.TimeUnit;
/**
* @author Eike Stepper
*/
-public abstract class AbstractConnector extends LifecycleImpl implements Connector, BufferProvider
+public abstract class AbstractConnector extends LifecycleImpl implements Connector, INotifier.Introspection
{
private static final ContextTracer TRACER = new ContextTracer(Net4j.DEBUG_CONNECTOR, AbstractConnector.class);
@@ -55,14 +61,12 @@ public abstract class AbstractConnector extends LifecycleImpl implements Connect
private int connectorID = getNextConnectorID();
- private ConnectorDescription description;
+ private String description;
private ConnectorCredentials credentials;
private IRegistry<ProtocolFactoryID, ProtocolFactory> protocolFactoryRegistry;
- private IRegistry<Integer, Connector> connectorRegistry;
-
private BufferProvider bufferProvider;
/**
@@ -78,17 +82,9 @@ public abstract class AbstractConnector extends LifecycleImpl implements Connect
*/
private List<ChannelImpl> channels = new ArrayList(0);
- private State state = State.DISCONNECTED;
+ private ConnectorState connectorState = ConnectorState.DISCONNECTED;
- /**
- * Don't initialize lazily to circumvent synchronization!
- */
- private Queue<StateListener> stateListeners = new ConcurrentLinkedQueue();
-
- /**
- * Don't initialize lazily to circumvent synchronization!
- */
- private Queue<ChannelListener> channelListeners = new ConcurrentLinkedQueue();
+ private NotifierImpl notifier = new NotifierImpl();
/**
* Is registered with each {@link Channel} of this {@link Connector}.
@@ -111,54 +107,39 @@ public abstract class AbstractConnector extends LifecycleImpl implements Connect
public abstract void multiplexBuffer(Channel channel);
- public ExecutorService getReceiveExecutor()
- {
- return receiveExecutor;
- }
-
- public void setReceiveExecutor(ExecutorService receiveExecutor)
- {
- this.receiveExecutor = receiveExecutor;
- }
-
- public IRegistry<ProtocolFactoryID, ProtocolFactory> getProtocolFactoryRegistry()
- {
- return protocolFactoryRegistry;
- }
-
- public void setProtocolFactoryRegistry(IRegistry<ProtocolFactoryID, ProtocolFactory> protocolFactoryRegistry)
+ public void addListener(IListener listener)
{
- this.protocolFactoryRegistry = protocolFactoryRegistry;
+ notifier.addListener(listener);
}
- public void addStateListener(StateListener listener)
+ public void removeListener(IListener listener)
{
- stateListeners.add(listener);
+ notifier.removeListener(listener);
}
- public void removeStateListener(StateListener listener)
+ public IListener[] getListeners()
{
- stateListeners.remove(listener);
+ return notifier.getListeners();
}
- public void addChannelListener(ChannelListener listener)
+ public ExecutorService getReceiveExecutor()
{
- channelListeners.add(listener);
+ return receiveExecutor;
}
- public void removeChannelListener(ChannelListener listener)
+ public void setReceiveExecutor(ExecutorService receiveExecutor)
{
- channelListeners.remove(listener);
+ this.receiveExecutor = receiveExecutor;
}
- public IRegistry<Integer, Connector> getConnectorRegistry()
+ public IRegistry<ProtocolFactoryID, ProtocolFactory> getProtocolFactoryRegistry()
{
- return connectorRegistry;
+ return protocolFactoryRegistry;
}
- public void setConnectorRegistry(IRegistry<Integer, Connector> connectorRegistry)
+ public void setProtocolFactoryRegistry(IRegistry<ProtocolFactoryID, ProtocolFactory> protocolFactoryRegistry)
{
- this.connectorRegistry = connectorRegistry;
+ this.protocolFactoryRegistry = protocolFactoryRegistry;
}
public BufferProvider getBufferProvider()
@@ -171,37 +152,22 @@ public abstract class AbstractConnector extends LifecycleImpl implements Connect
this.bufferProvider = bufferProvider;
}
- public short getBufferCapacity()
- {
- return bufferProvider.getBufferCapacity();
- }
-
- public Buffer provideBuffer()
- {
- return bufferProvider.provideBuffer();
- }
-
- public void retainBuffer(Buffer buffer)
- {
- bufferProvider.retainBuffer(buffer);
- }
-
public boolean isClient()
{
- return getType() == Type.CLIENT;
+ return getLocation() == ConnectorLocation.CLIENT;
}
public boolean isServer()
{
- return getType() == Type.SERVER;
+ return getLocation() == ConnectorLocation.SERVER;
}
- public ConnectorDescription getDescription()
+ public String getDescription()
{
return description;
}
- public void setDescription(ConnectorDescription description)
+ public void setDescription(String description)
{
this.description = description;
}
@@ -216,14 +182,14 @@ public abstract class AbstractConnector extends LifecycleImpl implements Connect
this.credentials = credentials;
}
- public State getState()
+ public ConnectorState getState()
{
- return state;
+ return connectorState;
}
- public void setState(State newState) throws ConnectorException
+ public void setState(ConnectorState newState) throws ConnectorException
{
- State oldState = getState();
+ ConnectorState oldState = getState();
if (newState != oldState)
{
if (TRACER.isEnabled())
@@ -232,17 +198,11 @@ public abstract class AbstractConnector extends LifecycleImpl implements Connect
+ ")"); //$NON-NLS-1$
}
- state = newState;
- fireStateChanged(newState, oldState);
+ connectorState = newState;
+ fireStateChanged(oldState, newState);
switch (newState)
{
case DISCONNECTED:
- if (connectorRegistry != null)
- {
- connectorRegistry.remove(connectorID);
- connectorRegistry.commit();
- }
-
if (finishedConnecting != null)
{
finishedConnecting.countDown();
@@ -259,24 +219,18 @@ public abstract class AbstractConnector extends LifecycleImpl implements Connect
case CONNECTING:
finishedConnecting = new CountDownLatch(1);
finishedNegotiating = new CountDownLatch(1);
- if (getType() == Type.SERVER)
+ if (isServer())
{
- setState(State.NEGOTIATING);
+ setState(ConnectorState.NEGOTIATING);
}
break;
case NEGOTIATING:
finishedConnecting.countDown();
- setState(State.CONNECTED); // TODO Implement negotiation
+ setState(ConnectorState.CONNECTED); // TODO Implement negotiation
break;
case CONNECTED:
- if (connectorRegistry != null)
- {
- connectorRegistry.put(connectorID, this);
- connectorRegistry.commit();
- }
-
finishedConnecting.countDown(); // Just in case of suspicion
finishedNegotiating.countDown();
break;
@@ -287,7 +241,7 @@ public abstract class AbstractConnector extends LifecycleImpl implements Connect
public boolean isConnected()
{
- return getState() == State.CONNECTED;
+ return getState() == ConnectorState.CONNECTED;
}
public void connectAsync() throws ConnectorException
@@ -308,8 +262,8 @@ public abstract class AbstractConnector extends LifecycleImpl implements Connect
public boolean waitForConnection(long timeout) throws ConnectorException
{
- State state = getState();
- if (state == State.DISCONNECTED)
+ ConnectorState connectorState = getState();
+ if (connectorState == ConnectorState.DISCONNECTED)
{
return false;
}
@@ -506,7 +460,7 @@ public abstract class AbstractConnector extends LifecycleImpl implements Connect
return null;
}
- ProtocolFactoryID protocolFactoryID = ContainerUtil.createProtocolFactoryID(getType(), protocolID);
+ ProtocolFactoryID protocolFactoryID = ContainerUtil.createProtocolFactoryID(getLocation(), protocolID);
ProtocolFactory factory = protocolFactoryRegistry.get(protocolFactoryID);
if (factory == null)
@@ -522,64 +476,24 @@ public abstract class AbstractConnector extends LifecycleImpl implements Connect
return factory.createProtocol(channel, protocolData);
}
- protected void fireChannelAboutToOpen(Channel channel)
+ protected void fireStateChanged(ConnectorState oldState, ConnectorState newState)
{
- for (ChannelListener listener : channelListeners)
- {
- try
- {
- listener.notifyChannelOpened(channel);
- }
- catch (Exception ex)
- {
- Net4j.LOG.error(ex);
- }
- }
+ notifier.fireEvent(new ConnectorStateEventImpl(this, oldState, newState));
}
- protected void fireChannelOpened(Channel channel)
+ protected void fireChannelAboutToOpen(Channel channel)
{
- for (ChannelListener listener : channelListeners)
- {
- try
- {
- listener.notifyChannelOpened(channel);
- }
- catch (Exception ex)
- {
- Net4j.LOG.error(ex);
- }
- }
+ notifier.fireEvent(new ConnectorChannelsEventImpl(this, channel, ConnectorChannelsEvent.Type.ABOUT_TO_OPEN));
}
- protected void fireChannelClosing(Channel channel)
+ protected void fireChannelOpened(Channel channel)
{
- for (ChannelListener listener : channelListeners)
- {
- try
- {
- listener.notifyChannelClosing(channel);
- }
- catch (Exception ex)
- {
- Net4j.LOG.error(ex);
- }
- }
+ notifier.fireEvent(new ConnectorChannelsEventImpl(this, channel, ConnectorChannelsEvent.Type.OPENED));
}
- protected void fireStateChanged(State newState, State oldState)
+ protected void fireChannelClosing(Channel channel)
{
- for (StateListener listener : stateListeners)
- {
- try
- {
- listener.notifyStateChanged(this, newState, oldState);
- }
- catch (Exception ex)
- {
- Net4j.LOG.error(ex);
- }
- }
+ notifier.fireEvent(new ConnectorChannelsEventImpl(this, channel, ConnectorChannelsEvent.Type.CLOSING));
}
@Override
@@ -608,13 +522,13 @@ public abstract class AbstractConnector extends LifecycleImpl implements Connect
protected void onActivate() throws Exception
{
super.onActivate();
- setState(State.CONNECTING);
+ setState(ConnectorState.CONNECTING);
}
@Override
protected void onDeactivate() throws Exception
{
- setState(State.DISCONNECTED);
+ setState(ConnectorState.DISCONNECTED);
for (short i = 0; i < channels.size(); i++)
{
ChannelImpl channel = channels.get(i);
@@ -700,4 +614,62 @@ public abstract class AbstractConnector extends LifecycleImpl implements Connect
removeChannel(channel);
}
}
+
+ /**
+ * @author Eike Stepper
+ */
+ private static class ConnectorStateEventImpl extends EventImpl implements ConnectorStateEvent
+ {
+ private static final long serialVersionUID = 1L;
+
+ private ConnectorState oldState;
+
+ private ConnectorState newState;
+
+ public ConnectorStateEventImpl(INotifier notifier, ConnectorState oldState, ConnectorState newState)
+ {
+ super(notifier);
+ this.oldState = oldState;
+ this.newState = newState;
+ }
+
+ public ConnectorState getOldState()
+ {
+ return oldState;
+ }
+
+ public ConnectorState getNewState()
+ {
+ return newState;
+ }
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ private static class ConnectorChannelsEventImpl extends EventImpl implements ConnectorChannelsEvent
+ {
+ private static final long serialVersionUID = 1L;
+
+ private Channel channel;
+
+ private ConnectorChannelsEvent.Type type;
+
+ public ConnectorChannelsEventImpl(INotifier notifier, Channel channel, Type type)
+ {
+ super(notifier);
+ this.channel = channel;
+ this.type = type;
+ }
+
+ public Channel getChannel()
+ {
+ return channel;
+ }
+
+ public ConnectorChannelsEvent.Type getType()
+ {
+ return type;
+ }
+ }
}
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/AbstractProtocol.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/AbstractProtocol.java
index 9bf308a..a984681 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/AbstractProtocol.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/AbstractProtocol.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/AbstractProtocolFactory.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/AbstractProtocolFactory.java
index 1a8a6df..25b92b5 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/AbstractProtocolFactory.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/AbstractProtocolFactory.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,9 @@
**************************************************************************/
package org.eclipse.internal.net4j.transport;
+import org.eclipse.net4j.transport.ConnectorLocation;
import org.eclipse.net4j.transport.ProtocolFactory;
import org.eclipse.net4j.transport.ProtocolFactoryID;
-import org.eclipse.net4j.transport.Connector.Type;
import org.eclipse.net4j.transport.container.ContainerUtil;
import java.text.MessageFormat;
@@ -28,12 +28,12 @@ public abstract class AbstractProtocolFactory implements ProtocolFactory
public final boolean isForClients()
{
- return getConnectorTypes().contains(Type.CLIENT);
+ return getLocations().contains(ConnectorLocation.CLIENT);
}
public final boolean isForServers()
{
- return getConnectorTypes().contains(Type.SERVER);
+ return getLocations().contains(ConnectorLocation.SERVER);
}
public final boolean isSymmetric()
@@ -41,14 +41,14 @@ public abstract class AbstractProtocolFactory implements ProtocolFactory
return isForClients() && isForServers();
}
- public ProtocolFactoryID createID(Type type)
+ public ProtocolFactoryID getID(ConnectorLocation location)
{
- return ContainerUtil.createProtocolFactoryID(type, getProtocolID());
+ return ContainerUtil.createProtocolFactoryID(location, getProtocolID());
}
@Override
public String toString()
{
- return MessageFormat.format("Protocol.Factory({0}, {1})", getProtocolID(), getConnectorTypes());
+ return MessageFormat.format("Protocol.Factory({0}, {1})", getProtocolID(), getLocations());
}
}
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/BufferFactoryImpl.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/BufferFactoryImpl.java
index b9d1246..a908592 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/BufferFactoryImpl.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/BufferFactoryImpl.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/BufferImpl.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/BufferImpl.java
index ba1e99e..e931d59 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/BufferImpl.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/BufferImpl.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/BufferPoolImpl.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/BufferPoolImpl.java
index cf4ecfd..03660b2 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/BufferPoolImpl.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/BufferPoolImpl.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/BufferProviderImpl.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/BufferProviderImpl.java
index cafaa08..ef89e5b 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/BufferProviderImpl.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/BufferProviderImpl.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/BufferUtil.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/BufferUtil.java
index 512a437..cacaf7b 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/BufferUtil.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/BufferUtil.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/ChannelImpl.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/ChannelImpl.java
index 5989a21..6f7afc1 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/ChannelImpl.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/ChannelImpl.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -17,16 +17,16 @@ import org.eclipse.net4j.transport.Channel;
import org.eclipse.net4j.transport.ChannelID;
import org.eclipse.net4j.transport.Connector;
import org.eclipse.net4j.util.ObjectUtil;
-import org.eclipse.net4j.util.Value;
-import org.eclipse.net4j.util.concurrent.AsynchronousWorkSerializer;
-import org.eclipse.net4j.util.concurrent.SynchronousWorkSerializer;
-import org.eclipse.net4j.util.concurrent.WorkSerializer;
+import org.eclipse.net4j.util.concurrent.IWorkSerializer;
import org.eclipse.net4j.util.lifecycle.LifecycleImpl;
import org.eclipse.net4j.util.om.trace.ContextTracer;
import org.eclipse.net4j.util.registry.IRegistry;
import org.eclipse.internal.net4j.bundle.Net4j;
import org.eclipse.internal.net4j.transport.BufferImpl.State;
+import org.eclipse.internal.net4j.util.Value;
+import org.eclipse.internal.net4j.util.concurrent.AsynchronousWorkSerializer;
+import org.eclipse.internal.net4j.util.concurrent.SynchronousWorkSerializer;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
@@ -51,7 +51,7 @@ public class ChannelImpl extends LifecycleImpl implements Channel, BufferProvide
private ExecutorService receiveExecutor;
- private WorkSerializer receiveSerializer;
+ private IWorkSerializer receiveSerializer;
private Queue<Buffer> sendQueue;
@@ -94,17 +94,17 @@ public class ChannelImpl extends LifecycleImpl implements Channel, BufferProvide
public short getBufferCapacity()
{
- return BufferUtil.getBufferProvider(connector).getBufferCapacity();
+ return connector.getBufferProvider().getBufferCapacity();
}
public Buffer provideBuffer()
{
- return BufferUtil.getBufferProvider(connector).provideBuffer();
+ return connector.getBufferProvider().provideBuffer();
}
public void retainBuffer(Buffer buffer)
{
- BufferUtil.getBufferProvider(connector).retainBuffer(buffer);
+ connector.getBufferProvider().retainBuffer(buffer);
}
public Queue<Buffer> getSendQueue()
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/ConnectorCredentialsImpl.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/ConnectorCredentialsImpl.java
index a9d87db..d693993 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/ConnectorCredentialsImpl.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/ConnectorCredentialsImpl.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/DescriptionUtil.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/DescriptionUtil.java
new file mode 100644
index 0000000..da94c5f
--- /dev/null
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/DescriptionUtil.java
@@ -0,0 +1,58 @@
+/***************************************************************************
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ **************************************************************************/
+package org.eclipse.internal.net4j.transport;
+
+/**
+ * @author Eike Stepper
+ */
+public final class DescriptionUtil
+{
+ public static final String SEPARATOR = ":"; //$NON-NLS-1$
+
+ public static final int TYPE_INDEX = 0;
+
+ private DescriptionUtil()
+ {
+ }
+
+ public static String getType(String description)
+ {
+ return getElement(description, TYPE_INDEX);
+ }
+
+ public static String getElement(String description, int index)
+ {
+ String[] elements = getElements(description);
+ return elements[index];
+ }
+
+ public static String[] getElements(String description)
+ {
+ return description.split(SEPARATOR);
+ }
+
+ public static String getDescription(String type, Object[] elements)
+ {
+ StringBuilder builder = new StringBuilder();
+ builder.append(type);
+
+ for (Object element : elements)
+ {
+ builder.append(":");
+ if (element != null)
+ {
+ builder.append(element);
+ }
+ }
+
+ return builder.toString();
+ }
+}
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/ProtocolFactoryIDImpl.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/ProtocolFactoryIDImpl.java
index b3f7f9d..833e256 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/ProtocolFactoryIDImpl.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/ProtocolFactoryIDImpl.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,10 +10,11 @@
**************************************************************************/
package org.eclipse.internal.net4j.transport;
-import org.eclipse.net4j.transport.Connector;
+import org.eclipse.net4j.transport.ConnectorLocation;
import org.eclipse.net4j.transport.ProtocolFactoryID;
import org.eclipse.net4j.util.ObjectUtil;
-import org.eclipse.net4j.util.Value;
+
+import org.eclipse.internal.net4j.util.Value;
import java.text.MessageFormat;
@@ -24,19 +25,19 @@ public class ProtocolFactoryIDImpl extends Value implements ProtocolFactoryID
{
private static final long serialVersionUID = 1L;
- private Connector.Type type;
+ private ConnectorLocation location;
private String protocolID;
- public ProtocolFactoryIDImpl(Connector.Type type, String protocolID)
+ public ProtocolFactoryIDImpl(ConnectorLocation location, String protocolID)
{
- this.type = type;
+ this.location = location;
this.protocolID = protocolID;
}
- public Connector.Type getType()
+ public ConnectorLocation getLocation()
{
- return type;
+ return location;
}
public String getProtocolID()
@@ -56,7 +57,7 @@ public class ProtocolFactoryIDImpl extends Value implements ProtocolFactoryID
if (obj instanceof ProtocolFactoryID)
{
ProtocolFactoryID that = (ProtocolFactoryID)obj;
- return this.type == that.getType() && ObjectUtil.equals(this.protocolID, that.getProtocolID());
+ return this.location == that.getLocation() && ObjectUtil.equals(this.protocolID, that.getProtocolID());
}
return false;
@@ -65,12 +66,12 @@ public class ProtocolFactoryIDImpl extends Value implements ProtocolFactoryID
@Override
public int hashCode()
{
- return type.hashCode() ^ protocolID.hashCode();
+ return location.hashCode() ^ protocolID.hashCode();
}
@Override
public String toString()
{
- return MessageFormat.format("{0}[{1}]", type, protocolID);
+ return MessageFormat.format("{0}[{1}]", location, protocolID);
}
}
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/container/AbstractContainer.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/container/AbstractContainer.java
index ff877cf..2ff8bf3 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/container/AbstractContainer.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/container/AbstractContainer.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,32 +10,216 @@
**************************************************************************/
package org.eclipse.internal.net4j.transport.container;
+import static org.eclipse.net4j.util.registry.IRegistryDelta.Kind.DEREGISTERED;
+import static org.eclipse.net4j.util.registry.IRegistryDelta.Kind.REGISTERED;
+
+import org.eclipse.net4j.transport.Acceptor;
+import org.eclipse.net4j.transport.AcceptorFactory;
+import org.eclipse.net4j.transport.Connector;
+import org.eclipse.net4j.transport.ConnectorFactory;
+import org.eclipse.net4j.transport.ConnectorLocation;
+import org.eclipse.net4j.transport.ProtocolFactory;
+import org.eclipse.net4j.transport.ProtocolFactoryID;
import org.eclipse.net4j.transport.container.Container;
import org.eclipse.net4j.transport.container.ContainerAdapter;
import org.eclipse.net4j.transport.container.ContainerAdapterFactory;
-import org.eclipse.net4j.transport.container.ContainerAdapterID;
import org.eclipse.net4j.util.lifecycle.LifecycleImpl;
+import org.eclipse.net4j.util.lifecycle.LifecycleListener;
+import org.eclipse.net4j.util.lifecycle.LifecycleNotifier;
import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
-import org.eclipse.net4j.util.registry.HashMapRegistry;
import org.eclipse.net4j.util.registry.IRegistry;
+import org.eclipse.net4j.util.registry.IRegistryDelta;
+import org.eclipse.net4j.util.registry.IRegistryEvent;
+import org.eclipse.net4j.util.registry.IRegistryListener;
+
+import org.eclipse.internal.net4j.bundle.Net4j;
+import org.eclipse.internal.net4j.transport.AbstractAcceptor;
+import org.eclipse.internal.net4j.transport.AbstractConnector;
+import org.eclipse.internal.net4j.transport.DescriptionUtil;
+import org.eclipse.internal.net4j.util.registry.HashMapRegistry;
/**
* @author Eike Stepper
*/
public abstract class AbstractContainer extends LifecycleImpl implements Container
{
- private IRegistry<ContainerAdapterID, ContainerAdapterFactory> adapterFactoryRegistry;
+ private IRegistry<String, ContainerAdapterFactory> adapterFactoryRegistry;
+
+ private IRegistry<String, ContainerAdapter> adapters = new HashMapRegistry();
+
+ private LifecycleListener acceptorLifecycleListener = new LifecycleListener()
+ {
+ public void notifyLifecycleAboutToActivate(LifecycleNotifier notifier)
+ {
+ // Do nothing
+ }
+
+ public void notifyLifecycleActivated(LifecycleNotifier notifier)
+ {
+ // Do nothing
+ }
- private IRegistry<ContainerAdapterID, ContainerAdapter> adapters = new HashMapRegistry();
+ public void notifyLifecycleDeactivating(LifecycleNotifier notifier)
+ {
+ deregisterAcceptor((Acceptor)notifier);
+ }
+ };
- protected AbstractContainer(IRegistry<ContainerAdapterID, ContainerAdapterFactory> adapterFactoryRegistry)
+ private LifecycleListener connectorLifecycleListener = new LifecycleListener()
+ {
+ public void notifyLifecycleAboutToActivate(LifecycleNotifier notifier)
+ {
+ // Do nothing
+ }
+
+ public void notifyLifecycleActivated(LifecycleNotifier notifier)
+ {
+ // Do nothing
+ }
+
+ public void notifyLifecycleDeactivating(LifecycleNotifier notifier)
+ {
+ deregisterConnector((Connector)notifier);
+ }
+ };
+
+ private IRegistryListener adapterFactoryRegistryListener = new IRegistryListener<String, ContainerAdapterFactory>()
+ {
+ public void notifyRegistryEvent(IRegistryEvent<String, ContainerAdapterFactory> event)
+ {
+ IRegistryDelta<String, ContainerAdapterFactory>[] deltas = event.getDeltas();
+ for (IRegistryDelta<String, ContainerAdapterFactory> delta : deltas)
+ {
+ try
+ {
+ ContainerAdapterFactory factory = delta.getValue();
+ switch (delta.getKind())
+ {
+ case REGISTERED:
+ addAdapter(factory.getType());
+ break;
+
+ case DEREGISTERED:
+ // TODO Implement method .notifyRegistryEvent()
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+ }
+ catch (Exception ex)
+ {
+ Net4j.LOG.error(ex);
+ }
+ }
+ }
+ };
+
+ protected AbstractContainer(IRegistry<String, ContainerAdapterFactory> adapterFactoryRegistry)
{
this.adapterFactoryRegistry = adapterFactoryRegistry;
}
- protected AbstractContainer()
+ public IRegistry<String, ContainerAdapterFactory> getAdapterFactoryRegistry()
+ {
+ return adapterFactoryRegistry;
+ }
+
+ public IRegistry<String, ContainerAdapter> getAdapters()
+ {
+ return adapters;
+ }
+
+ public ContainerAdapter getAdapter(String type)
+ {
+ return adapters.get(type);
+ }
+
+ public Acceptor getAcceptor(String description)
+ {
+ IRegistry<String, Acceptor> registry = getAcceptorRegistry();
+ Acceptor acceptor = registry.get(description);
+ if (acceptor == null)
+ {
+ acceptor = createAcceptor(description);
+ if (acceptor != null)
+ {
+ LifecycleUtil.addListener(acceptor, acceptorLifecycleListener);
+ registry.put(description, acceptor);
+ }
+ }
+
+ return acceptor;
+ }
+
+ public Connector getConnector(String description)
+ {
+ IRegistry<String, Connector> registry = getConnectorRegistry();
+ Connector connector = registry.get(description);
+ if (connector == null)
+ {
+ connector = createConnector(description);
+ if (connector != null)
+ {
+ LifecycleUtil.addListener(connector, connectorLifecycleListener);
+ registry.put(description, connector);
+ }
+ }
+
+ return connector;
+ }
+
+ public void register(ContainerAdapterFactory factory)
+ {
+ IRegistry<String, ContainerAdapterFactory> registry = getAdapterFactoryRegistry();
+ registry.put(factory.getType(), factory);
+ }
+
+ public void deregister(ContainerAdapterFactory factory)
+ {
+ IRegistry<String, ContainerAdapterFactory> registry = getAdapterFactoryRegistry();
+ registry.remove(factory.getType());
+ }
+
+ public void register(AcceptorFactory factory)
+ {
+ IRegistry<String, AcceptorFactory> registry = getAcceptorFactoryRegistry();
+ registry.put(factory.getType(), factory);
+ }
+
+ public void deregister(AcceptorFactory factory)
+ {
+ IRegistry<String, AcceptorFactory> registry = getAcceptorFactoryRegistry();
+ registry.remove(factory.getType());
+ }
+
+ public void register(ConnectorFactory factory)
+ {
+ IRegistry<String, ConnectorFactory> registry = getConnectorFactoryRegistry();
+ registry.put(factory.getType(), factory);
+ }
+
+ public void deregister(ConnectorFactory factory)
+ {
+ IRegistry<String, ConnectorFactory> registry = getConnectorFactoryRegistry();
+ registry.remove(factory.getType());
+ }
+
+ public void register(ProtocolFactory factory)
+ {
+ IRegistry<ProtocolFactoryID, ProtocolFactory> registry = getProtocolFactoryRegistry();
+ for (ConnectorLocation location : factory.getLocations())
+ {
+ ProtocolFactoryID id = factory.getID(location);
+ registry.put(id, factory);
+ }
+ }
+
+ public void deregister(ProtocolFactory factory)
{
- this(ContainerAdapterFactory.REGISTRY);
+ IRegistry<ProtocolFactoryID, ProtocolFactory> registry = getProtocolFactoryRegistry();
+ for (ConnectorLocation location : factory.getLocations())
+ {
+ ProtocolFactoryID id = factory.getID(location);
+ registry.remove(id);
+ }
}
@Override
@@ -49,40 +233,142 @@ public abstract class AbstractContainer extends LifecycleImpl implements Contain
}
@Override
+ protected void onActivate() throws Exception
+ {
+ super.onActivate();
+ IRegistry<String, ContainerAdapterFactory> registry = getAdapterFactoryRegistry();
+ for (ContainerAdapterFactory factory : registry.values())
+ {
+ addAdapter(factory.getType());
+ }
+
+ registry.addRegistryListener(adapterFactoryRegistryListener);
+ }
+
+ @Override
protected void onDeactivate() throws Exception
{
+ getAdapterFactoryRegistry().removeRegistryListener(adapterFactoryRegistryListener);
for (ContainerAdapter adapter : adapters.values())
{
- LifecycleUtil.deactivate(adapter);
+ LifecycleUtil.deactivateNoisy(adapter);
+ }
+
+ for (Connector connector : getConnectorRegistry().values())
+ {
+ LifecycleUtil.deactivateNoisy(connector);
+ }
+
+ for (Acceptor acceptor : getAcceptorRegistry().values())
+ {
+ LifecycleUtil.deactivateNoisy(acceptor);
}
super.onDeactivate();
}
- public IRegistry<ContainerAdapterID, ContainerAdapterFactory> getAdapterFactoryRegistry()
+ private void deregisterAcceptor(Acceptor acceptor)
{
- return adapterFactoryRegistry;
+ getAcceptorRegistry().remove(acceptor.getDescription());
+ LifecycleUtil.removeListener(acceptor, acceptorLifecycleListener);
}
- public IRegistry<ContainerAdapterID, ContainerAdapter> getAdapters()
+ private void deregisterConnector(Connector connector)
{
- return adapters;
+ getConnectorRegistry().remove(connector.getDescription());
+ LifecycleUtil.removeListener(connector, connectorLifecycleListener);
}
- public ContainerAdapter getAdapter(ContainerAdapterID adapterID)
+ private Acceptor createAcceptor(String description)
{
- ContainerAdapter adapter = adapters.get(adapterID);
- if (adapter == null)
+ IRegistry<String, AcceptorFactory> registry = getAcceptorFactoryRegistry();
+ if (registry == null)
{
- ContainerAdapterFactory factory = adapterFactoryRegistry.get(adapterID);
- if (factory != null)
- {
- adapter = createAdapter(factory);
- if (adapter != null)
- {
- adapters.put(adapterID, adapter);
- }
- }
+ return null;
+ }
+
+ String type = DescriptionUtil.getType(description);
+ AcceptorFactory factory = registry.get(type);
+ if (factory == null)
+ {
+ return null;
+ }
+
+ AbstractAcceptor acceptor = (AbstractAcceptor)factory.createAcceptor();
+ acceptor.setReceiveExecutor(getExecutorService());
+ acceptor.setBufferProvider(getBufferProvider());
+ acceptor.setDescription(description);
+ acceptor.setProtocolFactoryRegistry(getProtocolFactoryRegistry());
+
+ for (ContainerAdapter adapter : adapters.values())
+ {
+ adapter.initAcceptor(acceptor);
+ }
+
+ try
+ {
+ LifecycleUtil.activate(acceptor);
+ }
+ catch (Exception ex)
+ {
+ Net4j.LOG.error(ex);
+ acceptor = null;
+ }
+
+ return acceptor;
+ }
+
+ private Connector createConnector(String description)
+ {
+ IRegistry<String, ConnectorFactory> registry = getConnectorFactoryRegistry();
+ if (registry == null)
+ {
+ return null;
+ }
+
+ String type = DescriptionUtil.getType(description);
+ ConnectorFactory factory = registry.get(type);
+ if (factory == null)
+ {
+ return null;
+ }
+
+ AbstractConnector connector = (AbstractConnector)factory.createConnector();
+ connector.setReceiveExecutor(getExecutorService());
+ connector.setBufferProvider(getBufferProvider());
+ connector.setDescription(description);
+ connector.setProtocolFactoryRegistry(getProtocolFactoryRegistry());
+
+ for (ContainerAdapter adapter : adapters.values())
+ {
+ adapter.initConnector(connector);
+ }
+
+ try
+ {
+ LifecycleUtil.activate(connector);
+ }
+ catch (Exception ex)
+ {
+ Net4j.LOG.error(ex);
+ connector = null;
+ }
+
+ return connector;
+ }
+
+ private ContainerAdapter addAdapter(String type)
+ {
+ ContainerAdapterFactory factory = adapterFactoryRegistry.get(type);
+ if (factory == null)
+ {
+ return null;
+ }
+
+ ContainerAdapter adapter = createAdapter(factory);
+ if (adapter != null)
+ {
+ adapters.put(type, adapter);
}
return adapter;
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/container/ContainerAdapterImpl.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/container/AbstractContainerAdapter.java
index e2e970b..65e42a9 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/container/ContainerAdapterImpl.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/container/AbstractContainerAdapter.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,21 +12,21 @@ package org.eclipse.internal.net4j.transport.container;
import org.eclipse.net4j.transport.container.Container;
import org.eclipse.net4j.transport.container.ContainerAdapter;
-import org.eclipse.net4j.transport.container.ContainerAdapterID;
+import org.eclipse.net4j.util.lifecycle.LifecycleImpl;
/**
* @author Eike Stepper
*/
-public class ContainerAdapterImpl implements ContainerAdapter
+public abstract class AbstractContainerAdapter extends LifecycleImpl implements ContainerAdapter
{
private Container container;
- private ContainerAdapterID id;
+ private String type;
- public ContainerAdapterImpl(Container container, ContainerAdapterID id)
+ public AbstractContainerAdapter(Container container, String type)
{
this.container = container;
- this.id = id;
+ this.type = type;
}
public Container getContainer()
@@ -34,8 +34,8 @@ public class ContainerAdapterImpl implements ContainerAdapter
return container;
}
- public ContainerAdapterID getID()
+ public String getType()
{
- return id;
+ return type;
}
}
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/container/ContainerAdapterIDImpl.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/container/ContainerAdapterIDImpl.java
deleted file mode 100644
index b57dd7c..0000000
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/container/ContainerAdapterIDImpl.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.internal.net4j.transport.container;
-
-import org.eclipse.net4j.transport.container.ContainerAdapterID;
-import org.eclipse.net4j.util.ObjectUtil;
-import org.eclipse.net4j.util.Value;
-
-import java.text.MessageFormat;
-
-/**
- * @author Eike Stepper
- */
-public final class ContainerAdapterIDImpl extends Value implements ContainerAdapterID
-{
- private static final long serialVersionUID = 1L;
-
- private Type type;
-
- private String name;
-
- public ContainerAdapterIDImpl(Type type, String name)
- {
- this.type = type;
- this.name = name;
- }
-
- public Type getType()
- {
- return type;
- }
-
- public String getName()
- {
- return name;
- }
-
- @Override
- protected Object clone() throws CloneNotSupportedException
- {
- return new ContainerAdapterIDImpl(type, name);
- }
-
- @Override
- public boolean equals(Object obj)
- {
- if (obj instanceof ContainerAdapterID)
- {
- ContainerAdapterID that = (ContainerAdapterID)obj;
- return this.type.equals(that.getType()) && ObjectUtil.equals(this.name, that.getName());
- }
-
- return false;
- }
-
- @Override
- public int hashCode()
- {
- return type.hashCode() ^ name.hashCode();
- }
-
- @Override
- public String toString()
- {
- return MessageFormat.format("{0}:{1}", type, name);
- }
-}
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/container/ContainerImpl.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/container/ContainerImpl.java
index 1d57879..53c132e 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/container/ContainerImpl.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/container/ContainerImpl.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,16 +10,16 @@
**************************************************************************/
package org.eclipse.internal.net4j.transport.container;
+import org.eclipse.net4j.transport.Acceptor;
+import org.eclipse.net4j.transport.AcceptorFactory;
import org.eclipse.net4j.transport.BufferProvider;
import org.eclipse.net4j.transport.Channel;
import org.eclipse.net4j.transport.ChannelID;
import org.eclipse.net4j.transport.Connector;
import org.eclipse.net4j.transport.ConnectorFactory;
-import org.eclipse.net4j.transport.Protocol;
import org.eclipse.net4j.transport.ProtocolFactory;
import org.eclipse.net4j.transport.ProtocolFactoryID;
import org.eclipse.net4j.transport.container.ContainerAdapterFactory;
-import org.eclipse.net4j.transport.container.ContainerAdapterID;
import org.eclipse.net4j.util.registry.IRegistry;
import java.util.concurrent.ExecutorService;
@@ -33,19 +33,19 @@ public class ContainerImpl extends AbstractContainer
private BufferProvider bufferProvider;
+ private IRegistry<String, AcceptorFactory> acceptorFactoryRegistry;
+
private IRegistry<String, ConnectorFactory> connectorFactoryRegistry;
private IRegistry<ProtocolFactoryID, ProtocolFactory> protocolFactoryRegistry;
- private IRegistry<Integer, Connector> connectorRegistry;
+ private IRegistry<String, Acceptor> acceptorRegistry;
- private IRegistry<ChannelID, Channel> channelRegistry;
+ private IRegistry<String, Connector> connectorRegistry;
- public ContainerImpl()
- {
- }
+ private IRegistry<ChannelID, Channel> channelRegistry;
- public ContainerImpl(IRegistry<ContainerAdapterID, ContainerAdapterFactory> adapterFactoryRegistry)
+ public ContainerImpl(IRegistry<String, ContainerAdapterFactory> adapterFactoryRegistry)
{
super(adapterFactoryRegistry);
}
@@ -70,6 +70,16 @@ public class ContainerImpl extends AbstractContainer
this.bufferProvider = bufferProvider;
}
+ public IRegistry<String, AcceptorFactory> getAcceptorFactoryRegistry()
+ {
+ return acceptorFactoryRegistry;
+ }
+
+ public void setAcceptorFactoryRegistry(IRegistry<String, AcceptorFactory> acceptorFactoryRegistry)
+ {
+ this.acceptorFactoryRegistry = acceptorFactoryRegistry;
+ }
+
public IRegistry<String, ConnectorFactory> getConnectorFactoryRegistry()
{
return connectorFactoryRegistry;
@@ -90,46 +100,33 @@ public class ContainerImpl extends AbstractContainer
this.protocolFactoryRegistry = protocolFactoryRegistry;
}
- public IRegistry<Integer, Connector> getConnectorRegistry()
+ public IRegistry<String, Acceptor> getAcceptorRegistry()
{
- return connectorRegistry;
+ return acceptorRegistry;
}
- public void setConnectorRegistry(IRegistry<Integer, Connector> connectorRegistry)
+ public void setAcceptorRegistry(IRegistry<String, Acceptor> acceptorRegistry)
{
- this.connectorRegistry = connectorRegistry;
+ this.acceptorRegistry = acceptorRegistry;
}
- public IRegistry<ChannelID, Channel> getChannelRegistry()
+ public IRegistry<String, Connector> getConnectorRegistry()
{
- return channelRegistry;
+ return connectorRegistry;
}
- public void setChannelRegistry(IRegistry<ChannelID, Channel> channelRegistry)
+ public void setConnectorRegistry(IRegistry<String, Connector> connectorRegistry)
{
- this.channelRegistry = channelRegistry;
+ this.connectorRegistry = connectorRegistry;
}
- public Connector createConnector(String connectorFactoryID)
+ public IRegistry<ChannelID, Channel> getChannelRegistry()
{
- IRegistry<String, ConnectorFactory> registry = getConnectorFactoryRegistry();
- if (registry == null)
- {
- return null;
- }
-
- ConnectorFactory connectorFactory = registry.get(connectorFactoryID);
- if (connectorFactory == null)
- {
- return null;
- }
-
- return connectorFactory.createConnector(this);
+ return channelRegistry;
}
- public Protocol createProtocol(String protocolID)
+ public void setChannelRegistry(IRegistry<ChannelID, Channel> channelRegistry)
{
- // TODO Implement method ContainerUtil.createProtocol()
- throw new UnsupportedOperationException("Not yet implemented");
+ this.channelRegistry = channelRegistry;
}
}
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/container/DefaultContainer.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/container/DefaultContainer.java
new file mode 100644
index 0000000..f490c1c
--- /dev/null
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/container/DefaultContainer.java
@@ -0,0 +1,111 @@
+/***************************************************************************
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ **************************************************************************/
+package org.eclipse.internal.net4j.transport.container;
+
+import org.eclipse.net4j.transport.BufferProvider;
+import org.eclipse.net4j.transport.container.ContainerAdapterFactory;
+import org.eclipse.net4j.transport.container.ContainerUtil;
+import org.eclipse.net4j.util.registry.IRegistry;
+
+import org.eclipse.internal.net4j.util.registry.HashMapRegistry;
+
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ThreadFactory;
+
+/**
+ * @author Eike Stepper
+ */
+public class DefaultContainer extends ContainerImpl
+{
+ public static final short DEFAULT_BUFFER_CAPACITY = 4096;
+
+ public static final ThreadFactory THREAD_FACTORY = new ThreadFactory()
+ {
+ public Thread newThread(Runnable r)
+ {
+ return new Thread(r);
+ }
+ };
+
+ public DefaultContainer()
+ {
+ this(createAdapterFactoryRegistry(), DEFAULT_BUFFER_CAPACITY);
+ }
+
+ public DefaultContainer(short bufferCapacity)
+ {
+ this(createAdapterFactoryRegistry(), bufferCapacity);
+ }
+
+ public DefaultContainer(IRegistry<String, ContainerAdapterFactory> adapterFactoryRegistry)
+ {
+ this(adapterFactoryRegistry, DEFAULT_BUFFER_CAPACITY);
+ }
+
+ public DefaultContainer(IRegistry<String, ContainerAdapterFactory> adapterFactoryRegistry, short bufferCapacity)
+ {
+ super(adapterFactoryRegistry);
+ setExecutorService(createExecutorService());
+ setBufferProvider(createBufferProvider(bufferCapacity));
+ setAcceptorFactoryRegistry(createAcceptorFactoryRegistry());
+ setConnectorFactoryRegistry(createConnectorFactoryRegistry());
+ setProtocolFactoryRegistry(createProtocolFactoryRegistry());
+ setAcceptorRegistry(createAcceptorRegistry());
+ setConnectorRegistry(createConnectorRegistry());
+ setChannelRegistry(createChannelRegistry());
+ }
+
+ protected static IRegistry<String, ContainerAdapterFactory> createAdapterFactoryRegistry()
+ {
+ return new HashMapRegistry();
+ }
+
+ protected HashMapRegistry createAcceptorFactoryRegistry()
+ {
+ return new HashMapRegistry();
+ }
+
+ protected HashMapRegistry createConnectorFactoryRegistry()
+ {
+ return new HashMapRegistry();
+ }
+
+ protected HashMapRegistry createProtocolFactoryRegistry()
+ {
+ return new HashMapRegistry();
+ }
+
+ protected HashMapRegistry createAcceptorRegistry()
+ {
+ return new HashMapRegistry();
+ }
+
+ protected HashMapRegistry createConnectorRegistry()
+ {
+ return new HashMapRegistry();
+ }
+
+ protected HashMapRegistry createChannelRegistry()
+ {
+ return new HashMapRegistry();
+ }
+
+ protected ExecutorService createExecutorService()
+ {
+ return Executors.newCachedThreadPool(THREAD_FACTORY);
+ }
+
+ protected BufferProvider createBufferProvider(short bufferCapacity)
+ {
+ return ContainerUtil.createBufferPool(bufferCapacity);
+ }
+}
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/container/TransportContainerAdapter.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/container/TransportContainerAdapter.java
new file mode 100644
index 0000000..7f05e56
--- /dev/null
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/container/TransportContainerAdapter.java
@@ -0,0 +1,49 @@
+/***************************************************************************
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ **************************************************************************/
+package org.eclipse.internal.net4j.transport.container;
+
+import org.eclipse.net4j.transport.AcceptorFactory;
+import org.eclipse.net4j.transport.ConnectorFactory;
+import org.eclipse.net4j.transport.container.Container;
+
+public abstract class TransportContainerAdapter extends AbstractContainerAdapter
+{
+ private AcceptorFactory acceptorFactory;
+
+ private ConnectorFactory connectorFactory;
+
+ protected TransportContainerAdapter(Container container, String type)
+ {
+ super(container, type);
+ acceptorFactory = createAcceptorFactory();
+ connectorFactory = createConnectorFactory();
+ }
+
+ @Override
+ protected void onActivate() throws Exception
+ {
+ super.onActivate();
+ getContainer().register(acceptorFactory);
+ getContainer().register(connectorFactory);
+ }
+
+ @Override
+ protected void onDeactivate() throws Exception
+ {
+ getContainer().deregister(connectorFactory);
+ getContainer().deregister(acceptorFactory);
+ super.onDeactivate();
+ }
+
+ protected abstract AcceptorFactory createAcceptorFactory();
+
+ protected abstract ConnectorFactory createConnectorFactory();
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/embedded/AbstractEmbeddedConnector.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/embedded/AbstractEmbeddedConnector.java
index e5dc705..583a59f 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/embedded/AbstractEmbeddedConnector.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/embedded/AbstractEmbeddedConnector.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/embedded/ClientEmbeddedConnectorImpl.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/embedded/ClientEmbeddedConnectorImpl.java
index 30eb4fd..314b13d 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/embedded/ClientEmbeddedConnectorImpl.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/embedded/ClientEmbeddedConnectorImpl.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,6 +10,7 @@
**************************************************************************/
package org.eclipse.internal.net4j.transport.embedded;
+import org.eclipse.net4j.transport.ConnectorLocation;
import org.eclipse.net4j.util.lifecycle.LifecycleListener;
import org.eclipse.net4j.util.lifecycle.LifecycleNotifier;
import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
@@ -23,9 +24,9 @@ public class ClientEmbeddedConnectorImpl extends AbstractEmbeddedConnector imple
{
}
- public Type getType()
+ public ConnectorLocation getLocation()
{
- return Type.CLIENT;
+ return ConnectorLocation.CLIENT;
}
public void notifyLifecycleAboutToActivate(LifecycleNotifier notifier)
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/embedded/ServerEmbeddedConnectorImpl.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/embedded/ServerEmbeddedConnectorImpl.java
index 3638783..0161c90 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/embedded/ServerEmbeddedConnectorImpl.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/embedded/ServerEmbeddedConnectorImpl.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,6 +10,7 @@
**************************************************************************/
package org.eclipse.internal.net4j.transport.embedded;
+import org.eclipse.net4j.transport.ConnectorLocation;
import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
/**
@@ -22,9 +23,9 @@ public class ServerEmbeddedConnectorImpl extends AbstractEmbeddedConnector
setPeer(clientPeer);
}
- public Type getType()
+ public ConnectorLocation getLocation()
{
- return Type.SERVER;
+ return ConnectorLocation.SERVER;
}
@Override
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/AbstractCachingMap.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/AbstractCachingMap.java
index c384bb6..df0d490 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/AbstractCachingMap.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/AbstractCachingMap.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/AbstractDelegatingMap.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/AbstractDelegatingMap.java
index 3b17776..55e3686 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/AbstractDelegatingMap.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/AbstractDelegatingMap.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/HashBag.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/HashBag.java
index 709fc3c..43e0ffe 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/HashBag.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/HashBag.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
* Contributors:
* Eike Stepper - initial API and implementation
**************************************************************************/
-package org.eclipse.net4j.util;
+package org.eclipse.internal.net4j.util;
import java.util.Collection;
import java.util.HashMap;
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/Value.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/Value.java
index 44965d8..6b4450b 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/Value.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/Value.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
* Contributors:
* Eike Stepper - initial API and implementation
**************************************************************************/
-package org.eclipse.net4j.util;
+package org.eclipse.internal.net4j.util;
import java.io.Serializable;
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/concurrent/AsynchronousWorkSerializer.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/concurrent/AsynchronousWorkSerializer.java
index 3cd395f..dab84fd 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/concurrent/AsynchronousWorkSerializer.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/concurrent/AsynchronousWorkSerializer.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,8 +8,9 @@
* Contributors:
* Eike Stepper - initial API and implementation
**************************************************************************/
-package org.eclipse.net4j.util.concurrent;
+package org.eclipse.internal.net4j.util.concurrent;
+import org.eclipse.net4j.util.concurrent.IWorkSerializer;
import org.eclipse.net4j.util.om.trace.ContextTracer;
import org.eclipse.internal.net4j.bundle.Net4j;
@@ -21,7 +22,7 @@ import java.util.concurrent.ExecutorService;
/**
* @author Eike Stepper
*/
-public class AsynchronousWorkSerializer implements WorkSerializer, Runnable
+public class AsynchronousWorkSerializer implements IWorkSerializer, Runnable
{
private static final ContextTracer TRACER = new ContextTracer(Net4j.DEBUG_CONCURRENCY,
AsynchronousWorkSerializer.class);
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/concurrent/ResultSynchronizer.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/concurrent/ResultSynchronizer.java
index a9cf6a9..26477c2 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/concurrent/ResultSynchronizer.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/concurrent/ResultSynchronizer.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,7 +8,9 @@
* Contributors:
* Eike Stepper - initial API and implementation
**************************************************************************/
-package org.eclipse.net4j.util.concurrent;
+package org.eclipse.internal.net4j.util.concurrent;
+
+import org.eclipse.net4j.util.concurrent.ISynchronizer;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
@@ -16,7 +18,7 @@ import java.util.concurrent.TimeUnit;
/**
* @author Eike Stepper
*/
-public final class ResultSynchronizer<RESULT> implements Synchronizer<RESULT>
+public final class ResultSynchronizer<RESULT> implements ISynchronizer<RESULT>
{
private RESULT result;
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/concurrent/SynchronizingCorrelator.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/concurrent/SynchronizingCorrelator.java
index 41fc94b..760df73 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/concurrent/SynchronizingCorrelator.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/concurrent/SynchronizingCorrelator.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,7 +8,10 @@
* Contributors:
* Eike Stepper - initial API and implementation
**************************************************************************/
-package org.eclipse.net4j.util.concurrent;
+package org.eclipse.internal.net4j.util.concurrent;
+
+import org.eclipse.net4j.util.concurrent.ICorrelator;
+import org.eclipse.net4j.util.concurrent.ISynchronizer;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
@@ -16,18 +19,18 @@ import java.util.concurrent.ConcurrentMap;
/**
* @author Eike Stepper
*/
-public class SynchronizingCorrelator<CORRELATION, RESULT> implements Correlator<CORRELATION, Synchronizer<RESULT>>
+public class SynchronizingCorrelator<CORRELATION, RESULT> implements ICorrelator<CORRELATION, ISynchronizer<RESULT>>
{
- private ConcurrentMap<CORRELATION, Synchronizer<RESULT>> map = new ConcurrentHashMap(0);
+ private ConcurrentMap<CORRELATION, ISynchronizer<RESULT>> map = new ConcurrentHashMap(0);
public boolean isCorrelated(CORRELATION correlation)
{
return map.containsKey(correlation);
}
- public Synchronizer<RESULT> correlate(CORRELATION correlation)
+ public ISynchronizer<RESULT> correlate(CORRELATION correlation)
{
- Synchronizer<RESULT> synchronizer = map.get(correlation);
+ ISynchronizer<RESULT> synchronizer = map.get(correlation);
if (synchronizer == null)
{
synchronizer = createSynchronizer(correlation);
@@ -37,9 +40,9 @@ public class SynchronizingCorrelator<CORRELATION, RESULT> implements Correlator<
return synchronizer;
}
- public Synchronizer<RESULT> correlateUnique(CORRELATION correlation)
+ public ISynchronizer<RESULT> correlateUnique(CORRELATION correlation)
{
- Synchronizer<RESULT> synchronizer = createSynchronizer(correlation);
+ ISynchronizer<RESULT> synchronizer = createSynchronizer(correlation);
if (map.putIfAbsent(correlation, synchronizer) != null)
{
throw new IllegalStateException("Already correlated: " + correlation); //$NON-NLS-1$
@@ -48,7 +51,7 @@ public class SynchronizingCorrelator<CORRELATION, RESULT> implements Correlator<
return synchronizer;
}
- public Synchronizer<RESULT> uncorrelate(CORRELATION correlation)
+ public ISynchronizer<RESULT> uncorrelate(CORRELATION correlation)
{
return map.remove(correlation);
}
@@ -68,11 +71,11 @@ public class SynchronizingCorrelator<CORRELATION, RESULT> implements Correlator<
return correlate(correlation).put(result, timeout);
}
- protected Synchronizer<RESULT> createSynchronizer(final CORRELATION correlation)
+ protected ISynchronizer<RESULT> createSynchronizer(final CORRELATION correlation)
{
- return new Synchronizer<RESULT>()
+ return new ISynchronizer<RESULT>()
{
- private Synchronizer<RESULT> delegate = new ResultSynchronizer<RESULT>();
+ private ISynchronizer<RESULT> delegate = new ResultSynchronizer<RESULT>();
public RESULT get(long timeout)
{
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/concurrent/SynchronousWorkSerializer.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/concurrent/SynchronousWorkSerializer.java
index 8296524..f385f78 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/concurrent/SynchronousWorkSerializer.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/concurrent/SynchronousWorkSerializer.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,12 +8,14 @@
* Contributors:
* Eike Stepper - initial API and implementation
**************************************************************************/
-package org.eclipse.net4j.util.concurrent;
+package org.eclipse.internal.net4j.util.concurrent;
+
+import org.eclipse.net4j.util.concurrent.IWorkSerializer;
/**
* @author Eike Stepper
*/
-public class SynchronousWorkSerializer implements WorkSerializer
+public class SynchronousWorkSerializer implements IWorkSerializer
{
public SynchronousWorkSerializer()
{
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/event/EventImpl.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/event/EventImpl.java
new file mode 100644
index 0000000..87531c3
--- /dev/null
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/event/EventImpl.java
@@ -0,0 +1,34 @@
+/***************************************************************************
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ **************************************************************************/
+package org.eclipse.internal.net4j.util.event;
+
+import org.eclipse.net4j.util.event.IEvent;
+import org.eclipse.net4j.util.event.INotifier;
+
+import java.util.EventObject;
+
+/**
+ * @author Eike Stepper
+ */
+public class EventImpl extends EventObject implements IEvent
+{
+ private static final long serialVersionUID = 1L;
+
+ public EventImpl(INotifier notifier)
+ {
+ super(notifier);
+ }
+
+ public INotifier getNotifier()
+ {
+ return (INotifier)source;
+ }
+}
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/event/NotifierImpl.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/event/NotifierImpl.java
new file mode 100644
index 0000000..5965663
--- /dev/null
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/event/NotifierImpl.java
@@ -0,0 +1,71 @@
+/***************************************************************************
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ **************************************************************************/
+package org.eclipse.internal.net4j.util.event;
+
+import org.eclipse.net4j.util.event.IEvent;
+import org.eclipse.net4j.util.event.IListener;
+import org.eclipse.net4j.util.event.INotifier;
+
+import org.eclipse.internal.net4j.bundle.Net4j;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Eike Stepper
+ */
+public class NotifierImpl implements INotifier
+{
+ private List<IListener> listeners = new ArrayList(0);
+
+ public NotifierImpl()
+ {
+ }
+
+ public void addListener(IListener listener)
+ {
+ synchronized (listeners)
+ {
+ listeners.add(listener);
+ }
+ }
+
+ public void removeListener(IListener listener)
+ {
+ synchronized (listeners)
+ {
+ listeners.remove(listener);
+ }
+ }
+
+ public IListener[] getListeners()
+ {
+ synchronized (listeners)
+ {
+ return listeners.toArray(new IListener[listeners.size()]);
+ }
+ }
+
+ public void fireEvent(IEvent event)
+ {
+ for (IListener listener : getListeners())
+ {
+ try
+ {
+ listener.notifyEvent(event);
+ }
+ catch (Exception ex)
+ {
+ Net4j.LOG.error(ex);
+ }
+ }
+ }
+}
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/registry/AbstractDelegatingRegistry.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/registry/AbstractDelegatingRegistry.java
index 4ec2d43..37b5dfc 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/registry/AbstractDelegatingRegistry.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/registry/AbstractDelegatingRegistry.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,7 +8,9 @@
* Contributors:
* Eike Stepper - initial API and implementation
**************************************************************************/
-package org.eclipse.net4j.util.registry;
+package org.eclipse.internal.net4j.util.registry;
+
+import org.eclipse.net4j.util.registry.IRegistry;
import java.util.ArrayList;
import java.util.Collection;
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/registry/AbstractRegistry.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/registry/AbstractRegistry.java
index 1eaa82e..e909265 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/registry/AbstractRegistry.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/registry/AbstractRegistry.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,9 +8,13 @@
* Contributors:
* Eike Stepper - initial API and implementation
**************************************************************************/
-package org.eclipse.net4j.util.registry;
+package org.eclipse.internal.net4j.util.registry;
import org.eclipse.net4j.util.om.trace.ContextTracer;
+import org.eclipse.net4j.util.registry.IRegistry;
+import org.eclipse.net4j.util.registry.IRegistryDelta;
+import org.eclipse.net4j.util.registry.IRegistryEvent;
+import org.eclipse.net4j.util.registry.IRegistryListener;
import org.eclipse.net4j.util.registry.IRegistryDelta.Kind;
import org.eclipse.internal.net4j.bundle.Net4j;
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/registry/HashMapDelegatingRegistry.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/registry/HashMapDelegatingRegistry.java
index 8c1764a..816393e 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/registry/HashMapDelegatingRegistry.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/registry/HashMapDelegatingRegistry.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,7 +8,9 @@
* Contributors:
* Eike Stepper - initial API and implementation
**************************************************************************/
-package org.eclipse.net4j.util.registry;
+package org.eclipse.internal.net4j.util.registry;
+
+import org.eclipse.net4j.util.registry.IRegistry;
import java.util.HashMap;
import java.util.Map;
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/registry/HashMapRegistry.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/registry/HashMapRegistry.java
index b1b9eea..04d797b 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/registry/HashMapRegistry.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/registry/HashMapRegistry.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
* Contributors:
* Eike Stepper - initial API and implementation
**************************************************************************/
-package org.eclipse.net4j.util.registry;
+package org.eclipse.internal.net4j.util.registry;
import java.util.HashMap;
import java.util.Map;
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/message/MessageDeserializer.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/message/MessageDeserializer.java
index b2fa597..6609bed 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/message/MessageDeserializer.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/message/MessageDeserializer.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/message/MessageSerializer.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/message/MessageSerializer.java
index 0143763..83d519e 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/message/MessageSerializer.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/message/MessageSerializer.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/remote/ServiceExporter.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/remote/ServiceExporter.java
index b8f44b3..cdf0cb5 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/remote/ServiceExporter.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/remote/ServiceExporter.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/remote/ServiceImporter.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/remote/ServiceImporter.java
index 90f9af5..932849e 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/remote/ServiceImporter.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/remote/ServiceImporter.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/Indication.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/Indication.java
index 2c49e0c..c957aed 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/Indication.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/Indication.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/IndicationWithResponse.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/IndicationWithResponse.java
index 38a133d..f41560c 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/IndicationWithResponse.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/IndicationWithResponse.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/Request.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/Request.java
index 3f2111b..6fafbb5 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/Request.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/Request.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/RequestWithConfirmation.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/RequestWithConfirmation.java
index 2341b7a..a1928b7 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/RequestWithConfirmation.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/RequestWithConfirmation.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/Signal.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/Signal.java
index ca40c66..5e0f21b 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/Signal.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/Signal.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/SignalActor.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/SignalActor.java
index e6300cc..66a7edf 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/SignalActor.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/SignalActor.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/SignalProtocol.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/SignalProtocol.java
index c34af19..1dd79f0 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/SignalProtocol.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/SignalProtocol.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/SignalReactor.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/SignalReactor.java
index 9d09532..d24785c 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/SignalReactor.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/SignalReactor.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/stream/BufferInputStream.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/stream/BufferInputStream.java
index 4d7c8da..6a1848c 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/stream/BufferInputStream.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/stream/BufferInputStream.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/stream/BufferOutputStream.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/stream/BufferOutputStream.java
index a13e2ed..445c393 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/stream/BufferOutputStream.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/stream/BufferOutputStream.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/stream/ChannelInputStream.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/stream/ChannelInputStream.java
index 906bc65..7f65832 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/stream/ChannelInputStream.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/stream/ChannelInputStream.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/stream/ChannelOutputStream.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/stream/ChannelOutputStream.java
index 04d9e60..986b027 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/stream/ChannelOutputStream.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/stream/ChannelOutputStream.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/Acceptor.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/Acceptor.java
new file mode 100644
index 0000000..2b1d881
--- /dev/null
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/Acceptor.java
@@ -0,0 +1,23 @@
+/***************************************************************************
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ **************************************************************************/
+package org.eclipse.net4j.transport;
+
+import org.eclipse.net4j.util.event.INotifier;
+
+/**
+ * @author Eike Stepper
+ */
+public interface Acceptor extends INotifier
+{
+ public String getDescription();
+
+ public Connector[] getAcceptedConnectors();
+}
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/container/ContainerAdapterID.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/AcceptorConnectorsEvent.java
index ee5b52f..2e76ac6 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/container/ContainerAdapterID.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/AcceptorConnectorsEvent.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,19 +8,14 @@
* Contributors:
* Eike Stepper - initial API and implementation
**************************************************************************/
-package org.eclipse.net4j.transport.container;
+package org.eclipse.net4j.transport;
+
+import org.eclipse.net4j.util.event.IEvent;
/**
* @author Eike Stepper
*/
-public interface ContainerAdapterID
+public interface AcceptorConnectorsEvent extends IEvent
{
- public Type getType();
-
- public String getName();
-
- public enum Type
- {
- ACCEPTOR, CONNECTOR, PROTOCOL
- }
+ public Connector getAcceptedConnector();
}
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ConnectorDescription.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/AcceptorFactory.java
index ce27d88..127d60c 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ConnectorDescription.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/AcceptorFactory.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,7 +13,9 @@ package org.eclipse.net4j.transport;
/**
* @author Eike Stepper
*/
-public interface ConnectorDescription
+public interface AcceptorFactory
{
- public String getFactoryID();
+ public String getType();
+
+ public Acceptor createAcceptor();
}
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/Buffer.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/Buffer.java
index a1c81c0..d5793d4 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/Buffer.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/Buffer.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/BufferHandler.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/BufferHandler.java
index e54d89e..dd29583 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/BufferHandler.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/BufferHandler.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/BufferPool.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/BufferPool.java
index e3b9fd3..b3cad59 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/BufferPool.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/BufferPool.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/BufferProvider.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/BufferProvider.java
index a22b1fd..f3cbd02 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/BufferProvider.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/BufferProvider.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/Channel.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/Channel.java
index f06345d..879052e 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/Channel.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/Channel.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ChannelID.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ChannelID.java
index af7265d..f8f5bd1 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ChannelID.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ChannelID.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/Connector.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/Connector.java
index 50dcc9d..de1befa 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/Connector.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/Connector.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,16 +10,19 @@
**************************************************************************/
package org.eclipse.net4j.transport;
+import org.eclipse.net4j.util.event.INotifier;
+
import org.eclipse.internal.net4j.transport.AbstractConnector;
import org.eclipse.internal.net4j.transport.ChannelImpl;
/**
* One endpoint of a physical connection of arbitrary nature between two
* communicating parties. A {@link Connector} encapsulates the process of
- * establishing and closing such connections and has a {@link Type} of
- * {@link Type#CLIENT} or {@link Type#SERVER} with respect to this process. Once
- * a connection is established either party can use its connector to open
- * multiple {@link Channel}s to asynchronously exchange {@link Buffer}s.
+ * establishing and closing such connections and has a {@link ConnectorLocation}
+ * of {@link ConnectorLocation#CLIENT} or {@link ConnectorLocation#SERVER} with
+ * respect to this process. Once a connection is established either party can
+ * use its connector to open multiple {@link Channel}s to asynchronously
+ * exchange {@link Buffer}s.
* <p>
* This interface is <b>not</b> intended to be implemented by clients.
* Providers of connectors for new physical connection types have to subclass
@@ -29,24 +32,25 @@ import org.eclipse.internal.net4j.transport.ChannelImpl;
*
* @author Eike Stepper
*/
-public interface Connector
+public interface Connector extends INotifier.Introspection
{
public Integer getID();
- public Type getType();
+ public ConnectorLocation getLocation();
public boolean isClient();
public boolean isServer();
- public ConnectorDescription getDescription();
+ public String getDescription();
public ConnectorCredentials getCredentials();
- public State getState();
+ public ConnectorState getState();
/**
- * Same as <code>{@link #getState()} == {@link State#CONNECTED}</code>.
+ * Same as
+ * <code>{@link #getState()} == {@link ConnectorState#CONNECTED}</code>.
* <p>
*/
public boolean isConnected();
@@ -102,48 +106,4 @@ public interface Connector
public Channel openChannel(String protocolID) throws ConnectorException;
public Channel openChannel(String protocolID, Object protocolData) throws ConnectorException;
-
- public void addStateListener(StateListener listener);
-
- public void removeStateListener(StateListener listener);
-
- public void addChannelListener(ChannelListener listener);
-
- public void removeChannelListener(ChannelListener listener);
-
- /**
- * @author Eike Stepper
- */
- public enum Type
- {
- CLIENT, SERVER
- }
-
- /**
- * @author Eike Stepper
- */
- public enum State
- {
- DISCONNECTED, CONNECTING, NEGOTIATING, CONNECTED
- }
-
- /**
- * @author Eike Stepper
- */
- public interface StateListener
- {
- public void notifyStateChanged(Connector connector, State newState, State oldState);
- }
-
- /**
- * @author Eike Stepper
- */
- public interface ChannelListener
- {
- public void notifyChannelAboutToOpen(Channel channel);
-
- public void notifyChannelOpened(Channel channel);
-
- public void notifyChannelClosing(Channel channel);
- }
}
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ConnectorChannelsEvent.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ConnectorChannelsEvent.java
new file mode 100644
index 0000000..5f52015
--- /dev/null
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ConnectorChannelsEvent.java
@@ -0,0 +1,31 @@
+/***************************************************************************
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ **************************************************************************/
+package org.eclipse.net4j.transport;
+
+import org.eclipse.net4j.util.event.IEvent;
+
+/**
+ * @author Eike Stepper
+ */
+public interface ConnectorChannelsEvent extends IEvent
+{
+ public Channel getChannel();
+
+ public Type getType();
+
+ /**
+ * @author Eike Stepper
+ */
+ public enum Type
+ {
+ ABOUT_TO_OPEN, OPENED, CLOSING
+ }
+}
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ConnectorCredentials.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ConnectorCredentials.java
index 0a70b1c..7ca31ba 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ConnectorCredentials.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ConnectorCredentials.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ConnectorException.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ConnectorException.java
index 6c9faa4..051f2a2 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ConnectorException.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ConnectorException.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ConnectorFactory.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ConnectorFactory.java
index 540b1ca..4655760 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ConnectorFactory.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ConnectorFactory.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,14 +10,12 @@
**************************************************************************/
package org.eclipse.net4j.transport;
-import org.eclipse.net4j.transport.container.Container;
-
/**
* @author Eike Stepper
*/
public interface ConnectorFactory
{
- public String getID();
+ public String getType();
- public Connector createConnector(Container container);
+ public Connector createConnector();
}
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ConnectorLocation.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ConnectorLocation.java
new file mode 100644
index 0000000..1687706
--- /dev/null
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ConnectorLocation.java
@@ -0,0 +1,9 @@
+package org.eclipse.net4j.transport;
+
+/**
+ * @author Eike Stepper
+ */
+public enum ConnectorLocation
+{
+ CLIENT, SERVER
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ConnectorNegotiator.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ConnectorNegotiator.java
index 14f4c60..4ea01ca 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ConnectorNegotiator.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ConnectorNegotiator.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ConnectorState.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ConnectorState.java
new file mode 100644
index 0000000..0253d91
--- /dev/null
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ConnectorState.java
@@ -0,0 +1,9 @@
+package org.eclipse.net4j.transport;
+
+/**
+ * @author Eike Stepper
+ */
+public enum ConnectorState
+{
+ DISCONNECTED, CONNECTING, NEGOTIATING, CONNECTED
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ConnectorStateEvent.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ConnectorStateEvent.java
new file mode 100644
index 0000000..4fb5503
--- /dev/null
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ConnectorStateEvent.java
@@ -0,0 +1,23 @@
+/***************************************************************************
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ **************************************************************************/
+package org.eclipse.net4j.transport;
+
+import org.eclipse.net4j.util.event.IEvent;
+
+/**
+ * @author Eike Stepper
+ */
+public interface ConnectorStateEvent extends IEvent
+{
+ public ConnectorState getOldState();
+
+ public ConnectorState getNewState();
+}
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/Protocol.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/Protocol.java
index 1accbbf..c2eeb4b 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/Protocol.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/Protocol.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ProtocolFactory.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ProtocolFactory.java
index 79c82a1..5eff20c 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ProtocolFactory.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ProtocolFactory.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,8 +10,6 @@
**************************************************************************/
package org.eclipse.net4j.transport;
-import org.eclipse.net4j.transport.Connector.Type;
-
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
@@ -22,16 +20,16 @@ import java.util.Set;
*/
public interface ProtocolFactory
{
- public static final Set<Type> FOR_CLIENTS = Collections.singleton(Type.CLIENT);
+ public static final Set<ConnectorLocation> FOR_CLIENTS = Collections.singleton(ConnectorLocation.CLIENT);
- public static final Set<Type> FOR_SERVERS = Collections.singleton(Type.SERVER);
+ public static final Set<ConnectorLocation> FOR_SERVERS = Collections.singleton(ConnectorLocation.SERVER);
- public static final Set<Type> SYMMETRIC = Collections.unmodifiableSet(new HashSet(Arrays.asList(new Type[] {
- Type.CLIENT, Type.SERVER })));
+ public static final Set<ConnectorLocation> SYMMETRIC = Collections.unmodifiableSet(new HashSet(Arrays
+ .asList(new ConnectorLocation[] { ConnectorLocation.CLIENT, ConnectorLocation.SERVER })));
public String getProtocolID();
- public Set<Type> getConnectorTypes();
+ public Set<ConnectorLocation> getLocations();
public boolean isForClients();
@@ -39,7 +37,7 @@ public interface ProtocolFactory
public boolean isSymmetric();
- public ProtocolFactoryID createID(Type type);
+ public ProtocolFactoryID getID(ConnectorLocation location);
public Protocol createProtocol(Channel channel, Object protocolData);
} \ No newline at end of file
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ProtocolFactoryID.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ProtocolFactoryID.java
index c308f28..16f9d71 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ProtocolFactoryID.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/ProtocolFactoryID.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,14 +10,12 @@
**************************************************************************/
package org.eclipse.net4j.transport;
-import org.eclipse.net4j.transport.Connector.Type;
-
/**
* @author Eike Stepper
*/
public interface ProtocolFactoryID
{
- public Type getType();
+ public ConnectorLocation getLocation();
public String getProtocolID();
}
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/container/Container.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/container/Container.java
index 01ba53d..0398da9 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/container/Container.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/container/Container.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,12 +10,13 @@
**************************************************************************/
package org.eclipse.net4j.transport.container;
+import org.eclipse.net4j.transport.Acceptor;
+import org.eclipse.net4j.transport.AcceptorFactory;
import org.eclipse.net4j.transport.BufferProvider;
import org.eclipse.net4j.transport.Channel;
import org.eclipse.net4j.transport.ChannelID;
import org.eclipse.net4j.transport.Connector;
import org.eclipse.net4j.transport.ConnectorFactory;
-import org.eclipse.net4j.transport.Protocol;
import org.eclipse.net4j.transport.ProtocolFactory;
import org.eclipse.net4j.transport.ProtocolFactoryID;
import org.eclipse.net4j.util.registry.IRegistry;
@@ -27,21 +28,71 @@ import java.util.concurrent.ExecutorService;
*/
public interface Container
{
- public ContainerAdapter getAdapter(ContainerAdapterID adapterID);
-
public ExecutorService getExecutorService();
public BufferProvider getBufferProvider();
+ /*
+ * ContainerAdapterFactory
+ */
+
+ public IRegistry<String, ContainerAdapterFactory> getAdapterFactoryRegistry();
+
+ public void register(ContainerAdapterFactory factory);
+
+ public void deregister(ContainerAdapterFactory factory);
+
+ public ContainerAdapter getAdapter(String type);
+
+ /*
+ * AcceptorFactory
+ */
+
+ public IRegistry<String, AcceptorFactory> getAcceptorFactoryRegistry();
+
+ public void register(AcceptorFactory factory);
+
+ public void deregister(AcceptorFactory factory);
+
+ /*
+ * ConnectorFactory
+ */
+
public IRegistry<String, ConnectorFactory> getConnectorFactoryRegistry();
+ public void register(ConnectorFactory factory);
+
+ public void deregister(ConnectorFactory factory);
+
+ /*
+ * ProtocolFactory
+ */
+
public IRegistry<ProtocolFactoryID, ProtocolFactory> getProtocolFactoryRegistry();
- public IRegistry<Integer, Connector> getConnectorRegistry();
+ public void register(ProtocolFactory factory);
- public IRegistry<ChannelID, Channel> getChannelRegistry();
+ public void deregister(ProtocolFactory factory);
+
+ /*
+ * Acceptor
+ */
+
+ public IRegistry<String, Acceptor> getAcceptorRegistry();
- public Connector createConnector(String connectorFactoryID);
+ public Acceptor getAcceptor(String description);
- public Protocol createProtocol(String protocolID);
+ /*
+ * Connector
+ */
+
+ public IRegistry<String, Connector> getConnectorRegistry();
+
+ public Connector getConnector(String description);
+
+ /*
+ * Channel
+ */
+
+ public IRegistry<ChannelID, Channel> getChannelRegistry();
}
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/container/ContainerAdapter.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/container/ContainerAdapter.java
index a7d74fa..2853a89 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/container/ContainerAdapter.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/container/ContainerAdapter.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,6 +10,9 @@
**************************************************************************/
package org.eclipse.net4j.transport.container;
+import org.eclipse.net4j.transport.Acceptor;
+import org.eclipse.net4j.transport.Connector;
+
/**
* @author Eike Stepper
*/
@@ -17,5 +20,9 @@ public interface ContainerAdapter
{
public Container getContainer();
- public ContainerAdapterID getID();
+ public String getType();
+
+ public void initAcceptor(Acceptor acceptor);
+
+ public void initConnector(Connector connector);
}
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/container/ContainerAdapterFactory.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/container/ContainerAdapterFactory.java
index 9707be6..7869f59 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/container/ContainerAdapterFactory.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/container/ContainerAdapterFactory.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,17 +10,12 @@
**************************************************************************/
package org.eclipse.net4j.transport.container;
-import org.eclipse.net4j.util.registry.HashMapRegistry;
-import org.eclipse.net4j.util.registry.IRegistry;
-
/**
* @author Eike Stepper
*/
public interface ContainerAdapterFactory
{
- public static final IRegistry<ContainerAdapterID, ContainerAdapterFactory> REGISTRY = new HashMapRegistry();
-
- public ContainerAdapterID getID();
+ public String getType();
public ContainerAdapter createAdapter(Container container);
}
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/container/ContainerUtil.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/container/ContainerUtil.java
index 80965d8..92efc85 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/container/ContainerUtil.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/container/ContainerUtil.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -14,19 +14,17 @@ import org.eclipse.net4j.transport.BufferPool;
import org.eclipse.net4j.transport.BufferProvider;
import org.eclipse.net4j.transport.Channel;
import org.eclipse.net4j.transport.ChannelID;
-import org.eclipse.net4j.transport.Connector;
+import org.eclipse.net4j.transport.ConnectorLocation;
import org.eclipse.net4j.transport.Protocol;
import org.eclipse.net4j.transport.ProtocolFactory;
import org.eclipse.net4j.transport.ProtocolFactoryID;
-import org.eclipse.net4j.transport.container.ContainerAdapterID.Type;
import org.eclipse.net4j.util.registry.IRegistry;
import org.eclipse.internal.net4j.transport.BufferFactoryImpl;
import org.eclipse.internal.net4j.transport.BufferPoolImpl;
import org.eclipse.internal.net4j.transport.BufferUtil;
import org.eclipse.internal.net4j.transport.ProtocolFactoryIDImpl;
-import org.eclipse.internal.net4j.transport.container.ContainerAdapterIDImpl;
-import org.eclipse.internal.net4j.transport.container.ContainerImpl;
+import org.eclipse.internal.net4j.transport.container.DefaultContainer;
import java.util.ArrayList;
import java.util.Collection;
@@ -41,24 +39,30 @@ public final class ContainerUtil
{
}
- public static ContainerAdapterID createContainerAdapterID(Type type, String name)
+ public static ProtocolFactoryID createProtocolFactoryID(ConnectorLocation connectorLocation, String protocolID)
{
- return new ContainerAdapterIDImpl(type, name);
+ return new ProtocolFactoryIDImpl(connectorLocation, protocolID);
}
- public static ProtocolFactoryID createProtocolFactoryID(Connector.Type type, String protocolID)
+ public static Container createContainer()
{
- return new ProtocolFactoryIDImpl(type, protocolID);
+ return new DefaultContainer();
}
- public static Container createContainer(IRegistry<ContainerAdapterID, ContainerAdapterFactory> adapterFactoryRegistry)
+ public static Container createContainer(short bufferCapacity)
{
- return new ContainerImpl(adapterFactoryRegistry);
+ return new DefaultContainer(bufferCapacity);
}
- public static Container createContainer()
+ public static Container createContainer(IRegistry<String, ContainerAdapterFactory> adapterFactoryRegistry)
+ {
+ return new DefaultContainer(adapterFactoryRegistry);
+ }
+
+ public static Container createContainer(IRegistry<String, ContainerAdapterFactory> adapterFactoryRegistry,
+ short bufferCapacity)
{
- return new ContainerImpl();
+ return new DefaultContainer(adapterFactoryRegistry, bufferCapacity);
}
public static BufferProvider createBufferFactory(short bufferCapacity)
@@ -135,11 +139,11 @@ public final class ContainerUtil
// return new TCPSelectorImpl();
// }
- public static Collection<Channel> getChannels(Container container, String protocolID, Set<Connector.Type> types)
+ public static Collection<Channel> getChannels(Container container, String protocolID, Set<ConnectorLocation> locations)
{
- if (types == null)
+ if (locations == null)
{
- types = ProtocolFactory.SYMMETRIC;
+ locations = ProtocolFactory.SYMMETRIC;
}
IRegistry<ChannelID, Channel> channelRegistry = container.getChannelRegistry();
@@ -152,7 +156,7 @@ public final class ContainerUtil
Collection<Channel> result = new ArrayList(channels.size());
for (Channel channel : channels)
{
- if (types.contains(channel.getConnector().getType()))
+ if (locations.contains(channel.getConnector().getLocation()))
{
if (protocolID == null || protocolID.length() == 0)
{
@@ -180,9 +184,9 @@ public final class ContainerUtil
return getChannels(container, protocolID, null);
}
- public static Collection<Channel> getChannels(Container container, Set<Connector.Type> types)
+ public static Collection<Channel> getChannels(Container container, Set<ConnectorLocation> locations)
{
- return getChannels(container, null, types);
+ return getChannels(container, null, locations);
}
// public static Map<Type, IRegistry<ProtocolFactoryID, ProtocolFactory>>
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/user/Credentials.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/user/Credentials.java
index 60a87ac..fbde0eb 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/user/Credentials.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/user/Credentials.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/user/User.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/user/User.java
index 9b07af0..af1595f 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/user/User.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/user/User.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/HexUtil.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/HexUtil.java
index 1b8a417..239ed05 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/HexUtil.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/HexUtil.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/IOUtil.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/IOUtil.java
index b44428c..7f7bf6b 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/IOUtil.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/IOUtil.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/ObjectUtil.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/ObjectUtil.java
index 6ec7f67..250c430 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/ObjectUtil.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/ObjectUtil.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/ReflectUtil.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/ReflectUtil.java
index 866735a..393aa65 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/ReflectUtil.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/ReflectUtil.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/StringUtil.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/StringUtil.java
index 4a5833f..cc0ac52 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/StringUtil.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/StringUtil.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -15,10 +15,22 @@ package org.eclipse.net4j.util;
*/
public final class StringUtil
{
+ public static final String EMPTY = "";
+
private StringUtil()
{
}
+ public static String safe(String str)
+ {
+ if (str == null)
+ {
+ return EMPTY;
+ }
+
+ return str;
+ }
+
public static int occurrences(String str, char c)
{
int count = 0;
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/concurrent/Correlator.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/concurrent/ICorrelator.java
index 959fbc3..a0d1fad 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/concurrent/Correlator.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/concurrent/ICorrelator.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,7 +13,7 @@ package org.eclipse.net4j.util.concurrent;
/**
* @author Eike Stepper
*/
-public interface Correlator<CORRELATION, VALUE>
+public interface ICorrelator<CORRELATION, VALUE>
{
public boolean isCorrelated(CORRELATION correlation);
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/concurrent/Synchronizer.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/concurrent/ISynchronizer.java
index b8a432a..bdf4052 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/concurrent/Synchronizer.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/concurrent/ISynchronizer.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,14 +13,14 @@ package org.eclipse.net4j.util.concurrent;
/**
* Synchronizes a producer and a consumer thread letting the producer pass a
* value to the consumer. Both producer and consumer must have access to this
- * {@link Synchronizer} and there must only ever exist one consumer for it. Once
- * the result value is consumed by the consumer this {@link Synchronizer} must
- * not be reused.
+ * {@link ISynchronizer} and there must only ever exist one consumer for it.
+ * Once the result value is consumed by the consumer this {@link ISynchronizer}
+ * must not be reused.
* <p>
*
* @author Eike Stepper
*/
-public interface Synchronizer<RESULT>
+public interface ISynchronizer<RESULT>
{
public RESULT get(long timeout);
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/concurrent/WorkSerializer.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/concurrent/IWorkSerializer.java
index a78a61b..5206bbd 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/concurrent/WorkSerializer.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/concurrent/IWorkSerializer.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -17,7 +17,7 @@ import java.util.concurrent.ExecutorCompletionService;
*
* @author Eike Stepper
*/
-public interface WorkSerializer
+public interface IWorkSerializer
{
public void addWork(Runnable work);
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/event/IEvent.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/event/IEvent.java
new file mode 100644
index 0000000..c627f6b
--- /dev/null
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/event/IEvent.java
@@ -0,0 +1,19 @@
+/***************************************************************************
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ **************************************************************************/
+package org.eclipse.net4j.util.event;
+
+/**
+ * @author Eike Stepper
+ */
+public interface IEvent
+{
+ public INotifier getNotifier();
+}
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/event/IListener.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/event/IListener.java
new file mode 100644
index 0000000..ed4d122
--- /dev/null
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/event/IListener.java
@@ -0,0 +1,21 @@
+/***************************************************************************
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ **************************************************************************/
+package org.eclipse.net4j.util.event;
+
+import java.util.EventListener;
+
+/**
+ * @author Eike Stepper
+ */
+public interface IListener extends EventListener
+{
+ public void notifyEvent(IEvent event);
+}
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/event/INotifier.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/event/INotifier.java
new file mode 100644
index 0000000..aed2d2e
--- /dev/null
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/event/INotifier.java
@@ -0,0 +1,29 @@
+/***************************************************************************
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ **************************************************************************/
+package org.eclipse.net4j.util.event;
+
+/**
+ * @author Eike Stepper
+ */
+public interface INotifier
+{
+ public void addListener(IListener listener);
+
+ public void removeListener(IListener listener);
+
+ /**
+ * @author Eike Stepper
+ */
+ public interface Introspection extends INotifier
+ {
+ public IListener[] getListeners();
+ }
+}
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/Activator.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/Activator.java
index 21736b3..4668b75 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/Activator.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/Activator.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/Deactivator.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/Deactivator.java
index fd2c6de..4e79ac5 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/Deactivator.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/Deactivator.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/Lifecycle.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/Lifecycle.java
index 1556f4c..ca22795 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/Lifecycle.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/Lifecycle.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/LifecycleImpl.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/LifecycleImpl.java
index 2cb4de0..1cea11e 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/LifecycleImpl.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/LifecycleImpl.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/LifecycleListener.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/LifecycleListener.java
index 9a45756..c770369 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/LifecycleListener.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/LifecycleListener.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/LifecycleNotifier.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/LifecycleNotifier.java
index 20f49ea..ed5bb07 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/LifecycleNotifier.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/LifecycleNotifier.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/LifecycleUtil.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/LifecycleUtil.java
index 785f174..4be6d44 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/LifecycleUtil.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/LifecycleUtil.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -28,6 +28,28 @@ public final class LifecycleUtil
{
}
+ public static boolean addListener(Object notifier, LifecycleListener listener)
+ {
+ if (notifier instanceof LifecycleNotifier)
+ {
+ ((LifecycleNotifier)notifier).addLifecycleListener(listener);
+ return true;
+ }
+
+ return false;
+ }
+
+ public static boolean removeListener(Object notifier, LifecycleListener listener)
+ {
+ if (notifier instanceof LifecycleNotifier)
+ {
+ ((LifecycleNotifier)notifier).removeLifecycleListener(listener);
+ return true;
+ }
+
+ return false;
+ }
+
public static boolean isActive(Object object)
{
if (object instanceof Lifecycle.Introspection)
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/Singleton.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/Singleton.java
index 60b058d..94c63e6 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/Singleton.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/Singleton.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/OMBundle.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/OMBundle.java
index fda3f48..f566605 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/OMBundle.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/OMBundle.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/OMLogHandler.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/OMLogHandler.java
index 6e2ef8a..5094c24 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/OMLogHandler.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/OMLogHandler.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/OMLogger.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/OMLogger.java
index 65a5d7d..68a247b 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/OMLogger.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/OMLogger.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/OMPlatform.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/OMPlatform.java
index 331c462..599a21a 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/OMPlatform.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/OMPlatform.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/OMTraceHandler.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/OMTraceHandler.java
index c5bca74..02f9275 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/OMTraceHandler.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/OMTraceHandler.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/OMTracer.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/OMTracer.java
index d472a80..8d0361f 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/OMTracer.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/OMTracer.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/log/EclipseLoggingBridge.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/log/EclipseLoggingBridge.java
index 902cbb8..b8cff48 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/log/EclipseLoggingBridge.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/log/EclipseLoggingBridge.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/log/OSGiLoggingBridge.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/log/OSGiLoggingBridge.java
index 8c36c6e..cb71ca1 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/log/OSGiLoggingBridge.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/log/OSGiLoggingBridge.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/log/PrintLogHandler.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/log/PrintLogHandler.java
index 6de0136..ebc7cce 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/log/PrintLogHandler.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/log/PrintLogHandler.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/trace/ContextTracer.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/trace/ContextTracer.java
index e39e9f3..cce0b73 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/trace/ContextTracer.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/trace/ContextTracer.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/trace/PrintTraceHandler.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/trace/PrintTraceHandler.java
index 5886b0b..f968293 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/trace/PrintTraceHandler.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/trace/PrintTraceHandler.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/trace/RemoteTraceHandler.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/trace/RemoteTraceHandler.java
index eb51af0..d38b730 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/trace/RemoteTraceHandler.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/trace/RemoteTraceHandler.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/trace/RemoteTraceServer.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/trace/RemoteTraceServer.java
index 40410b9..41b5f2f 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/trace/RemoteTraceServer.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/om/trace/RemoteTraceServer.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/registry/IRegistry.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/registry/IRegistry.java
index b4ac6cf..681c7a0 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/registry/IRegistry.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/registry/IRegistry.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/registry/IRegistryDelta.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/registry/IRegistryDelta.java
index ae206c2..675e83e 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/registry/IRegistryDelta.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/registry/IRegistryDelta.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/registry/IRegistryEvent.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/registry/IRegistryEvent.java
index 56b13f8..73d6f94 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/registry/IRegistryEvent.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/registry/IRegistryEvent.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/stream/ExtendedDataInput.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/stream/ExtendedDataInput.java
index db0be9c..6979eb3 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/stream/ExtendedDataInput.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/stream/ExtendedDataInput.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/stream/ExtendedDataInputStream.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/stream/ExtendedDataInputStream.java
index f2e5670..c69e63b 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/stream/ExtendedDataInputStream.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/stream/ExtendedDataInputStream.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/stream/ExtendedDataOutput.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/stream/ExtendedDataOutput.java
index 1e989a6..95d77a7 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/stream/ExtendedDataOutput.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/stream/ExtendedDataOutput.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/stream/ExtendedDataOutputStream.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/stream/ExtendedDataOutputStream.java
index 337c259..5fe760a 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/stream/ExtendedDataOutputStream.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/stream/ExtendedDataOutputStream.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany.
+ * Copyright (c) 2004-2007 Eike Stepper, Germany.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at