Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-11-01 04:17:43 -0400
committerEike Stepper2008-11-01 04:17:43 -0400
commitf47564c0c12fa033d5e2436a6ab85a1fac5b11bf (patch)
tree00425e8f27231e7077fee142479f532daa05ae83
parentb052cd228a09572591b18b3a6f5e905088dcf84f (diff)
downloadcdo-f47564c0c12fa033d5e2436a6ab85a1fac5b11bf.tar.gz
cdo-f47564c0c12fa033d5e2436a6ab85a1fac5b11bf.tar.xz
cdo-f47564c0c12fa033d5e2436a6ab85a1fac5b11bf.zip
[253049] Give the infrastructure of an IProtocol a parametric type
https://bugs.eclipse.org/bugs/show_bug.cgi?id=253049
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOProtocol.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/CDOProtocolImpl.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOServerProtocol.java11
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOServerProtocolFactory.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOServerRequest.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/OpenSessionIndication.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/store/logic/TestLogic.java2
-rw-r--r--plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/ISession.java4
-rw-r--r--plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/Collaboration.java2
-rw-r--r--plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/BuddyStateNotification.java2
-rw-r--r--plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/CollaborationLeftNotification.java2
-rw-r--r--plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/MessageNotification.java2
-rw-r--r--plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/BuddyAdmin.java3
-rw-r--r--plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/BuddiesServerProtocol.java3
-rw-r--r--plugins/org.eclipse.net4j.buddies/src/org/eclipse/net4j/internal/buddies/protocol/BuddiesClientProtocol.java6
-rw-r--r--plugins/org.eclipse.net4j.buddies/src/org/eclipse/net4j/internal/buddies/protocol/OpenSessionRequest.java5
-rw-r--r--plugins/org.eclipse.net4j.examples/src/org/eclipse/net4j/examples/echo/client/EchoClientProtocol.java2
-rw-r--r--plugins/org.eclipse.net4j.examples/src/org/eclipse/net4j/examples/echo/server/EchoServerProtocol.java2
-rw-r--r--plugins/org.eclipse.net4j.http.common/src/org/eclipse/net4j/http/internal/common/HTTPConnector.java2
-rw-r--r--plugins/org.eclipse.net4j.http.server/src/org/eclipse/net4j/http/internal/server/HTTPServerConnector.java2
-rw-r--r--plugins/org.eclipse.net4j.http.server/src/org/eclipse/net4j/http/internal/server/Net4jTransportServlet.java2
-rw-r--r--plugins/org.eclipse.net4j.jms.admin/src/org/eclipse/net4j/jms/internal/admin/protocol/JMSAdminProtocol.java2
-rw-r--r--plugins/org.eclipse.net4j.jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/JMSServerProtocol.java3
-rw-r--r--plugins/org.eclipse.net4j.jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/admin/JMSAdminServerProtocol.java2
-rw-r--r--plugins/org.eclipse.net4j.jms.server/src/org/eclipse/net4j/jms/server/IServerConsumer.java2
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSClientProtocol.java2
-rw-r--r--plugins/org.eclipse.net4j.jvm/src/org/eclipse/net4j/internal/jvm/JVMConnector.java4
-rw-r--r--plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/ControlChannel.java2
-rw-r--r--plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/TCPConnector.java4
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TestProtocol.java7
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/signal/TestSignalProtocol.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/connector/Connector.java17
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/ContainerProtocolProvider.java4
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/FactoriesProtocolProvider.java4
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/channel/IChannelMultiplexer.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/protocol/IProtocol.java6
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/protocol/IProtocolProvider.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/protocol/Protocol.java8
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/ExceptionMessageRequest.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/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.java6
-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/failover/FailOverStrategy.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/wrapping/StreamWrapperInjector.java6
47 files changed, 88 insertions, 81 deletions
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOProtocol.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOProtocol.java
index 3dcfe20493..b7a9a49cc5 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOProtocol.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOProtocol.java
@@ -16,7 +16,7 @@ import org.eclipse.net4j.protocol.IProtocol;
* @author Eike Stepper
* @noimplement This interface is not intended to be implemented by clients.
*/
-public interface CDOProtocol extends IProtocol
+public interface CDOProtocol<INFRA_STRUCTURE> extends IProtocol<INFRA_STRUCTURE>
{
public CDOProtocolSession getSession();
}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/CDOProtocolImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/CDOProtocolImpl.java
index fb7b6affca..6b01384ab4 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/CDOProtocolImpl.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/CDOProtocolImpl.java
@@ -19,7 +19,8 @@ import org.eclipse.net4j.signal.SignalProtocol;
/**
* @author Eike Stepper
*/
-public abstract class CDOProtocolImpl extends SignalProtocol implements CDOProtocol
+public abstract class CDOProtocolImpl extends SignalProtocol<CDOProtocolSession> implements
+ CDOProtocol<CDOProtocolSession>
{
public CDOProtocolImpl()
{
@@ -32,6 +33,6 @@ public abstract class CDOProtocolImpl extends SignalProtocol implements CDOProto
public CDOProtocolSession getSession()
{
- return (CDOProtocolSession)getInfraStructure();
+ return getInfraStructure();
}
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOServerProtocol.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOServerProtocol.java
index 1eae63f6a1..d88dbf012f 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOServerProtocol.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOServerProtocol.java
@@ -17,6 +17,7 @@ package org.eclipse.emf.cdo.internal.server.protocol;
import org.eclipse.emf.cdo.common.CDOProtocolConstants;
import org.eclipse.emf.cdo.internal.common.CDOProtocolImpl;
import org.eclipse.emf.cdo.internal.server.Session;
+import org.eclipse.emf.cdo.server.IRepositoryProvider;
import org.eclipse.net4j.signal.SignalReactor;
@@ -25,8 +26,16 @@ import org.eclipse.net4j.signal.SignalReactor;
*/
public class CDOServerProtocol extends CDOProtocolImpl
{
- public CDOServerProtocol()
+ private IRepositoryProvider repositoryProvider;
+
+ public CDOServerProtocol(IRepositoryProvider repositoryProvider)
+ {
+ this.repositoryProvider = repositoryProvider;
+ }
+
+ public IRepositoryProvider getRepositoryProvider()
{
+ return repositoryProvider;
}
@Override
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOServerProtocolFactory.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOServerProtocolFactory.java
index b8dedb1c20..18b367155d 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOServerProtocolFactory.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOServerProtocolFactory.java
@@ -28,9 +28,7 @@ public class CDOServerProtocolFactory extends ServerProtocolFactory
public CDOServerProtocol create(String description)
{
- CDOServerProtocol serverProtocol = new CDOServerProtocol();
- serverProtocol.setInfraStructure(repositoryProvider);
- return serverProtocol;
+ return new CDOServerProtocol(repositoryProvider);
}
public static CDOServerProtocol get(IManagedContainer container, String description)
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOServerRequest.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOServerRequest.java
index 81f1c4c953..610254c7c6 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOServerRequest.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOServerRequest.java
@@ -24,7 +24,6 @@ import org.eclipse.emf.cdo.server.IStore;
import org.eclipse.net4j.channel.IChannel;
import org.eclipse.net4j.signal.Request;
-import org.eclipse.net4j.signal.SignalProtocol;
import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
@@ -123,11 +122,11 @@ public abstract class CDOServerRequest extends Request
protected abstract void requesting(CDODataOutput out) throws IOException;
- private static SignalProtocol extractProtocol(IChannel channel)
+ private static CDOServerProtocol extractProtocol(IChannel channel)
{
if (LifecycleUtil.isActive(channel))
{
- return (SignalProtocol)channel.getReceiveHandler();
+ return (CDOServerProtocol)channel.getReceiveHandler();
}
throw new IllegalStateException("Channel is inactive: " + channel);
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/OpenSessionIndication.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/OpenSessionIndication.java
index b77c572789..ee24c13a8d 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/OpenSessionIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/OpenSessionIndication.java
@@ -86,7 +86,7 @@ public class OpenSessionIndication extends RepositoryTimeIndication
try
{
CDOServerProtocol protocol = getProtocol();
- IRepositoryProvider repositoryProvider = (IRepositoryProvider)protocol.getInfraStructure();
+ IRepositoryProvider repositoryProvider = protocol.getRepositoryProvider();
repository = (Repository)repositoryProvider.getRepository(repositoryName);
if (repository == null)
{
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/store/logic/TestLogic.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/store/logic/TestLogic.java
index f4559d2393..e3cf7740d8 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/store/logic/TestLogic.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/store/logic/TestLogic.java
@@ -294,7 +294,7 @@ public abstract class TestLogic extends AbstractOMTest
protected CDOServerProtocol createProtocol()
{
- return new CDOServerProtocol();
+ return new CDOServerProtocol(null);
}
protected Transaction createTransaction(Session session)
diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/ISession.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/ISession.java
index e10c4292e4..e656ec94a1 100644
--- a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/ISession.java
+++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/common/ISession.java
@@ -10,7 +10,7 @@
**************************************************************************/
package org.eclipse.net4j.buddies.common;
-import org.eclipse.net4j.signal.SignalProtocol;
+import org.eclipse.net4j.protocol.IProtocol;
import org.eclipse.net4j.util.event.INotifier;
import org.eclipse.core.runtime.IAdaptable;
@@ -23,7 +23,7 @@ public interface ISession extends INotifier, IAdaptable
/**
* @since 2.0
*/
- public SignalProtocol getProtocol();
+ public IProtocol<?> getProtocol();
public IBuddy getSelf();
diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/Collaboration.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/Collaboration.java
index b4b02b62ae..5900a276d6 100644
--- a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/Collaboration.java
+++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/Collaboration.java
@@ -167,7 +167,7 @@ public class Collaboration extends MembershipContainer implements ICollaboration
{
try
{
- SignalProtocol protocol = receiver.getSession().getProtocol();
+ SignalProtocol<?> protocol = (SignalProtocol<?>)receiver.getSession().getProtocol();
new MessageNotification(protocol, collaborationID, facilityType, message).send();
}
catch (Exception ex)
diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/BuddyStateNotification.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/BuddyStateNotification.java
index 4065f7e244..7bb4b6bf9c 100644
--- a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/BuddyStateNotification.java
+++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/BuddyStateNotification.java
@@ -26,7 +26,7 @@ public class BuddyStateNotification extends Request
private State state;
- public BuddyStateNotification(SignalProtocol protocol, String userID, State state)
+ public BuddyStateNotification(SignalProtocol<?> protocol, String userID, State state)
{
super(protocol);
this.userID = userID;
diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/CollaborationLeftNotification.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/CollaborationLeftNotification.java
index 67cf2c2cd2..067e94494e 100644
--- a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/CollaborationLeftNotification.java
+++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/CollaborationLeftNotification.java
@@ -25,7 +25,7 @@ public class CollaborationLeftNotification extends Request
private String userID;
- public CollaborationLeftNotification(SignalProtocol protocol, long collaborationID, String userID)
+ public CollaborationLeftNotification(SignalProtocol<?> protocol, long collaborationID, String userID)
{
super(protocol);
this.collaborationID = collaborationID;
diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/MessageNotification.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/MessageNotification.java
index 2182ae2dae..894697f155 100644
--- a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/MessageNotification.java
+++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/MessageNotification.java
@@ -28,7 +28,7 @@ public class MessageNotification extends Request
private IMessage message;
- public MessageNotification(SignalProtocol protocol, long collaborationID, String facilityType, IMessage message)
+ public MessageNotification(SignalProtocol<?> protocol, long collaborationID, String facilityType, IMessage message)
{
super(protocol);
this.collaborationID = collaborationID;
diff --git a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/BuddyAdmin.java b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/BuddyAdmin.java
index 4fc6fd898d..46f14a5e04 100644
--- a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/BuddyAdmin.java
+++ b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/BuddyAdmin.java
@@ -28,7 +28,6 @@ import org.eclipse.net4j.buddies.internal.server.protocol.CollaborationInitiated
import org.eclipse.net4j.buddies.server.IBuddyAdmin;
import org.eclipse.net4j.buddies.spi.common.ServerFacilityFactory;
import org.eclipse.net4j.channel.IChannel;
-import org.eclipse.net4j.protocol.IProtocol;
import org.eclipse.net4j.util.ObjectUtil;
import org.eclipse.net4j.util.container.IPluginContainer;
import org.eclipse.net4j.util.event.IEvent;
@@ -134,7 +133,7 @@ public class BuddyAdmin extends CollaborationContainer implements IBuddyAdmin, I
BuddiesServerProtocol protocol = (BuddiesServerProtocol)channel.getReceiveHandler();
ServerSession session = new ServerSession(protocol, buddy);
- ((IProtocol)channel.getReceiveHandler()).setInfraStructure(session);
+ protocol.setInfraStructure(session);
session.addListener(this);
buddy.setSession(session);
LifecycleUtil.activate(session);
diff --git a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/BuddiesServerProtocol.java b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/BuddiesServerProtocol.java
index f5ffbf52e6..6c2d084b9e 100644
--- a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/BuddiesServerProtocol.java
+++ b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/BuddiesServerProtocol.java
@@ -12,6 +12,7 @@ package org.eclipse.net4j.buddies.internal.server.protocol;
import org.eclipse.net4j.buddies.internal.common.protocol.MessageIndication;
import org.eclipse.net4j.buddies.internal.common.protocol.ProtocolConstants;
+import org.eclipse.net4j.buddies.internal.server.ServerSession;
import org.eclipse.net4j.buddies.server.IBuddyAdmin;
import org.eclipse.net4j.signal.SignalProtocol;
import org.eclipse.net4j.signal.SignalReactor;
@@ -21,7 +22,7 @@ import org.eclipse.net4j.util.container.IManagedContainer;
* @author Eike Stepper
* @since 2.0
*/
-public class BuddiesServerProtocol extends SignalProtocol
+public class BuddiesServerProtocol extends SignalProtocol<ServerSession>
{
public BuddiesServerProtocol()
{
diff --git a/plugins/org.eclipse.net4j.buddies/src/org/eclipse/net4j/internal/buddies/protocol/BuddiesClientProtocol.java b/plugins/org.eclipse.net4j.buddies/src/org/eclipse/net4j/internal/buddies/protocol/BuddiesClientProtocol.java
index 9546864e74..1faf91a87e 100644
--- a/plugins/org.eclipse.net4j.buddies/src/org/eclipse/net4j/internal/buddies/protocol/BuddiesClientProtocol.java
+++ b/plugins/org.eclipse.net4j.buddies/src/org/eclipse/net4j/internal/buddies/protocol/BuddiesClientProtocol.java
@@ -23,7 +23,7 @@ import org.eclipse.net4j.util.concurrent.ConcurrencyUtil;
/**
* @author Eike Stepper
*/
-public class BuddiesClientProtocol extends SignalProtocol
+public class BuddiesClientProtocol extends SignalProtocol<ClientSession>
{
private static final long GET_SESSION_TIMEOUT = 20000;
@@ -72,7 +72,7 @@ public class BuddiesClientProtocol extends SignalProtocol
protected Self getSelf()
{
- ISession session = (ISession)getInfraStructure();
+ ISession session = getInfraStructure();
return (Self)session.getSelf();
}
@@ -81,7 +81,7 @@ public class BuddiesClientProtocol extends SignalProtocol
int max = (int)(GET_SESSION_TIMEOUT / GET_SESSION_INTERVAL);
for (int i = 0; i < max; i++)
{
- ClientSession session = (ClientSession)getInfraStructure();
+ ClientSession session = getInfraStructure();
if (session == null)
{
ConcurrencyUtil.sleep(GET_SESSION_INTERVAL);
diff --git a/plugins/org.eclipse.net4j.buddies/src/org/eclipse/net4j/internal/buddies/protocol/OpenSessionRequest.java b/plugins/org.eclipse.net4j.buddies/src/org/eclipse/net4j/internal/buddies/protocol/OpenSessionRequest.java
index b9a8126a4a..39a2f8e467 100644
--- a/plugins/org.eclipse.net4j.buddies/src/org/eclipse/net4j/internal/buddies/protocol/OpenSessionRequest.java
+++ b/plugins/org.eclipse.net4j.buddies/src/org/eclipse/net4j/internal/buddies/protocol/OpenSessionRequest.java
@@ -68,8 +68,9 @@ public class OpenSessionRequest extends RequestWithConfirmation<IBuddySession>
return null;
}
- ClientSession session = new ClientSession((BuddiesClientProtocol)getProtocol());
- getProtocol().setInfraStructure(session);
+ BuddiesClientProtocol protocol = (BuddiesClientProtocol)getProtocol();
+ ClientSession session = new ClientSession(protocol);
+ protocol.setInfraStructure(session);
session.setSelf(account, facilityTypes);
int size = in.readInt();
diff --git a/plugins/org.eclipse.net4j.examples/src/org/eclipse/net4j/examples/echo/client/EchoClientProtocol.java b/plugins/org.eclipse.net4j.examples/src/org/eclipse/net4j/examples/echo/client/EchoClientProtocol.java
index c410f31f12..df40d959d6 100644
--- a/plugins/org.eclipse.net4j.examples/src/org/eclipse/net4j/examples/echo/client/EchoClientProtocol.java
+++ b/plugins/org.eclipse.net4j.examples/src/org/eclipse/net4j/examples/echo/client/EchoClientProtocol.java
@@ -19,7 +19,7 @@ import org.eclipse.net4j.signal.SignalReactor;
* @author Eike Stepper
* @since 2.0
*/
-public class EchoClientProtocol extends SignalProtocol implements EchoProtocol
+public class EchoClientProtocol extends SignalProtocol<Object> implements EchoProtocol
{
public EchoClientProtocol(IConnector connector)
{
diff --git a/plugins/org.eclipse.net4j.examples/src/org/eclipse/net4j/examples/echo/server/EchoServerProtocol.java b/plugins/org.eclipse.net4j.examples/src/org/eclipse/net4j/examples/echo/server/EchoServerProtocol.java
index e74fa12fc9..880881c171 100644
--- a/plugins/org.eclipse.net4j.examples/src/org/eclipse/net4j/examples/echo/server/EchoServerProtocol.java
+++ b/plugins/org.eclipse.net4j.examples/src/org/eclipse/net4j/examples/echo/server/EchoServerProtocol.java
@@ -20,7 +20,7 @@ import org.eclipse.net4j.util.factory.ProductCreationException;
* @author Eike Stepper
* @since 2.0
*/
-public class EchoServerProtocol extends SignalProtocol implements EchoProtocol
+public class EchoServerProtocol extends SignalProtocol<Object> implements EchoProtocol
{
public EchoServerProtocol()
{
diff --git a/plugins/org.eclipse.net4j.http.common/src/org/eclipse/net4j/http/internal/common/HTTPConnector.java b/plugins/org.eclipse.net4j.http.common/src/org/eclipse/net4j/http/internal/common/HTTPConnector.java
index 54f523c8a2..2e69be1291 100644
--- a/plugins/org.eclipse.net4j.http.common/src/org/eclipse/net4j/http/internal/common/HTTPConnector.java
+++ b/plugins/org.eclipse.net4j.http.common/src/org/eclipse/net4j/http/internal/common/HTTPConnector.java
@@ -188,7 +188,7 @@ public abstract class HTTPConnector extends Connector implements IHTTPConnector
}
@Override
- protected void registerChannelWithPeer(short channelIndex, long timeout, IProtocol protocol)
+ protected void registerChannelWithPeer(short channelIndex, long timeout, IProtocol<?> protocol)
throws ConnectorException
{
ChannelOperation operation = new OpenChannelOperation(channelIndex, protocol.getType());
diff --git a/plugins/org.eclipse.net4j.http.server/src/org/eclipse/net4j/http/internal/server/HTTPServerConnector.java b/plugins/org.eclipse.net4j.http.server/src/org/eclipse/net4j/http/internal/server/HTTPServerConnector.java
index 1d36ea3252..d88028108d 100644
--- a/plugins/org.eclipse.net4j.http.server/src/org/eclipse/net4j/http/internal/server/HTTPServerConnector.java
+++ b/plugins/org.eclipse.net4j.http.server/src/org/eclipse/net4j/http/internal/server/HTTPServerConnector.java
@@ -67,7 +67,7 @@ public class HTTPServerConnector extends HTTPConnector
}
@Override
- protected void registerChannelWithPeer(short channelIndex, long timeout, IProtocol protocol)
+ protected void registerChannelWithPeer(short channelIndex, long timeout, IProtocol<?> protocol)
throws ConnectorException
{
throw new UnsupportedOperationException();
diff --git a/plugins/org.eclipse.net4j.http.server/src/org/eclipse/net4j/http/internal/server/Net4jTransportServlet.java b/plugins/org.eclipse.net4j.http.server/src/org/eclipse/net4j/http/internal/server/Net4jTransportServlet.java
index ffcbfbcf5c..3ed588c979 100644
--- a/plugins/org.eclipse.net4j.http.server/src/org/eclipse/net4j/http/internal/server/Net4jTransportServlet.java
+++ b/plugins/org.eclipse.net4j.http.server/src/org/eclipse/net4j/http/internal/server/Net4jTransportServlet.java
@@ -154,7 +154,7 @@ public class Net4jTransportServlet extends HttpServlet implements INet4jTranspor
IBufferHandler receiveHandler = channel.getReceiveHandler();
if (receiveHandler instanceof IProtocol)
{
- writer.write(((IProtocol)receiveHandler).getType());
+ writer.write(((IProtocol<?>)receiveHandler).getType());
}
else
{
diff --git a/plugins/org.eclipse.net4j.jms.admin/src/org/eclipse/net4j/jms/internal/admin/protocol/JMSAdminProtocol.java b/plugins/org.eclipse.net4j.jms.admin/src/org/eclipse/net4j/jms/internal/admin/protocol/JMSAdminProtocol.java
index acbe4a3572..294f6827f0 100644
--- a/plugins/org.eclipse.net4j.jms.admin/src/org/eclipse/net4j/jms/internal/admin/protocol/JMSAdminProtocol.java
+++ b/plugins/org.eclipse.net4j.jms.admin/src/org/eclipse/net4j/jms/internal/admin/protocol/JMSAdminProtocol.java
@@ -18,7 +18,7 @@ import org.eclipse.net4j.signal.SignalReactor;
/**
* @author Eike Stepper
*/
-public class JMSAdminProtocol extends SignalProtocol
+public class JMSAdminProtocol extends SignalProtocol<Object>
{
public JMSAdminProtocol(IConnector connector)
{
diff --git a/plugins/org.eclipse.net4j.jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/JMSServerProtocol.java b/plugins/org.eclipse.net4j.jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/JMSServerProtocol.java
index 598df79ac9..529ca03d03 100644
--- a/plugins/org.eclipse.net4j.jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/JMSServerProtocol.java
+++ b/plugins/org.eclipse.net4j.jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/JMSServerProtocol.java
@@ -11,13 +11,14 @@
package org.eclipse.net4j.jms.internal.server.protocol;
import org.eclipse.net4j.jms.JMSProtocolConstants;
+import org.eclipse.net4j.jms.internal.server.ServerConnection;
import org.eclipse.net4j.signal.SignalProtocol;
import org.eclipse.net4j.signal.SignalReactor;
/**
* @author Eike Stepper
*/
-public class JMSServerProtocol extends SignalProtocol
+public class JMSServerProtocol extends SignalProtocol<ServerConnection>
{
public JMSServerProtocol()
{
diff --git a/plugins/org.eclipse.net4j.jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/admin/JMSAdminServerProtocol.java b/plugins/org.eclipse.net4j.jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/admin/JMSAdminServerProtocol.java
index b98d093ea1..3977d972d5 100644
--- a/plugins/org.eclipse.net4j.jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/admin/JMSAdminServerProtocol.java
+++ b/plugins/org.eclipse.net4j.jms.server/src/org/eclipse/net4j/jms/internal/server/protocol/admin/JMSAdminServerProtocol.java
@@ -18,7 +18,7 @@ import org.eclipse.net4j.signal.SignalReactor;
/**
* @author Eike Stepper
*/
-public class JMSAdminServerProtocol extends SignalProtocol
+public class JMSAdminServerProtocol extends SignalProtocol<Object>
{
public JMSAdminServerProtocol()
{
diff --git a/plugins/org.eclipse.net4j.jms.server/src/org/eclipse/net4j/jms/server/IServerConsumer.java b/plugins/org.eclipse.net4j.jms.server/src/org/eclipse/net4j/jms/server/IServerConsumer.java
index ea249d0cc8..c51ed74ff0 100644
--- a/plugins/org.eclipse.net4j.jms.server/src/org/eclipse/net4j/jms/server/IServerConsumer.java
+++ b/plugins/org.eclipse.net4j.jms.server/src/org/eclipse/net4j/jms/server/IServerConsumer.java
@@ -26,7 +26,7 @@ public interface IServerConsumer
public ISession getSession();
- public IProtocol getProtocol();
+ public IProtocol<?> getProtocol();
public boolean isNoLocal();
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSClientProtocol.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSClientProtocol.java
index c26889e9e7..5ae5c5e8b8 100644
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSClientProtocol.java
+++ b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSClientProtocol.java
@@ -18,7 +18,7 @@ import org.eclipse.net4j.signal.SignalReactor;
/**
* @author Eike Stepper
*/
-public class JMSClientProtocol extends SignalProtocol
+public class JMSClientProtocol extends SignalProtocol<ConnectionImpl>
{
/**
* @since 2.0
diff --git a/plugins/org.eclipse.net4j.jvm/src/org/eclipse/net4j/internal/jvm/JVMConnector.java b/plugins/org.eclipse.net4j.jvm/src/org/eclipse/net4j/internal/jvm/JVMConnector.java
index 92392a41f7..172033fad5 100644
--- a/plugins/org.eclipse.net4j.jvm/src/org/eclipse/net4j/internal/jvm/JVMConnector.java
+++ b/plugins/org.eclipse.net4j.jvm/src/org/eclipse/net4j/internal/jvm/JVMConnector.java
@@ -88,7 +88,7 @@ public abstract class JVMConnector extends Connector implements IJVMConnector
throw new IllegalStateException("peerChannel == null"); //$NON-NLS-1$
}
- Queue<IBuffer> localQueue = ((InternalChannel)localChannel).getSendQueue();
+ Queue<IBuffer> localQueue = (localChannel).getSendQueue();
IBuffer buffer = localQueue.poll();
if (TRACER.isEnabled())
{
@@ -106,7 +106,7 @@ public abstract class JVMConnector extends Connector implements IJVMConnector
}
@Override
- protected void registerChannelWithPeer(short channelIndex, long timeoutIgnored, IProtocol protocol)
+ protected void registerChannelWithPeer(short channelIndex, long timeoutIgnored, IProtocol<?> protocol)
throws ConnectorException
{
try
diff --git a/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/ControlChannel.java b/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/ControlChannel.java
index b842f73a8b..d254342565 100644
--- a/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/ControlChannel.java
+++ b/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/ControlChannel.java
@@ -69,7 +69,7 @@ public class ControlChannel extends Channel
return (TCPConnector)getMultiplexer();
}
- public boolean registerChannel(short channelIndex, long timeout, IProtocol protocol)
+ public boolean registerChannel(short channelIndex, long timeout, IProtocol<?> protocol)
{
if (TRACER.isEnabled())
{
diff --git a/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/TCPConnector.java b/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/TCPConnector.java
index 997853eb8d..873b3cfce9 100644
--- a/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/TCPConnector.java
+++ b/plugins/org.eclipse.net4j.tcp/src/org/eclipse/net4j/internal/tcp/TCPConnector.java
@@ -220,7 +220,7 @@ public abstract class TCPConnector extends Connector implements ITCPConnector, I
try
{
- writeQueue.put((InternalChannel)channel);
+ writeQueue.put(channel);
}
catch (InterruptedException ex)
{
@@ -282,7 +282,7 @@ public abstract class TCPConnector extends Connector implements ITCPConnector, I
}
@Override
- protected void registerChannelWithPeer(short channelIndex, long timeout, IProtocol protocol)
+ protected void registerChannelWithPeer(short channelIndex, long timeout, IProtocol<?> protocol)
throws ConnectorException
{
try
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TestProtocol.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TestProtocol.java
index eb2976d63e..49d3ac5891 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TestProtocol.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TestProtocol.java
@@ -19,7 +19,7 @@ import java.util.concurrent.CountDownLatch;
/**
* @author Eike Stepper
*/
-public final class TestProtocol extends Protocol
+public final class TestProtocol extends Protocol<CountDownLatch>
{
public TestProtocol(CountDownLatch counter)
{
@@ -35,9 +35,6 @@ public final class TestProtocol extends Protocol
{
IOUtil.OUT().println("BUFFER ARRIVED");
buffer.release();
- if (getInfraStructure() instanceof CountDownLatch)
- {
- ((CountDownLatch)getInfraStructure()).countDown();
- }
+ getInfraStructure().countDown();
}
}
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 adfb813013..1ba39cfaa8 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
@@ -19,7 +19,7 @@ import org.eclipse.net4j.util.factory.ProductCreationException;
/**
* @author Eike Stepper
*/
-public class TestSignalProtocol extends SignalProtocol
+public class TestSignalProtocol extends SignalProtocol<Object>
{
public static final String PROTOCOL_NAME = "signal.protocol";
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/connector/Connector.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/connector/Connector.java
index 2602310faa..ef929e6122 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/connector/Connector.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/connector/Connector.java
@@ -364,12 +364,12 @@ public abstract class Connector extends Container<IChannel> implements InternalC
public InternalChannel openChannel() throws ConnectorException
{
- return openChannel((IProtocol)null);
+ return openChannel((IProtocol<?>)null);
}
public InternalChannel openChannel(String protocolID, Object infraStructure) throws ConnectorException
{
- IProtocol protocol = createProtocol(protocolID, infraStructure);
+ IProtocol<?> protocol = createProtocol(protocolID, infraStructure);
if (protocol == null)
{
throw new IllegalArgumentException("Unknown protocolID: " + protocolID);
@@ -378,7 +378,7 @@ public abstract class Connector extends Container<IChannel> implements InternalC
return openChannel(protocol);
}
- public InternalChannel openChannel(IProtocol protocol) throws ConnectorException
+ public InternalChannel openChannel(IProtocol<?> protocol) throws ConnectorException
{
long openChannelTimeout = getChannelTimeout();
long start = System.currentTimeMillis();
@@ -418,7 +418,7 @@ public abstract class Connector extends Container<IChannel> implements InternalC
public InternalChannel inverseOpenChannel(short channelIndex, String protocolID)
{
- IProtocol protocol = createProtocol(protocolID, null);
+ IProtocol<?> protocol = createProtocol(protocolID, null);
InternalChannel channel = createChannel();
initChannel(channel, protocol);
@@ -446,7 +446,7 @@ public abstract class Connector extends Container<IChannel> implements InternalC
return new Channel();
}
- private void initChannel(InternalChannel channel, IProtocol protocol)
+ private void initChannel(InternalChannel channel, IProtocol<?> protocol)
{
channel.setMultiplexer(this);
channel.setReceiveExecutor(getConfig().getReceiveExecutor());
@@ -643,7 +643,8 @@ public abstract class Connector extends Container<IChannel> implements InternalC
this.negotiationException = negotiationException;
}
- protected IProtocol createProtocol(String type, Object infraStructure)
+ @SuppressWarnings("unchecked")
+ protected <INFRA_STRUCTURE> IProtocol<INFRA_STRUCTURE> createProtocol(String type, INFRA_STRUCTURE infraStructure)
{
if (StringUtil.isEmpty(type))
{
@@ -656,7 +657,7 @@ public abstract class Connector extends Container<IChannel> implements InternalC
throw new ConnectorException("No protocol provider configured");
}
- IProtocol protocol = protocolProvider.getProtocol(type);
+ IProtocol<INFRA_STRUCTURE> protocol = (IProtocol<INFRA_STRUCTURE>)protocolProvider.getProtocol(type);
if (protocol == null)
{
throw new ConnectorException("Invalid protocol factory: " + type);
@@ -729,7 +730,7 @@ public abstract class Connector extends Container<IChannel> implements InternalC
super.doDeactivate();
}
- protected abstract void registerChannelWithPeer(short channelIndex, long timeout, IProtocol protocol)
+ protected abstract void registerChannelWithPeer(short channelIndex, long timeout, IProtocol<?> protocol)
throws ConnectorException;
protected abstract void deregisterChannelFromPeer(InternalChannel channel, long timeout) throws ConnectorException;
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/ContainerProtocolProvider.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/ContainerProtocolProvider.java
index 396a5a12b7..c5c855d7a6 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/ContainerProtocolProvider.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/ContainerProtocolProvider.java
@@ -45,9 +45,9 @@ public abstract class ContainerProtocolProvider implements IProtocolProvider
return productGroup;
}
- public IProtocol getProtocol(String type)
+ public IProtocol<?> getProtocol(String type)
{
- return (IProtocol)container.getElement(productGroup, type, "protocol-" + counter.increment(), false);
+ return (IProtocol<?>)container.getElement(productGroup, type, "protocol-" + counter.increment(), false);
}
/**
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/FactoriesProtocolProvider.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/FactoriesProtocolProvider.java
index 320f53b49d..fa2cb210ba 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/FactoriesProtocolProvider.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/FactoriesProtocolProvider.java
@@ -58,12 +58,12 @@ public class FactoriesProtocolProvider implements IProtocolProvider
getRegistry().put(factory.getKey().getType(), factory);
}
- public IProtocol getProtocol(String type)
+ public IProtocol<?> getProtocol(String type)
{
IFactory factory = registry.get(type);
if (factory != null)
{
- return (IProtocol)factory.create(null);
+ return (IProtocol<?>)factory.create(null);
}
return null;
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/channel/IChannelMultiplexer.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/channel/IChannelMultiplexer.java
index 62a7944b2d..ba4f9750c0 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/channel/IChannelMultiplexer.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/channel/IChannelMultiplexer.java
@@ -85,7 +85,7 @@ public interface IChannelMultiplexer extends ILocationAware, IContainer<IChannel
* @see #openChannel(String, Object)
* @since 2.0
*/
- public IChannel openChannel(IProtocol protocol) throws ConnectorException;
+ public IChannel openChannel(IProtocol<?> protocol) throws ConnectorException;
/**
* @since 2.0
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/protocol/IProtocol.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/protocol/IProtocol.java
index 67d44a985b..fa8bf2eca3 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/protocol/IProtocol.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/protocol/IProtocol.java
@@ -20,7 +20,7 @@ import java.util.concurrent.ExecutorService;
/**
* @author Eike Stepper
*/
-public interface IProtocol extends ILocationAware, IBufferHandler
+public interface IProtocol<INFRA_STRUCTURE> extends ILocationAware, IBufferHandler
{
public String getType();
@@ -28,9 +28,9 @@ public interface IProtocol extends ILocationAware, IBufferHandler
public void setChannel(IChannel channel);
- public Object getInfraStructure();
+ public INFRA_STRUCTURE getInfraStructure();
- public void setInfraStructure(Object infraStructure);
+ public void setInfraStructure(INFRA_STRUCTURE infraStructure);
public IBufferProvider getBufferProvider();
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/protocol/IProtocolProvider.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/protocol/IProtocolProvider.java
index 12dc51fc53..bec959484e 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/protocol/IProtocolProvider.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/protocol/IProtocolProvider.java
@@ -18,5 +18,5 @@ public interface IProtocolProvider
/**
* @since 2.0
*/
- public IProtocol getProtocol(String type);
+ public IProtocol<?> getProtocol(String type);
}
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/protocol/Protocol.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/protocol/Protocol.java
index 5ad22f4feb..69a8607a2a 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/protocol/Protocol.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/protocol/Protocol.java
@@ -19,7 +19,7 @@ import java.util.concurrent.ExecutorService;
/**
* @author Eike Stepper
*/
-public abstract class Protocol extends Lifecycle implements IProtocol
+public abstract class Protocol<INFRA_STRUCTURE> extends Lifecycle implements IProtocol<INFRA_STRUCTURE>
{
private IChannel channel;
@@ -27,7 +27,7 @@ public abstract class Protocol extends Lifecycle implements IProtocol
private ExecutorService executorService;
- private Object infraStructure;
+ private INFRA_STRUCTURE infraStructure;
public Protocol()
{
@@ -87,12 +87,12 @@ public abstract class Protocol extends Lifecycle implements IProtocol
this.executorService = executorService;
}
- public Object getInfraStructure()
+ public INFRA_STRUCTURE getInfraStructure()
{
return infraStructure;
}
- public void setInfraStructure(Object infraStructure)
+ public void setInfraStructure(INFRA_STRUCTURE infraStructure)
{
this.infraStructure = infraStructure;
}
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/ExceptionMessageRequest.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/ExceptionMessageRequest.java
index d55ad513d5..323e18c426 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/ExceptionMessageRequest.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/ExceptionMessageRequest.java
@@ -23,7 +23,7 @@ class ExceptionMessageRequest extends Request
private String message;
- public ExceptionMessageRequest(SignalProtocol protocol, int correlationID, String message)
+ public ExceptionMessageRequest(SignalProtocol<?> protocol, int correlationID, String message)
{
super(protocol);
this.correlationID = correlationID;
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 16f98d8034..2f04636d4f 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
@@ -75,7 +75,7 @@ public abstract class Indication extends SignalReactor
void sendExceptionMessage(Exception ex) throws Exception
{
- SignalProtocol protocol = getProtocol();
+ SignalProtocol<?> protocol = getProtocol();
int correlationID = -getCorrelationID();
String message = getMessage(ex);
new ExceptionMessageRequest(protocol, correlationID, message).send();
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 4dad1fa856..7764e1f7df 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
@@ -31,7 +31,7 @@ public abstract class Request extends SignalActor
/**
* @since 2.0
*/
- protected Request(SignalProtocol protocol)
+ protected Request(SignalProtocol<?> protocol)
{
super(protocol);
}
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 a52a340182..026e0c001b 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
@@ -31,7 +31,7 @@ public abstract class RequestWithConfirmation<RESULT> extends Request
/**
* @since 2.0
*/
- protected RequestWithConfirmation(SignalProtocol protocol)
+ protected RequestWithConfirmation(SignalProtocol<?> protocol)
{
super(protocol);
}
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 0dc633c903..3c61c5fa14 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
@@ -30,7 +30,7 @@ public abstract class Signal implements Runnable
{
private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG_SIGNAL, Signal.class);
- private SignalProtocol protocol;
+ private SignalProtocol<?> protocol;
private int correlationID;
@@ -44,7 +44,7 @@ public abstract class Signal implements Runnable
{
}
- public SignalProtocol getProtocol()
+ public SignalProtocol<?> getProtocol()
{
return protocol;
}
@@ -214,7 +214,7 @@ public abstract class Signal implements Runnable
protected abstract void execute(BufferInputStream in, BufferOutputStream out) throws Exception;
- void setProtocol(SignalProtocol protocol)
+ void setProtocol(SignalProtocol<?> protocol)
{
this.protocol = protocol;
}
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 192374caed..a2d3a9a4fc 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
@@ -29,7 +29,7 @@ public abstract class SignalActor extends Signal
/**
* @since 2.0
*/
- protected SignalActor(SignalProtocol protocol)
+ protected SignalActor(SignalProtocol<?> protocol)
{
setProtocol(protocol);
setCorrelationID(protocol.getNextCorrelationID());
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 0adf584401..4bc826c839 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
@@ -36,7 +36,7 @@ import java.util.concurrent.ConcurrentHashMap;
/**
* @author Eike Stepper
*/
-public abstract class SignalProtocol extends Protocol
+public abstract class SignalProtocol<INFRA_STRUCTURE> extends Protocol<INFRA_STRUCTURE>
{
public static final long NO_TIMEOUT = BufferInputStream.NO_TIMEOUT;
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/failover/FailOverStrategy.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/failover/FailOverStrategy.java
index 033adab410..9774c06e3d 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/failover/FailOverStrategy.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/failover/FailOverStrategy.java
@@ -42,7 +42,7 @@ public abstract class FailOverStrategy extends AbstractFailOverStrategy
}
}
- protected void failOver(SignalProtocol protocol)
+ protected void failOver(SignalProtocol<?> protocol)
{
IChannel oldChannel = protocol.getChannel();
IConnector newConnector = getNewConnector(oldChannel);
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/wrapping/StreamWrapperInjector.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/wrapping/StreamWrapperInjector.java
index a696492fb2..858362132a 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/wrapping/StreamWrapperInjector.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/wrapping/StreamWrapperInjector.java
@@ -46,7 +46,7 @@ public class StreamWrapperInjector implements IElementProcessor
{
if (element instanceof SignalProtocol)
{
- SignalProtocol signalProtocol = (SignalProtocol)element;
+ SignalProtocol<?> signalProtocol = (SignalProtocol<?>)element;
if (shouldInject(container, productGroup, factoryType, description, signalProtocol))
{
element = inject(container, productGroup, factoryType, description, signalProtocol);
@@ -57,7 +57,7 @@ public class StreamWrapperInjector implements IElementProcessor
}
protected boolean shouldInject(IManagedContainer container, String productGroup, String factoryType,
- String description, SignalProtocol signalProtocol)
+ String description, SignalProtocol<?> signalProtocol)
{
if (signalProtocol.getStreamWrapper() == streamWrapper)
{
@@ -68,7 +68,7 @@ public class StreamWrapperInjector implements IElementProcessor
}
protected Object inject(IManagedContainer container, String productGroup, String factoryType, String description,
- SignalProtocol signalProtocol)
+ SignalProtocol<?> signalProtocol)
{
signalProtocol.addStreamWrapper(streamWrapper);
return signalProtocol;

Back to the top