org.jboss.jms.server.connectionmanager
Class SimpleConnectionManager

java.lang.Object
  extended by org.jboss.jms.server.connectionmanager.SimpleConnectionManager
All Implemented Interfaces:
ConnectionManager, ClusterNotificationListener, MessagingComponent

public class SimpleConnectionManager
extends java.lang.Object
implements ConnectionManager, ClusterNotificationListener

Version:
$Revision: 3242 $ $Id: SimpleConnectionManager.java 3242 2007-10-25 18:12:00Z timfox $
Author:
Tim Fox, Ovidiu Feodorov

Constructor Summary
SimpleConnectionManager()
           
 
Method Summary
 void addConnectionFactoryCallback(java.lang.String uniqueName, java.lang.String JVMID, java.lang.String remotingSessionID, ServerInvokerCallbackHandler handler)
          Synchronized is not really needed..
 boolean containsRemotingSession(java.lang.String remotingClientSessionID)
           
 java.util.List getActiveConnections()
          Returns a list of active connection endpoints currently maintained by an instance of this manager.
 java.util.Map getClients()
           
 ServerInvokerCallbackHandler[] getConnectionFactoryCallback(java.lang.String uniqueName)
          Synchronized is not really needed..
 void handleClientFailure(java.lang.String remotingSessionID, boolean clientToServer)
           
 void handleConnectionException(java.lang.Throwable t, Client client)
          Be aware that ConnectionNotifier uses to call this method with null Throwables.
 void injectReplicator(Replicator replicator)
           
 void notify(ClusterNotification notification)
          Closing connections that are coming from a failed node
 void registerConnection(java.lang.String jmsClientVMID, java.lang.String remotingClientSessionID, ConnectionEndpoint endpoint)
           
 void removeConnectionFactoryCallback(java.lang.String uniqueName, java.lang.String JVMID, ServerInvokerCallbackHandler handler)
          Synchronized is not really needed..
 void start()
           
 void stop()
           
 java.lang.String toString()
           
 ConnectionEndpoint unregisterConnection(java.lang.String jmsClientVMId, java.lang.String remotingClientSessionID)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleConnectionManager

public SimpleConnectionManager()
Method Detail

registerConnection

public void registerConnection(java.lang.String jmsClientVMID,
                               java.lang.String remotingClientSessionID,
                               ConnectionEndpoint endpoint)
Specified by:
registerConnection in interface ConnectionManager

unregisterConnection

public ConnectionEndpoint unregisterConnection(java.lang.String jmsClientVMId,
                                               java.lang.String remotingClientSessionID)
Specified by:
unregisterConnection in interface ConnectionManager
Returns:
null if there is no such connection.

getActiveConnections

public java.util.List getActiveConnections()
Description copied from interface: ConnectionManager
Returns a list of active connection endpoints currently maintained by an instance of this manager. The implementation should make a copy of the list to avoid ConcurrentModificationException. The list could be empty, but never null.

Specified by:
getActiveConnections in interface ConnectionManager
Returns:
List

handleClientFailure

public void handleClientFailure(java.lang.String remotingSessionID,
                                boolean clientToServer)
Specified by:
handleClientFailure in interface ConnectionManager
clientToServer - - true if the failure has been detected on a direct connection from client to this server, false if the failure has been detected while trying to send a callback from this server to the client.

handleConnectionException

public void handleConnectionException(java.lang.Throwable t,
                                      Client client)
Be aware that ConnectionNotifier uses to call this method with null Throwables.

Parameters:
t - - plan for it to be null!

addConnectionFactoryCallback

public void addConnectionFactoryCallback(java.lang.String uniqueName,
                                         java.lang.String JVMID,
                                         java.lang.String remotingSessionID,
                                         ServerInvokerCallbackHandler handler)
Synchronized is not really needed.. just to be safe as this is not supposed to be highly contended

Specified by:
addConnectionFactoryCallback in interface ConnectionManager

removeConnectionFactoryCallback

public void removeConnectionFactoryCallback(java.lang.String uniqueName,
                                            java.lang.String JVMID,
                                            ServerInvokerCallbackHandler handler)
Synchronized is not really needed.. just to be safe as this is not supposed to be highly contended

Specified by:
removeConnectionFactoryCallback in interface ConnectionManager

getConnectionFactoryCallback

public ServerInvokerCallbackHandler[] getConnectionFactoryCallback(java.lang.String uniqueName)
Synchronized is not really needed.. just to be safe as this is not supposed to be highly contended

Specified by:
getConnectionFactoryCallback in interface ConnectionManager

notify

public void notify(ClusterNotification notification)
Closing connections that are coming from a failed node

Specified by:
notify in interface ClusterNotificationListener
Parameters:
notification -

start

public void start()
           throws java.lang.Exception
Specified by:
start in interface MessagingComponent
Throws:
java.lang.Exception

stop

public void stop()
          throws java.lang.Exception
Specified by:
stop in interface MessagingComponent
Throws:
java.lang.Exception

containsRemotingSession

public boolean containsRemotingSession(java.lang.String remotingClientSessionID)
Specified by:
containsRemotingSession in interface ConnectionManager

getClients

public java.util.Map getClients()

injectReplicator

public void injectReplicator(Replicator replicator)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2006 JBoss Inc. All Rights Reserved.