Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-11-01 11:23:00 +0000
committerEike Stepper2008-11-01 11:23:00 +0000
commit1bd480f81f09442906779ec673d77ef27d883a95 (patch)
tree1fa4775624fb65b31e44633b1b0372e0f975eca4 /plugins/org.eclipse.net4j.jms
parentf24d82af2542d10c9eab5ace82b7177fed1917c2 (diff)
downloadcdo-1bd480f81f09442906779ec673d77ef27d883a95.tar.gz
cdo-1bd480f81f09442906779ec673d77ef27d883a95.tar.xz
cdo-1bd480f81f09442906779ec673d77ef27d883a95.zip
[253054] [POLISH] Pass protocol and signalID in Signal constructor
https://bugs.eclipse.org/bugs/show_bug.cgi?id=253054
Diffstat (limited to 'plugins/org.eclipse.net4j.jms')
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSAcknowledgeRequest.java8
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSClientMessageRequest.java8
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSClientProtocol.java2
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSCloseSessionRequest.java8
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSCommitRequest.java8
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSDeregisterConsumerRequest.java8
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSLogoffRequest.java8
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSLogonRequest.java8
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSOpenSessionRequest.java8
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSRecoverRequest.java8
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSRegisterConsumerRequest.java8
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSRollbackRequest.java8
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSServerMessageIndication.java14
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSSyncRequest.java8
14 files changed, 19 insertions, 93 deletions
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSAcknowledgeRequest.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSAcknowledgeRequest.java
index 5ea6fd1a02..a0bb721ea9 100644
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSAcknowledgeRequest.java
+++ b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSAcknowledgeRequest.java
@@ -28,17 +28,11 @@ public class JMSAcknowledgeRequest extends Request
*/
public JMSAcknowledgeRequest(JMSClientProtocol protocol, int sessionID)
{
- super(protocol);
+ super(protocol, JMSProtocolConstants.SIGNAL_ACKNOWLEDGE);
this.sessionID = sessionID;
}
@Override
- protected short getSignalID()
- {
- return JMSProtocolConstants.SIGNAL_ACKNOWLEDGE;
- }
-
- @Override
protected void requesting(ExtendedDataOutputStream out) throws IOException
{
out.writeInt(sessionID);
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSClientMessageRequest.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSClientMessageRequest.java
index 0001f61383..2696ceb83b 100644
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSClientMessageRequest.java
+++ b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSClientMessageRequest.java
@@ -31,17 +31,11 @@ public class JMSClientMessageRequest extends RequestWithConfirmation<String>
*/
public JMSClientMessageRequest(JMSClientProtocol protocol, MessageImpl message)
{
- super(protocol);
+ super(protocol, JMSProtocolConstants.SIGNAL_CLIENT_MESSAGE);
this.message = message;
}
@Override
- protected short getSignalID()
- {
- return JMSProtocolConstants.SIGNAL_CLIENT_MESSAGE;
- }
-
- @Override
protected void requesting(ExtendedDataOutputStream out) throws IOException
{
MessageUtil.write(out, message);
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 5ae5c5e8b8..e311349c2b 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
@@ -39,7 +39,7 @@ public class JMSClientProtocol extends SignalProtocol<ConnectionImpl>
switch (signalID)
{
case JMSProtocolConstants.SIGNAL_SERVER_MESSAGE:
- return new JMSServerMessageIndication();
+ return new JMSServerMessageIndication(this);
default:
return null;
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSCloseSessionRequest.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSCloseSessionRequest.java
index 8d9cb1e622..4d3001245e 100644
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSCloseSessionRequest.java
+++ b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSCloseSessionRequest.java
@@ -29,17 +29,11 @@ public class JMSCloseSessionRequest extends RequestWithConfirmation<Boolean>
*/
public JMSCloseSessionRequest(JMSClientProtocol protocol, int sessionID)
{
- super(protocol);
+ super(protocol, JMSProtocolConstants.SIGNAL_CLOSE_SESSION);
this.sessionID = sessionID;
}
@Override
- protected short getSignalID()
- {
- return JMSProtocolConstants.SIGNAL_CLOSE_SESSION;
- }
-
- @Override
protected void requesting(ExtendedDataOutputStream out) throws IOException
{
out.writeInt(sessionID);
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSCommitRequest.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSCommitRequest.java
index 236bbd4469..d0c41b8a47 100644
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSCommitRequest.java
+++ b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSCommitRequest.java
@@ -34,18 +34,12 @@ public class JMSCommitRequest extends RequestWithConfirmation<String[]>
*/
public JMSCommitRequest(JMSClientProtocol protocol, int sessionID, List<MessageImpl> messages)
{
- super(protocol);
+ super(protocol, JMSProtocolConstants.SIGNAL_COMMIT);
this.sessionID = sessionID;
this.messages = messages;
}
@Override
- protected short getSignalID()
- {
- return JMSProtocolConstants.SIGNAL_COMMIT;
- }
-
- @Override
protected void requesting(ExtendedDataOutputStream out) throws IOException
{
out.writeInt(sessionID);
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSDeregisterConsumerRequest.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSDeregisterConsumerRequest.java
index 80c110c4fa..0684b62ff4 100644
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSDeregisterConsumerRequest.java
+++ b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSDeregisterConsumerRequest.java
@@ -31,18 +31,12 @@ public class JMSDeregisterConsumerRequest extends RequestWithConfirmation<Boolea
*/
public JMSDeregisterConsumerRequest(JMSClientProtocol protocol, int sessionID, long consumerID)
{
- super(protocol);
+ super(protocol, JMSProtocolConstants.SIGNAL_DEREGISTER_CONSUMER);
this.sessionID = sessionID;
this.consumerID = consumerID;
}
@Override
- protected short getSignalID()
- {
- return JMSProtocolConstants.SIGNAL_DEREGISTER_CONSUMER;
- }
-
- @Override
protected void requesting(ExtendedDataOutputStream out) throws IOException
{
out.writeInt(sessionID);
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSLogoffRequest.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSLogoffRequest.java
index 06e2cf637c..bd4079f7f9 100644
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSLogoffRequest.java
+++ b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSLogoffRequest.java
@@ -26,13 +26,7 @@ public class JMSLogoffRequest extends Request
*/
public JMSLogoffRequest(JMSClientProtocol protocol)
{
- super(protocol);
- }
-
- @Override
- protected short getSignalID()
- {
- return JMSProtocolConstants.SIGNAL_LOGOFF;
+ super(protocol, JMSProtocolConstants.SIGNAL_LOGOFF);
}
@Override
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSLogonRequest.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSLogonRequest.java
index a977d52634..25e34ee40e 100644
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSLogonRequest.java
+++ b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSLogonRequest.java
@@ -31,18 +31,12 @@ public class JMSLogonRequest extends RequestWithConfirmation<Boolean>
*/
public JMSLogonRequest(JMSClientProtocol protocol, String userName, String password)
{
- super(protocol);
+ super(protocol, JMSProtocolConstants.SIGNAL_LOGON);
this.userName = userName;
this.password = password;
}
@Override
- protected short getSignalID()
- {
- return JMSProtocolConstants.SIGNAL_LOGON;
- }
-
- @Override
protected void requesting(ExtendedDataOutputStream out) throws IOException
{
out.writeString(userName);
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSOpenSessionRequest.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSOpenSessionRequest.java
index a0744b0305..31dfb30433 100644
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSOpenSessionRequest.java
+++ b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSOpenSessionRequest.java
@@ -29,17 +29,11 @@ public class JMSOpenSessionRequest extends RequestWithConfirmation<Boolean>
*/
public JMSOpenSessionRequest(JMSClientProtocol protocol, int sessionID)
{
- super(protocol);
+ super(protocol, JMSProtocolConstants.SIGNAL_OPEN_SESSION);
this.sessionID = sessionID;
}
@Override
- protected short getSignalID()
- {
- return JMSProtocolConstants.SIGNAL_OPEN_SESSION;
- }
-
- @Override
protected void requesting(ExtendedDataOutputStream out) throws IOException
{
out.writeInt(sessionID);
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSRecoverRequest.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSRecoverRequest.java
index eeed2f8d0a..5d02aae7fe 100644
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSRecoverRequest.java
+++ b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSRecoverRequest.java
@@ -29,17 +29,11 @@ public class JMSRecoverRequest extends RequestWithConfirmation<Object>
*/
public JMSRecoverRequest(JMSClientProtocol protocol, int sessionID)
{
- super(protocol);
+ super(protocol, JMSProtocolConstants.SIGNAL_RECOVER);
this.sessionID = sessionID;
}
@Override
- protected short getSignalID()
- {
- return JMSProtocolConstants.SIGNAL_RECOVER;
- }
-
- @Override
protected void requesting(ExtendedDataOutputStream out) throws IOException
{
out.writeInt(sessionID);
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSRegisterConsumerRequest.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSRegisterConsumerRequest.java
index 5bfe659c79..7e37a6a58e 100644
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSRegisterConsumerRequest.java
+++ b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSRegisterConsumerRequest.java
@@ -40,7 +40,7 @@ public class JMSRegisterConsumerRequest extends RequestWithConfirmation<Long>
public JMSRegisterConsumerRequest(JMSClientProtocol protocol, int sessionID, DestinationImpl destination,
String messageSelector, boolean noLocal, boolean durable)
{
- super(protocol);
+ super(protocol, JMSProtocolConstants.SIGNAL_REGISTER_CONSUMER);
this.sessionID = sessionID;
this.destination = destination;
this.messageSelector = messageSelector;
@@ -49,12 +49,6 @@ public class JMSRegisterConsumerRequest extends RequestWithConfirmation<Long>
}
@Override
- protected short getSignalID()
- {
- return JMSProtocolConstants.SIGNAL_REGISTER_CONSUMER;
- }
-
- @Override
protected void requesting(ExtendedDataOutputStream out) throws IOException
{
out.writeInt(sessionID);
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSRollbackRequest.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSRollbackRequest.java
index f182314f02..a66cb66de8 100644
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSRollbackRequest.java
+++ b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSRollbackRequest.java
@@ -29,17 +29,11 @@ public class JMSRollbackRequest extends RequestWithConfirmation<Boolean>
*/
public JMSRollbackRequest(JMSClientProtocol protocol, int sessionID)
{
- super(protocol);
+ super(protocol, JMSProtocolConstants.SIGNAL_ROLLBACK);
this.sessionID = sessionID;
}
@Override
- protected short getSignalID()
- {
- return JMSProtocolConstants.SIGNAL_ROLLBACK;
- }
-
- @Override
protected void requesting(ExtendedDataOutputStream out) throws IOException
{
out.writeInt(sessionID);
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSServerMessageIndication.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSServerMessageIndication.java
index fed8f93f9e..a7120cd938 100644
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSServerMessageIndication.java
+++ b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSServerMessageIndication.java
@@ -24,14 +24,12 @@ import java.io.IOException;
*/
public class JMSServerMessageIndication extends Indication
{
- public JMSServerMessageIndication()
+ /**
+ * @since 2.0
+ */
+ public JMSServerMessageIndication(JMSClientProtocol protocol)
{
- }
-
- @Override
- protected short getSignalID()
- {
- return JMSProtocolConstants.SIGNAL_SERVER_MESSAGE;
+ super(protocol, JMSProtocolConstants.SIGNAL_SERVER_MESSAGE);
}
@Override
@@ -41,7 +39,7 @@ public class JMSServerMessageIndication extends Indication
long consumerID = in.readLong();
MessageImpl message = MessageUtil.read(in);
JMSClientProtocol protocol = (JMSClientProtocol)getProtocol();
- ConnectionImpl connection = (ConnectionImpl)protocol.getInfraStructure();
+ ConnectionImpl connection = protocol.getInfraStructure();
connection.handleMessageFromSignal(sessionID, consumerID, message);
}
}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSSyncRequest.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSSyncRequest.java
index f57b9ebf44..b7abea36fe 100644
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSSyncRequest.java
+++ b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSSyncRequest.java
@@ -29,13 +29,7 @@ public class JMSSyncRequest extends RequestWithConfirmation<Long>
*/
public JMSSyncRequest(JMSClientProtocol protocol)
{
- super(protocol);
- }
-
- @Override
- protected short getSignalID()
- {
- return JMSProtocolConstants.SIGNAL_SYNC;
+ super(protocol, JMSProtocolConstants.SIGNAL_SYNC);
}
@Override

Back to the top