[jboss-cvs] JBoss Messaging SVN: r3428 - in branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms: client/delegate and 6 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Dec 6 10:36:35 EST 2007
Author: jmesnil
Date: 2007-12-06 10:36:35 -0500 (Thu, 06 Dec 2007)
New Revision: 3428
Modified:
branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/container/ConnectionFailureListener.java
branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/delegate/ClientClusteredConnectionFactoryDelegate.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/DelegateSupport.java
branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/remoting/JMSRemotingConnection.java
branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/ServerPeer.java
branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/connectionfactory/ConnectionFactory.java
branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/connectionmanager/SimpleConnectionManager.java
branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/endpoint/ConnectionFactoryInternalEndpoint.java
branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/endpoint/ServerConnectionEndpoint.java
branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/endpoint/ServerConnectionFactoryEndpoint.java
branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java
branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/endpoint/advised/ConnectionFactoryAdvised.java
Log:
http://jira.jboss.org/jira/browse/JBMESSAGING-544 Replace client-server transport with NIO based transport
* tidying up
* removed unused classes specific to JBoss Remoting
Modified: branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/container/ConnectionFailureListener.java
===================================================================
--- branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/container/ConnectionFailureListener.java 2007-12-06 13:44:14 UTC (rev 3427)
+++ branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/container/ConnectionFailureListener.java 2007-12-06 15:36:35 UTC (rev 3428)
@@ -10,7 +10,6 @@
import org.jboss.jms.client.FailureDetector;
import org.jboss.jms.client.remoting.JMSRemotingConnection;
import org.jboss.logging.Logger;
-import org.jboss.remoting.Client;
/**
* The listener that detects a connection failure and initiates the failover process. Each physical
Modified: branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/delegate/ClientClusteredConnectionFactoryDelegate.java
===================================================================
--- branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/delegate/ClientClusteredConnectionFactoryDelegate.java 2007-12-06 13:44:14 UTC (rev 3427)
+++ branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/delegate/ClientClusteredConnectionFactoryDelegate.java 2007-12-06 15:36:35 UTC (rev 3428)
@@ -100,7 +100,7 @@
if (trace) log.trace("Trying communication on server(" + server + ")=" + delegates[server].getServerLocatorURI());
try
{
- remoting = new JMSRemotingConnection(delegates[server].getServerLocatorURI(), true, delegates[server].getStrictTck());
+ remoting = new JMSRemotingConnection(delegates[server].getServerLocatorURI(), delegates[server].getStrictTck());
remoting.start();
currentDelegate = delegates[server];
if (trace) log.trace("Adding callback");
@@ -325,27 +325,7 @@
public TopologyResult getTopology() throws JMSException
- {
-
-// try
-// {
-// ConnectionFactoryGetTopologyRequest request =
-// new ConnectionFactoryGetTopologyRequest(currentDelegate.getID());
-//
-// ConnectionFactoryGetTopologyResponse response = (ConnectionFactoryGetTopologyResponse)remoting.getRemotingClient().invoke(request, null);
-//
-//
-// TopologyResult topology = (TopologyResult)response.getResponse();
-//
-// updateFailoverInfo(topology.getDelegates(), topology.getFailoverMap());
-//
-// return topology;
-// }
-// catch (Throwable e)
-// {
-// throw handleThrowable(e);
-// }
-
+ {
byte version = Version.instance().getProviderIncrementingVersion();
GetTopologyResponse response = (GetTopologyResponse) sendBlocking(remoting.getRemotingClient(), currentDelegate.getID(), version, new GetTopologyRequest());
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-12-06 13:44:14 UTC (rev 3427)
+++ branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/delegate/ClientConnectionFactoryDelegate.java 2007-12-06 15:36:35 UTC (rev 3428)
@@ -35,6 +35,7 @@
import org.jboss.jms.delegate.CreateConnectionResult;
import org.jboss.jms.delegate.TopologyResult;
import org.jboss.jms.exception.MessagingNetworkFailureException;
+import org.jboss.messaging.core.remoting.Client;
import org.jboss.messaging.core.remoting.wireformat.CreateConnectionRequest;
import org.jboss.messaging.core.remoting.wireformat.CreateConnectionResponse;
import org.jboss.messaging.core.remoting.wireformat.GetClientAOPStackRequest;
@@ -148,7 +149,7 @@
try
{
- remotingConnection = new JMSRemotingConnection(serverLocatorURI, clientPing, strictTck);
+ remotingConnection = new JMSRemotingConnection(serverLocatorURI, strictTck);
remotingConnection.start();
client = remotingConnection.getRemotingClient();
@@ -172,45 +173,6 @@
}
throw handleThrowable(t);
}
-// try
-// {
-// remotingConnection = new JMSRemotingConnection(serverLocatorURI, clientPing, strictTck);
-//
-// remotingConnection.start();
-//
-// Client client = remotingConnection.getRemotingClient();
-//
-// String remotingSessionId = client.getSessionId();
-//
-// String clientVMId = JMSClientVMIdentifier.instance;
-//
-// ConnectionFactoryCreateConnectionDelegateRequest req =
-// new ConnectionFactoryCreateConnectionDelegateRequest(id, v,
-// remotingSessionId, clientVMId,
-// username, password, failedNodeID);
-//
-// ResponseSupport rs = (ResponseSupport)client.invoke(req, null);
-//
-// res = (CreateConnectionResult)rs.getResponse();
-// }
-// catch (Throwable t)
-// {
-// //If we were invoking createConnectionDelegate and failure occurs then we need to clear
-// // up the JMSRemotingConnection
-//
-// if (remotingConnection != null)
-// {
-// try
-// {
-// remotingConnection.stop();
-// }
-// catch (Throwable ignore)
-// {
-// }
-// }
-//
-// throw handleThrowable(t);
-// }
ClientConnectionDelegate connectionDelegate = (ClientConnectionDelegate)res.getDelegate();
@@ -242,25 +204,7 @@
byte v = version.getProviderIncrementingVersion();
-// // Create a client - make sure pinging is off
-//
-// Map configuration = new HashMap();
-//
-// configuration.put(Client.ENABLE_LEASE, String.valueOf(false));
-//
-// //We execute this on its own client
-//
-// Client theClient = createClient();
-//
-// ConnectionFactoryGetClientAOPStackRequest req =
-// new ConnectionFactoryGetClientAOPStackRequest(id, v);
-//
-// byte[] stack = (byte[])doInvoke(theClient, req);
-//
-// theClient.disconnect();
-//
-
- org.jboss.messaging.core.remoting.Client client = createNewClient();
+ Client client = createClient();
GetClientAOPStackResponse response = (GetClientAOPStackResponse) sendBlocking(client, id, v, new GetClientAOPStackRequest());
@@ -324,15 +268,15 @@
// Private --------------------------------------------------------------------------------------
- private org.jboss.messaging.core.remoting.Client createNewClient() throws JMSException
+ private Client createClient() throws JMSException
{
//We execute this on it's own client
- org.jboss.messaging.core.remoting.Client client;
+ Client client;
try
{
InvokerLocator locator = new InvokerLocator(serverLocatorURI);
- client = new org.jboss.messaging.core.remoting.Client();
+ client = new Client();
client.connect(locator.getHost(), locator.getPort() + 1000, TCP);
}
catch (Exception e)
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-12-06 13:44:14 UTC (rev 3427)
+++ branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/delegate/DelegateSupport.java 2007-12-06 15:36:35 UTC (rev 3428)
@@ -27,7 +27,6 @@
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.Serializable;
-import java.net.SocketException;
import javax.jms.JMSException;
@@ -39,8 +38,7 @@
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.ConnectionFailedException;
+import org.jgroups.persistence.CannotConnectException;
/**
* Base class for all client-side delegate classes.
@@ -215,31 +213,8 @@
{
return (JMSException)t;
}
- else if (t instanceof CannotConnectException)
+ else if ((t instanceof IOException))
{
- boolean failover = true;
- CannotConnectException cc = (CannotConnectException)t;
- Throwable underlying = cc.getCause();
- if (underlying != null && underlying instanceof SocketException)
- {
- //If remoting fails to find a connection because the client pool is full
- //then it throws a SocketException! - in this case we DO NOT want to failover
- //See http://jira.jboss.com/jira/browse/JBMESSAGING-1114
- if (underlying.getMessage() != null &&
- underlying.getMessage().startsWith("Can not obtain client socket connection from pool"))
- {
- log.warn("Timed out getting a connection from the pool. Try increasing clientMaxPoolSize and/or numberOfRetries " +
- "attributes in remoting-xxx-service.xml");
- failover = false;
- }
- }
- if (failover)
- {
- return new MessagingNetworkFailureException(cc);
- }
- }
- else if ((t instanceof IOException) || (t instanceof ConnectionFailedException))
- {
return new MessagingNetworkFailureException((Exception)t);
}
//This can occur if failure happens when Client.connect() is called
@@ -255,8 +230,7 @@
do
{
if ((initCause instanceof CannotConnectException) ||
- (initCause instanceof IOException) ||
- (initCause instanceof ConnectionFailedException))
+ (initCause instanceof IOException))
{
return new MessagingNetworkFailureException((Exception)initCause);
}
Modified: branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/remoting/JMSRemotingConnection.java
===================================================================
--- branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/remoting/JMSRemotingConnection.java 2007-12-06 13:44:14 UTC (rev 3427)
+++ branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/remoting/JMSRemotingConnection.java 2007-12-06 15:36:35 UTC (rev 3428)
@@ -21,25 +21,13 @@
*/
package org.jboss.jms.client.remoting;
-import java.util.HashMap;
-import java.util.Map;
-
import org.jboss.logging.Logger;
+import org.jboss.messaging.core.remoting.Client;
import org.jboss.messaging.core.remoting.TransportType;
-import org.jboss.messaging.util.GUIDGenerator;
-import org.jboss.remoting.Client;
import org.jboss.remoting.InvokerLocator;
-import org.jboss.remoting.ServerInvoker;
-import org.jboss.remoting.callback.CallbackPoller;
-import org.jboss.remoting.transport.bisocket.Bisocket;
-import org.jboss.remoting.transport.socket.MicroSocketClientInvoker;
-import org.jboss.remoting.transport.socket.SocketServerInvoker;
-import org.jboss.util.id.GUID;
-
-
/**
- * Encapsulates the state and behaviour from jboss remoting needed for a JMS connection.
+ * Encapsulates the state and behaviour from MINA needed for a JMS connection.
*
* Each JMS connection maintains a single Client instance for invoking on the server.
*
@@ -53,196 +41,13 @@
{
// Constants ------------------------------------------------------------------------------------
- public static final String CALLBACK_POLL_PERIOD_DEFAULT = "100";
-
private static final Logger log = Logger.getLogger(JMSRemotingConnection.class);
// Static ---------------------------------------------------------------------------------------
- private static String getPropertySafely(String propName)
- {
- String prop = null;
-
- try
- {
- prop = System.getProperty(propName);
- }
- catch (Exception ignore)
- {
- // May get a security exception depending on security permissions, in which case we
- // return null
- }
-
- return prop;
- }
-
- /**
- * Build the configuration we need to use to make sure a callback server works the way we want.
- *
- * @param doPushCallbacks - whether the callback should be push or pull. For socket transport
- * allow true push callbacks, with callback Connector. For http transport, simulate push
- * callbacks.
- * @param metadata - metadata that should be added to the metadata map being created. Can be
- * null.
- *
- * @return a Map to be used when adding a listener to a client, thus enabling a callback server.
- */
- public static Map createCallbackMetadata(boolean doPushCallbacks, Map metadata,
- InvokerLocator serverLocator)
- {
- if (metadata == null)
- {
- metadata = new HashMap();
- }
-
- // Use our own direct thread pool that basically does nothing.
- // Note! This needs to be done irrespective of the transport and is used even for INVM
- // invocations.
- metadata.put(ServerInvoker.ONEWAY_THREAD_POOL_CLASS_KEY,
- "org.jboss.jms.server.remoting.DirectThreadPool");
-
- if (doPushCallbacks)
- {
- metadata.put(MicroSocketClientInvoker.CLIENT_SOCKET_CLASS_FLAG,
- "org.jboss.jms.client.remoting.ClientSocketWrapper");
- metadata.put(SocketServerInvoker.SERVER_SOCKET_CLASS_FLAG,
- "org.jboss.jms.server.remoting.ServerSocketWrapper");
-
- String bindAddress = getPropertySafely("jboss.messaging.callback.bind.address");
-
- if (bindAddress != null)
- {
- metadata.put(Client.CALLBACK_SERVER_HOST, bindAddress);
- }
-
- String propertyPort = getPropertySafely("jboss.messaging.callback.bind.port");
-
- if (propertyPort != null)
- {
- metadata.put(Client.CALLBACK_SERVER_PORT, propertyPort);
- }
-
- Map params = serverLocator.getParameters();
- int maxPoolSize = 50;
- if (params != null)
- {
- String val = (String)params.get(MicroSocketClientInvoker.MAX_POOL_SIZE_FLAG);
- maxPoolSize = Integer.valueOf((String)val).intValue();
- }
-
- //Use the same value for the callback server
- metadata.put(MicroSocketClientInvoker.MAX_POOL_SIZE_FLAG, String.valueOf(maxPoolSize));
-
- String protocol = serverLocator.getProtocol();
- if ("bisocket".equals(protocol) || "sslbisocket".equals(protocol))
- {
- metadata.put(Bisocket.IS_CALLBACK_SERVER, "true");
-
- // Setting the port prevents the Remoting Client from using PortUtil.findPort(), which
- // creates ServerSockets. The actual value of the port shouldn't matter. To "guarantee"
- // that each InvokerLocator is unique, a GUID is appended to the InvokerLocator.
- if (propertyPort == null)
- {
- String guid = new GUID().toString();
- int hash = guid.hashCode();
-
- // Make sure the hash code is > 0.
- // See http://jira.jboss.org/jira/browse/JBMESSAGING-863.
- while(hash <= 0)
- {
- if (hash == 0)
- {
- guid = GUIDGenerator.generateGUID();
- hash = guid.hashCode();
- }
- if (hash < 0)
- {
- if (hash == Integer.MIN_VALUE)
- {
- hash = Integer.MAX_VALUE;
- }
- else
- {
- hash = -hash;
- }
- }
- }
-
- metadata.put(Client.CALLBACK_SERVER_PORT, Integer.toString(hash));
- metadata.put("guid", guid);
- }
- }
- }
- else
- {
- // "jboss.messaging.callback.pollPeriod" system property, if set, has the
- // highest priority ...
- String callbackPollPeriod = getPropertySafely("jboss.messaging.callback.pollPeriod");
-
- if (callbackPollPeriod == null)
- {
- // followed by the value configured on the HTTP connector ("callbackPollPeriod") ...
- callbackPollPeriod = (String)serverLocator.getParameters().get("callbackPollPeriod");
- if (callbackPollPeriod == null)
- {
- // followed by the hardcoded value.
- callbackPollPeriod = CALLBACK_POLL_PERIOD_DEFAULT;
- }
- }
-
- metadata.put(CallbackPoller.CALLBACK_POLL_PERIOD, callbackPollPeriod);
-
- String reportPollingStatistics =
- getPropertySafely("jboss.messaging.callback.reportPollingStatistics");
-
- if (reportPollingStatistics != null)
- {
- metadata.put(CallbackPoller.REPORT_STATISTICS, reportPollingStatistics);
- }
- }
-
- return metadata;
- }
-
-// /**
-// * Configures and add the invokerCallbackHandler the right way (push or pull).
-// *
-// * @param configurer - passed for logging purposes only.
-// * @param initialMetadata - some initial metadata that we might want to pass along when
-// * registering invoker callback handler.
-// */
-// public static void addInvokerCallbackHandler(Object configurer,
-// Client client,
-// Map initialMetadata,
-// InvokerLocator serverLocator,
-// InvokerCallbackHandler invokerCallbackHandler)
-// throws Throwable
-// {
-//
-// // For transports derived from the socket transport, allow true push callbacks,
-// // with callback Connector. For http transport, simulate push callbacks.
-// String protocol = serverLocator.getProtocol();
-// boolean isBisocket = "bisocket".equals(protocol) || "sslbisocket".equals(protocol);
-// boolean isSocket = "socket".equals(protocol) || "sslsocket".equals(protocol);
-// boolean doPushCallbacks = isBisocket || isSocket;
-// Map metadata = createCallbackMetadata(doPushCallbacks, initialMetadata, serverLocator);
-//
-// if (doPushCallbacks)
-// {
-// log.trace(configurer + " is doing push callbacks");
-// client.addListener(invokerCallbackHandler, metadata, null, true);
-// }
-// else
-// {
-// log.trace(configurer + " is simulating push callbacks");
-// client.addListener(invokerCallbackHandler, metadata);
-// }
-// }
-
// Attributes -----------------------------------------------------------------------------------
- private org.jboss.messaging.core.remoting.Client client;
- private boolean clientPing;
+ private Client client;
private InvokerLocator serverLocator;
private CallbackManager callbackManager;
private boolean strictTck;
@@ -256,10 +61,9 @@
// Constructors ---------------------------------------------------------------------------------
- public JMSRemotingConnection(String serverLocatorURI, boolean clientPing, boolean strictTck) throws Exception
+ public JMSRemotingConnection(String serverLocatorURI, boolean strictTck) throws Exception
{
serverLocator = new InvokerLocator(serverLocatorURI);
- this.clientPing = clientPing;
this.strictTck = strictTck;
log.trace(this + " created");
@@ -273,13 +77,9 @@
callbackManager = new CallbackManager();
- client = new org.jboss.messaging.core.remoting.Client();
+ client = new Client();
client.connect(serverLocator.getHost(), serverLocator.getPort() + 1000, TransportType.TCP);
- Map metadata = new HashMap();
-
- metadata.put(InvokerLocator.DATATYPE, "jms");
-
log.trace(this + " started");
}
@@ -301,7 +101,7 @@
log.trace(this + " closed");
}
- public org.jboss.messaging.core.remoting.Client getRemotingClient()
+ public Client getRemotingClient()
{
return client;
}
Modified: branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/ServerPeer.java
===================================================================
--- branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/ServerPeer.java 2007-12-06 13:44:14 UTC (rev 3427)
+++ branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/ServerPeer.java 2007-12-06 15:36:35 UTC (rev 3428)
@@ -1072,7 +1072,7 @@
out.println("<tr>");
out.println("<td>" + endpoint.toString() + "</td>");
- out.println("<td>" + endpoint.getCallbackHandler().getCallbackClient().getInvoker().getLocator().getHost() + "</td>");
+ // TODO add URI to the corresponding client delegate
out.println("<td>" + endpoint.getUsername() + "</td>");
out.println("<td>" + endpoint.getSessions().size() + "</td>");
out.println("</tr>");
Modified: branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/connectionfactory/ConnectionFactory.java
===================================================================
--- branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/connectionfactory/ConnectionFactory.java 2007-12-06 13:44:14 UTC (rev 3427)
+++ branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/connectionfactory/ConnectionFactory.java 2007-12-06 15:36:35 UTC (rev 3428)
@@ -180,31 +180,11 @@
connectorManager = serverPeer.getConnectorManager();
connectionManager = serverPeer.getConnectionManager();
- int refCount = connectorManager.registerConnector(connectorObjectName.getCanonicalName());
-
- long leasePeriod = (Long)JMXAccessor.getJMXAttributeOverSecurity(server, connectorObjectName, "LeasePeriod");
-
- // if leasePeriod <= 0, disable pinging altogether
-
- boolean enablePing = leasePeriod > 0;
-
- if (refCount == 1 && enablePing)
- {
- // TODO Something is not quite right here, we can detect failure even if pinging is not
- // enabled, for example if we try to send a callback to the client and sending the
- // calback fails
-
- // install the connection listener that listens for failed connections
- server.invoke(connectorObjectName, "addConnectionListener",
- new Object[] {connectionManager},
- new String[] {"org.jboss.remoting.ConnectionListener"});
- }
-
// We use the MBean service name to uniquely identify the connection factory
connectionFactoryManager.
registerConnectionFactory(getServiceName().getCanonicalName(), clientID, jndiBindings,
- locatorURI, enablePing, prefetchSize, slowConsumers,
+ locatorURI, false, prefetchSize, slowConsumers,
defaultTempQueueFullSize, defaultTempQueuePageSize,
defaultTempQueueDownCacheSize, dupsOKBatchSize, supportsFailover, supportsLoadBalancing,
loadBalancingFactory, strictTck);
@@ -212,14 +192,7 @@
String info = "Connector " + locator.getProtocol() + "://" +
locator.getHost() + ":" + locator.getPort();
- if (enablePing)
- {
- info += " has leasing enabled, lease period " + leasePeriod + " milliseconds";
- }
- else
- {
- info += " has lease disabled";
- }
+ info += " has lease disabled";
log.info(info);
log.info(this + " started");
Modified: branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/connectionmanager/SimpleConnectionManager.java
===================================================================
--- branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/connectionmanager/SimpleConnectionManager.java 2007-12-06 13:44:14 UTC (rev 3427)
+++ branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/connectionmanager/SimpleConnectionManager.java 2007-12-06 15:36:35 UTC (rev 3428)
@@ -42,9 +42,6 @@
import org.jboss.messaging.core.remoting.PacketSender;
import org.jboss.messaging.util.ConcurrentHashSet;
import org.jboss.messaging.util.Util;
-import org.jboss.remoting.Client;
-import org.jboss.remoting.ClientDisconnectedException;
-import org.jboss.remoting.ConnectionListener;
/**
* @author <a href="tim.fox at jboss.com">Tim Fox</a>
@@ -53,7 +50,7 @@
*
* $Id$
*/
-public class SimpleConnectionManager implements ConnectionManager, ConnectionListener, ClusterNotificationListener
+public class SimpleConnectionManager implements ConnectionManager, ClusterNotificationListener
{
// Constants ------------------------------------------------------------------------------------
@@ -172,34 +169,6 @@
closeConsumersForClientVMID(jmsClientID);
}
- // ConnectionListener implementation ------------------------------------------------------------
-
- /**
- * Be aware that ConnectionNotifier uses to call this method with null Throwables.
- *
- * @param t - plan for it to be null!
- */
- public void handleConnectionException(Throwable t, Client client)
- {
- if (t instanceof ClientDisconnectedException)
- {
- // This is OK
- if (trace) { log.trace(this + " notified that client " + client + " has disconnected"); }
- return;
- }
- else
- {
- if (trace) { log.trace(this + " detected failure on client " + client, t); }
- }
-
- String remotingSessionID = client.getSessionId();
-
- if (remotingSessionID != null)
- {
- handleClientFailure(remotingSessionID, true);
- }
- }
-
/** Synchronized is not really needed.. just to be safe as this is not supposed to be highly contended */
public void addConnectionFactoryCallback(String uniqueName, String vmID,
String remotingSessionID, PacketSender sender)
Modified: branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/endpoint/ConnectionFactoryInternalEndpoint.java
===================================================================
--- branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/endpoint/ConnectionFactoryInternalEndpoint.java 2007-12-06 13:44:14 UTC (rev 3427)
+++ branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/endpoint/ConnectionFactoryInternalEndpoint.java 2007-12-06 15:36:35 UTC (rev 3428)
@@ -25,7 +25,6 @@
import org.jboss.jms.delegate.ConnectionFactoryEndpoint;
import org.jboss.jms.delegate.CreateConnectionResult;
-import org.jboss.remoting.callback.ServerInvokerCallbackHandler;
/**
* The interface only exists so the connection factory requests can call through the AOP stack
@@ -43,7 +42,6 @@
int failedNodeID,
String remotingSessionID,
String clientVMID,
- byte versionToUse,
- ServerInvokerCallbackHandler callbackHandler)
+ byte versionToUse)
throws JMSException;
}
Modified: branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/endpoint/ServerConnectionEndpoint.java
===================================================================
--- branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/endpoint/ServerConnectionEndpoint.java 2007-12-06 13:44:14 UTC (rev 3427)
+++ branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/endpoint/ServerConnectionEndpoint.java 2007-12-06 15:36:35 UTC (rev 3428)
@@ -37,7 +37,6 @@
import org.jboss.aop.AspectManager;
import org.jboss.jms.client.delegate.ClientSessionDelegate;
-import org.jboss.jms.client.remoting.CallbackManager;
import org.jboss.jms.delegate.ConnectionEndpoint;
import org.jboss.jms.delegate.IDBlock;
import org.jboss.jms.delegate.SessionDelegate;
@@ -52,7 +51,6 @@
import org.jboss.jms.tx.MessagingXid;
import org.jboss.jms.tx.TransactionRequest;
import org.jboss.jms.tx.ClientTransaction.SessionTxState;
-import org.jboss.jms.wireformat.JMSWireFormat;
import org.jboss.logging.Logger;
import org.jboss.messaging.core.contract.Binding;
import org.jboss.messaging.core.contract.Delivery;
@@ -66,8 +64,6 @@
import org.jboss.messaging.util.ExceptionUtil;
import org.jboss.messaging.util.GUIDGenerator;
import org.jboss.messaging.util.Util;
-import org.jboss.remoting.Client;
-import org.jboss.remoting.callback.ServerInvokerCallbackHandler;
/**
* Concrete implementation of ConnectionEndpoint.
@@ -112,7 +108,6 @@
private ConnectionManager cm;
private TransactionRepository tr;
private MessageStore ms;
- private ServerInvokerCallbackHandler callbackHandler;
// Map<sessionID - ServerSessionEndpoint>
private Map sessions;
@@ -149,7 +144,6 @@
String remotingSessionID,
String clientVMID,
byte versionToUse,
- ServerInvokerCallbackHandler callbackHandler,
int dupsOKBatchSize) throws Exception
{
this.serverPeer = serverPeer;
@@ -192,32 +186,6 @@
this.serverPeer.getConnectionManager().
registerConnection(jmsClientVMID, remotingClientSessionID, this);
-
- this.callbackHandler = callbackHandler;
-
- // FIXME callbackHandler passed in parameter is null
- Client callbackClient = null; //callbackHandler.getCallbackClient();
-
- if (callbackClient != null)
- {
- // TODO not sure if this is the best way to do this, but the callbackClient needs to have
- // its "subsystem" set, otherwise remoting cannot find the associated
- // ServerInvocationHandler on the callback server
- callbackClient.setSubsystem(CallbackManager.JMS_CALLBACK_SUBSYSTEM);
-
- // We explictly set the Marshaller since otherwise remoting tries to resolve the marshaller
- // every time which is very slow - see org.jboss.remoting.transport.socket.ProcessInvocation
- // This can make a massive difference on performance. We also do this in
- // JMSRemotingConnection.setupConnection
-
- callbackClient.setMarshaller(new JMSWireFormat());
- callbackClient.setUnMarshaller(new JMSWireFormat());
- }
- else
- {
- log.trace("ServerInvokerCallbackHandler callback Client is not available: " +
- "must be using pull callbacks");
- }
}
// ConnectionDelegate implementation ------------------------------------------------------------
@@ -542,11 +510,6 @@
return sm;
}
- public ServerInvokerCallbackHandler getCallbackHandler()
- {
- return callbackHandler;
- }
-
public ServerPeer getServerPeer()
{
return serverPeer;
Modified: branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/endpoint/ServerConnectionFactoryEndpoint.java
===================================================================
--- branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/endpoint/ServerConnectionFactoryEndpoint.java 2007-12-06 13:44:14 UTC (rev 3427)
+++ branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/endpoint/ServerConnectionFactoryEndpoint.java 2007-12-06 15:36:35 UTC (rev 3428)
@@ -40,7 +40,6 @@
import org.jboss.messaging.core.remoting.wireformat.GetTopologyResponse;
import org.jboss.messaging.util.ExceptionUtil;
import org.jboss.messaging.util.Version;
-import org.jboss.remoting.callback.ServerInvokerCallbackHandler;
/**
* Concrete implementation of ConnectionFactoryEndpoint
@@ -152,8 +151,7 @@
int failedNodeID,
String remotingSessionID,
String clientVMID,
- byte versionToUse,
- ServerInvokerCallbackHandler callbackHandler)
+ byte versionToUse)
throws JMSException
{
try
@@ -164,8 +162,7 @@
ClientConnectionDelegate cd =
createConnectionDelegateInternal(username, password, failedNodeID,
remotingSessionID, clientVMID,
- versionToUse,
- callbackHandler);
+ versionToUse);
return new CreateConnectionResult(cd);
}
else
@@ -188,8 +185,7 @@
ClientConnectionDelegate cd =
createConnectionDelegateInternal(username, password, failedNodeID,
remotingSessionID, clientVMID,
- versionToUse,
- callbackHandler);
+ versionToUse);
return new CreateConnectionResult(cd);
}
}
@@ -210,8 +206,7 @@
String password,
int failedNodeID,
String remotingSessionID, String clientVMID,
- byte versionToUse,
- ServerInvokerCallbackHandler callbackHandler)
+ byte versionToUse)
throws Exception
{
log.trace("creating a new connection for user " + username);
@@ -247,7 +242,7 @@
defaultTempQueueFullSize, defaultTempQueuePageSize,
defaultTempQueueDownCacheSize, failedNodeID, this,
remotingSessionID, clientVMID, versionToUse,
- callbackHandler, dupsOKBatchSize);
+ dupsOKBatchSize);
final String connectionID = endpoint.getConnectionID();
Modified: branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java
===================================================================
--- branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java 2007-12-06 13:44:14 UTC (rev 3427)
+++ branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java 2007-12-06 15:36:35 UTC (rev 3428)
@@ -86,7 +86,6 @@
import org.jboss.messaging.util.ExceptionUtil;
import org.jboss.messaging.util.GUIDGenerator;
import org.jboss.messaging.util.MessageQueueNameHelper;
-import org.jboss.remoting.callback.ServerInvokerCallbackHandler;
import EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap;
import EDU.oswego.cs.dl.util.concurrent.LinkedQueue;
@@ -140,7 +139,6 @@
private volatile boolean closed;
private ServerConnectionEndpoint connectionEndpoint;
- private ServerInvokerCallbackHandler callbackHandler;
private ServerPeer sp;
@@ -189,8 +187,6 @@
this.replicating = replicating;
- callbackHandler = connectionEndpoint.getCallbackHandler();
-
sp = connectionEndpoint.getServerPeer();
pm = sp.getPersistenceManagerInstance();
Modified: branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/endpoint/advised/ConnectionFactoryAdvised.java
===================================================================
--- branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/endpoint/advised/ConnectionFactoryAdvised.java 2007-12-06 13:44:14 UTC (rev 3427)
+++ branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/endpoint/advised/ConnectionFactoryAdvised.java 2007-12-06 15:36:35 UTC (rev 3428)
@@ -45,7 +45,6 @@
import org.jboss.messaging.core.remoting.wireformat.JMSExceptionMessage;
import org.jboss.messaging.core.remoting.wireformat.PacketType;
import org.jboss.messaging.core.remoting.wireformat.UpdateCallbackMessage;
-import org.jboss.remoting.callback.ServerInvokerCallbackHandler;
/**
*
@@ -120,14 +119,13 @@
int failedNodeID,
String remotingSessionID,
String clientVMID,
- byte versionToUse,
- ServerInvokerCallbackHandler callbackHandler)
+ byte versionToUse)
throws JMSException
{
return ((ServerConnectionFactoryEndpoint)endpoint).
createConnectionDelegate(username, password, failedNodeID,
remotingSessionID, clientVMID,
- versionToUse, callbackHandler);
+ versionToUse);
}
// AdvisedSupport override ----------------------------------------------------------------------
@@ -182,7 +180,7 @@
CreateConnectionResult del = createConnectionDelegate(request
.getUsername(), request.getPassword(), request
.getFailedNodeID(), request.getRemotingSessionID(),
- request.getClientVMID(), request.getVersion(), null);
+ request.getClientVMID(), request.getVersion());
response = new CreateConnectionResponse(del.getDelegate()
.getID(), del.getDelegate().getServerID());
More information about the jboss-cvs-commits
mailing list