jrun.jms.core.server
Class JmsServerConnectionManager

java.lang.Object
  |
  +--jrun.jms.core.server.JmsServerConnectionManager
All Implemented Interfaces:
GarbageCollectable

public class JmsServerConnectionManager
extends java.lang.Object
implements GarbageCollectable

The connection manager is responsible for managing all connections to the JmsServer. The connection manager is a singleton (at this point anyway) that is accessible through the instance class method. It is also responsible for holding a list of connections.

A client uses a client identifier to create a connection and a connection type to identify the connection type- queue or topic.

TODO: Look at leasing connections and timing them out.

Version:
$Revision: 1.2 $ $Date: 2000/11/11 07:47:19 $ created by Jim Alateras
See Also:
org.exolab.jms.server.JmsConnection

Method Summary
 void closeConnection(java.lang.String id)
          Close the connection associated with a particular client identity.
 void collectGarbage()
          Perform any garbage collection on this resource.
 JmsServerConnection createConnection(java.lang.String id, java.lang.String user)
          Create a connection with the specified client id.
 JmsServerConnection getConnection(java.lang.String id)
          Return the connection associated with a particular client identity.
 java.util.Enumeration getConnections()
          Return an Enumeration of all the connections currently registered with the connection manager
 int getGarbageCollectionEvent()
          Returns garbage collection event type
static JmsServerConnectionManager instance()
          The static method returns the singleton instance of the JmsConnectionManager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

instance

public static JmsServerConnectionManager instance()
The static method returns the singleton instance of the JmsConnectionManager. If one does not exist it is created prior to returning.
Returns:
JmsConnectionManager

createConnection

public JmsServerConnection createConnection(java.lang.String id,
                                            java.lang.String user)
                                     throws FailedToCreateConnectionException
Create a connection with the specified client id. If the client already has an open connection then simply return a reference to this connection If a connection already exists for the specified client identity then simply return the exisiting connection

If a connection cannot be established then throw the FailedToCreateConn- ectionException exception.

Parameters:
id - client identity
user - user id
Returns:
JmsConnection connection object
Throws:
FailedToCreateConnectionException -  

getConnections

public java.util.Enumeration getConnections()
Return an Enumeration of all the connections currently registered with the connection manager
Returns:
Enumeration

getConnection

public JmsServerConnection getConnection(java.lang.String id)
Return the connection associated with a particular client identity. If such a connection does not exist then return null
Parameters:
id - identity of the client
Returns:
JmsConnection associated connection or null

closeConnection

public void closeConnection(java.lang.String id)
Close the connection associated with a particular client identity. If a connection for the client does not exist then do nothing.
Parameters:
id - identity of the client

collectGarbage

public void collectGarbage()
Perform any garbage collection on this resource. This will have the effect of releasing system resources.
Specified by:
collectGarbage in interface GarbageCollectable

getGarbageCollectionEvent

public int getGarbageCollectionEvent()
Description copied from interface: GarbageCollectable
Returns garbage collection event type
Specified by:
getGarbageCollectionEvent in interface GarbageCollectable


Copyright � 2002 Macromedia Corporation. All Rights Reserved.