[jboss-cvs] JBoss Messaging SVN: r3379 - branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/delegate.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Nov 28 08:40:50 EST 2007
Author: jmesnil
Date: 2007-11-28 08:40:50 -0500 (Wed, 28 Nov 2007)
New Revision: 3379
Modified:
branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/delegate/ClientBrowserDelegate.java
branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/delegate/ClientConnectionDelegate.java
branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/delegate/ClientConnectionFactoryDelegate.java
branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/delegate/ClientConsumerDelegate.java
branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/delegate/ClientSessionDelegate.java
branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/delegate/DelegateSupport.java
Log:
http://jira.jboss.org/jira/browse/JBMESSAGING-544: Replace client-server transport with NIO based transport
* get rid of JBR's client attribute in DelegateSupport and its subclasses
Modified: branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/delegate/ClientBrowserDelegate.java
===================================================================
--- branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/delegate/ClientBrowserDelegate.java 2007-11-28 13:28:22 UTC (rev 3378)
+++ branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/delegate/ClientBrowserDelegate.java 2007-11-28 13:40:50 UTC (rev 3379)
@@ -85,9 +85,6 @@
state.synchronizeWith(newDelegate.getState());
- client = ((ConnectionState)state.getParent().getParent()).getRemotingConnection().
- getRemotingClient();
-
newClient = ((ConnectionState)state.getParent().getParent()).getRemotingConnection().
getNewRemotingClient();
}
@@ -96,9 +93,6 @@
{
super.setState(state);
- client = ((ConnectionState)state.getParent().getParent()).getRemotingConnection().
- getRemotingClient();
-
newClient = ((ConnectionState)state.getParent().getParent()).getRemotingConnection().
getNewRemotingClient();
}
Modified: branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/delegate/ClientConnectionDelegate.java
===================================================================
--- branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/delegate/ClientConnectionDelegate.java 2007-11-28 13:28:22 UTC (rev 3378)
+++ branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/delegate/ClientConnectionDelegate.java 2007-11-28 13:40:50 UTC (rev 3379)
@@ -137,8 +137,6 @@
// There is one RM per server, so we need to merge the rms if necessary
ResourceManagerFactory.instance.handleFailover(serverID, newDelegate.getServerID());
- client = thisState.getRemotingConnection().getRemotingClient();
-
newClient = thisState.getRemotingConnection().getNewRemotingClient();
serverID = newDelegate.getServerID();
Modified: branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/delegate/ClientConnectionFactoryDelegate.java
===================================================================
--- branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/delegate/ClientConnectionFactoryDelegate.java 2007-11-28 13:28:22 UTC (rev 3378)
+++ branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/delegate/ClientConnectionFactoryDelegate.java 2007-11-28 13:40:50 UTC (rev 3379)
@@ -21,7 +21,6 @@
*/
package org.jboss.jms.client.delegate;
-import static org.jboss.messaging.core.remoting.Constants.PORT;
import static org.jboss.messaging.core.remoting.TransportType.TCP;
import java.io.DataInputStream;
@@ -330,34 +329,6 @@
// Private --------------------------------------------------------------------------------------
- private Client createClient() throws JMSException
- {
- // Create a client - make sure pinging is off
-
- Map configuration = new HashMap();
-
- configuration.put(Client.ENABLE_LEASE, String.valueOf(false));
-
- //We execute this on it's own client
- Client client;
-
- try
- {
- client = new Client(new InvokerLocator(serverLocatorURI), configuration);
- client.setSubsystem(ServerPeer.REMOTING_JMS_SUBSYSTEM);
- client.connect();
- }
- catch (Exception e)
- {
- throw new MessagingNetworkFailureException("Failed to connect client", e);
- }
-
- client.setMarshaller(new JMSWireFormat());
- client.setUnMarshaller(new JMSWireFormat());
-
- return client;
- }
-
private org.jboss.messaging.core.remoting.Client createNewClient() throws JMSException
{
//We execute this on it's own client
Modified: branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/delegate/ClientConsumerDelegate.java
===================================================================
--- branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/delegate/ClientConsumerDelegate.java 2007-11-28 13:28:22 UTC (rev 3378)
+++ branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/delegate/ClientConsumerDelegate.java 2007-11-28 13:40:50 UTC (rev 3379)
@@ -90,9 +90,6 @@
ClientConsumerDelegate newDelegate = (ClientConsumerDelegate)nd;
// The client needs to be set first
- client = ((ConnectionState)state.getParent().getParent()).getRemotingConnection().
- getRemotingClient();
-
newClient = ((ConnectionState)state.getParent().getParent()).getRemotingConnection().
getNewRemotingClient();
@@ -113,9 +110,6 @@
{
super.setState(state);
- client = ((ConnectionState)state.getParent().getParent()).getRemotingConnection().
- getRemotingClient();
-
newClient = ((ConnectionState)state.getParent().getParent()).getRemotingConnection().
getNewRemotingClient();
}
Modified: branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/delegate/ClientSessionDelegate.java
===================================================================
--- branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/delegate/ClientSessionDelegate.java 2007-11-28 13:28:22 UTC (rev 3378)
+++ branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/delegate/ClientSessionDelegate.java 2007-11-28 13:40:50 UTC (rev 3379)
@@ -138,8 +138,6 @@
state.synchronizeWith(newDelegate.getState());
JMSRemotingConnection conn = ((ConnectionState)state.getParent()).getRemotingConnection();
-
- client = conn.getRemotingClient();
newClient = conn.getNewRemotingClient();
@@ -151,8 +149,6 @@
super.setState(state);
JMSRemotingConnection conn = ((ConnectionState)state.getParent()).getRemotingConnection();
-
- client = conn.getRemotingClient();
newClient = conn.getNewRemotingClient();
Modified: branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/delegate/DelegateSupport.java
===================================================================
--- branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/delegate/DelegateSupport.java 2007-11-28 13:28:22 UTC (rev 3378)
+++ branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/delegate/DelegateSupport.java 2007-11-28 13:40:50 UTC (rev 3379)
@@ -34,14 +34,11 @@
import org.jboss.jms.client.state.HierarchicalState;
import org.jboss.jms.exception.MessagingJMSException;
import org.jboss.jms.exception.MessagingNetworkFailureException;
-import org.jboss.jms.wireformat.RequestSupport;
-import org.jboss.jms.wireformat.ResponseSupport;
import org.jboss.logging.Logger;
import org.jboss.messaging.core.remoting.wireformat.AbstractPacket;
import org.jboss.messaging.core.remoting.wireformat.JMSExceptionMessage;
import org.jboss.messaging.util.Streamable;
import org.jboss.remoting.CannotConnectException;
-import org.jboss.remoting.Client;
import org.jboss.remoting.ConnectionFailedException;
/**
@@ -87,8 +84,6 @@
protected transient byte version;
- protected transient Client client;
-
protected transient org.jboss.messaging.core.remoting.Client newClient;
// Static ---------------------------------------------------------------------------------------
@@ -160,19 +155,9 @@
// Protected ------------------------------------------------------------------------------------
- protected Object doInvoke(Client client, RequestSupport req) throws JMSException
- {
- return doInvoke(client, req, false);
- }
-
- protected Object doInvokeOneway(Client client, RequestSupport req) throws JMSException
- {
- return doInvoke(client, req, true);
- }
-
protected void sendOneWay(AbstractPacket packet) throws JMSException
{
- assert client != null;
+ assert newClient != null;
assert packet != null;
packet.setVersion(version);
@@ -211,45 +196,6 @@
}
// Private --------------------------------------------------------------------------------------
-
- private Object doInvoke(Client client, RequestSupport req, boolean oneWay) throws JMSException
- {
- try
- {
- Object resp = null;
-
- if (oneWay)
- {
- if (trace) { log.trace(this + " invoking " + req + " asynchronously on server using " + client); }
-
- client.invokeOneway(req);
-
- if (trace) { log.trace(this + " asynchronously invoked " + req + " on server, no response expected"); }
- }
- else
- {
-
- if (trace) { log.trace(this + " invoking " + req + " synchronously on server using " + client); }
-
- resp = client.invoke(req);
-
- if (trace) { log.trace(this + " got server response for " + req + ": " + resp); }
- }
-
- Object res = null;
-
- if (resp instanceof ResponseSupport)
- {
- res = ((ResponseSupport)resp).getResponse();
- }
-
- return res;
- }
- catch (Throwable t)
- {
- throw handleThrowable(t);
- }
- }
public static JMSException handleThrowable(Throwable t)
{
@@ -315,11 +261,6 @@
return new MessagingJMSException("Failed to invoke", t);
}
-
- public Client getClient()
- {
- return client;
- }
// Inner classes --------------------------------------------------------------------------------
}
More information about the jboss-cvs-commits
mailing list