org.exolab.jms.server
Class AdminConnectionManager

java.lang.Object
  |
  +--org.exolab.jms.server.AdminConnectionManager
All Implemented Interfaces:
EventHandler, java.io.Serializable

public class AdminConnectionManager
extends java.lang.Object
implements EventHandler

The admin connection manager is responsible for managing all admin 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 adminconnections.

Version:
$Revision: 1.2 $ $Date: 2003/08/07 13:33:08 $
Author:
Knut Lerpold
See Also:
AdminConnection, Serialized Form

Method Summary
 void closeConnection(java.lang.String identifierId)
          Close the connection associated with a particular client identity.
 AdminConnection createConnection(java.lang.String id, java.lang.String username, java.lang.String password)
          Create a connection with the specified client id.
 AdminConnection getConnection(java.lang.String id)
          Return the connection associated with a particular client identity.
 java.util.Iterator getConnections()
          Return an Enumeration of all the connections currently registered with the connection manager
 org.exolab.core.foundation.HandleIfc getHandle()
          Return a handle to this event handler for the purpose of storing and restoring it.
 void handleEvent(int event, java.lang.Object callback, long time)
          Handle the specified event, generated by the EventManager.
static AdminConnectionManager instance()
          The static method returns the singleton instance of the AdminConnectionManager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

instance

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

createConnection

public AdminConnection createConnection(java.lang.String id,
                                        java.lang.String username,
                                        java.lang.String password)
                                 throws javax.jms.JMSSecurityException,
                                        javax.jms.JMSException
Create a connection with the specified client id. The connection contains
Parameters:
id - the client identity
username - the client's username
password - the client's password
Returns:
a new admin connection
Throws:
javax.jms.JMSSecurityException - if the client cannot be authenticated
javax.jms.JMSException - if the connection cannot be created

getConnections

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

getConnection

public AdminConnection 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 identifierId)
Close the connection associated with a particular client identity. If a connection for the client does not exist then do nothing.
Parameters:
identifierId - the unique id for this connection

handleEvent

public void handleEvent(int event,
                        java.lang.Object callback,
                        long time)
Description copied from interface: EventHandler
Handle the specified event, generated by the EventManager. The event handler pressumably knows how to handle the callback object and should cast it appropriately before using it.

This methodshould not throw any exceptions

Specified by:
handleEvent in interface EventHandler
Following copied from interface: org.exolab.jms.events.EventHandler
Parameters:
event - the event to handle
callback - the callback object
time - the absolute time, in ms, that the event fired.

getHandle

public org.exolab.core.foundation.HandleIfc getHandle()
Description copied from interface: EventHandler
Return a handle to this event handler for the purpose of storing and restoring it. If you want event handlers to persist across subsequent invocations of the EventManager then you must support this method, otherwise this method can simply return null.
Specified by:
getHandle in interface EventHandler
Following copied from interface: org.exolab.jms.events.EventHandler
Returns:
HandleIfc return a reference to the handle.


Copyright © 1999-2004 The OpenJMS Group. All Rights Reserved.