org.exolab.jms.server
Class ServerConnectionManagerImpl

java.lang.Object
  |
  +--org.exolab.jms.server.ServerConnectionManagerImpl
All Implemented Interfaces:
ServerConnectionFactory, ServerConnectionManager

public class ServerConnectionManagerImpl
extends java.lang.Object
implements ServerConnectionManager

The ServerConnectionManagerImpl is responsible for managing all connections to the server.

Version:
$Revision: 1.3 $ $Date: 2005/09/05 13:38:04 $
Author:
Jim Alateras, Tim Anderson
See Also:
ServerConnectionImpl

Constructor Summary
ServerConnectionManagerImpl(org.exolab.jms.net.connector.Authenticator authenticator, MessageManager messages, DatabaseService database, Scheduler scheduler)
          Construct a new ServerConnectionManagerImpl.
 
Method Summary
 void addClientID(java.lang.String clientID)
          Register a client identifer.
 void closed(ServerConnectionImpl connection)
          Notify closure of a connection.
 ServerConnection createConnection(java.lang.String clientID, java.lang.String userName, java.lang.String password)
          Creates a connection with the specified user identity.
 ServerConnectionImpl getConnection(long connectionId)
          Returns the connection associated with a particular connection identifier.
 void setConsumerManager(ConsumerManager consumers)
          Sets the consumer manager.
 void setResourceManager(ResourceManager resources)
          Sets the resource manager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServerConnectionManagerImpl

public ServerConnectionManagerImpl(org.exolab.jms.net.connector.Authenticator authenticator,
                                   MessageManager messages,
                                   DatabaseService database,
                                   Scheduler scheduler)
Construct a new ServerConnectionManagerImpl.
Parameters:
authenticator - the authenticator to verify users with
Method Detail

setConsumerManager

public void setConsumerManager(ConsumerManager consumers)
Sets the consumer manager.
Parameters:
consumers - the consumer manager

setResourceManager

public void setResourceManager(ResourceManager resources)
Sets the resource manager.
Parameters:
resources - the resource manager.

createConnection

public ServerConnection createConnection(java.lang.String clientID,
                                         java.lang.String userName,
                                         java.lang.String password)
                                  throws javax.jms.JMSException
Creates a connection with the specified user identity.

The connection is created in stopped mode. No messages will be delivered until the Connection.start method is explicitly called.

If clientID is specified, it indicates the pre-configured client identifier associated with the client ConnectionFactory object.

Specified by:
createConnection in interface ServerConnectionFactory
Parameters:
clientID - the pre-configured client identifier. May be null null.
userName - the caller's user name
password - the caller's password
Returns:
a newly created connection
Throws:
javax.jms.InvalidClientIDException - if the JMS client specifies an invalid or duplicate client ID.
javax.jms.JMSException - if the JMS provider fails to create the connection due to some internal error.
javax.jms.JMSSecurityException - if client authentication fails due to an invalid user name or password.

getConnection

public ServerConnectionImpl getConnection(long connectionId)
Returns the connection associated with a particular connection identifier.
Specified by:
getConnection in interface ServerConnectionManager
Parameters:
connectionId - the connection identifier
Returns:
the connection associated with connectionId, or null if none exists

closed

public void closed(ServerConnectionImpl connection)
Notify closure of a connection.
Parameters:
connection - the connection that has been closed

addClientID

public void addClientID(java.lang.String clientID)
                 throws javax.jms.InvalidClientIDException
Register a client identifer.
Parameters:
clientID - the client identifier. If nullThrows:
javax.jms.InvalidClientIDException - if the identifier is a duplicate.


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