org.exolab.jms.net.connector
Interface ConnectionPool


public interface ConnectionPool

Manages a pool of ManagedConnection instances, for a particular ManagedConnectionFactory.

Version:
$Revision: 1.5 $ $Date: 2005/06/04 14:51:06 $
Author:
Tim Anderson

Method Summary
 void close()
          Closes this connection pool, cleaning up any allocated resources.
 ManagedConnection createManagedConnection(java.security.Principal principal, ConnectionRequestInfo info)
          Creates a new connection.
 ManagedConnectionAcceptor createManagedConnectionAcceptor(Authenticator authenticator, ConnectionRequestInfo info)
          Creates an acceptor for connections
 ManagedConnectionAcceptorListener getManagedConnectionAcceptorListener()
          Returns a listener for handling accepted connections.
 ManagedConnectionAcceptor matchManagedConnectionAcceptors(ConnectionRequestInfo info)
          Returns a matched acceptor from the set of pooled connections.
 ManagedConnection matchManagedConnections(java.security.Principal principal, ConnectionRequestInfo info)
          Returns a matched connection from the set of pooled connections.
 void setCallerListener(CallerListener listener)
          Sets the listener for caller events.
 

Method Detail

createManagedConnection

public ManagedConnection createManagedConnection(java.security.Principal principal,
                                                 ConnectionRequestInfo info)
                                          throws ResourceException
Creates a new connection.
Parameters:
principal - the security principal
info - the connection request info
Returns:
a new connection
Throws:
ResourceException - if a connection cannot be established

createManagedConnectionAcceptor

public ManagedConnectionAcceptor createManagedConnectionAcceptor(Authenticator authenticator,
                                                                 ConnectionRequestInfo info)
                                                          throws ResourceException
Creates an acceptor for connections
Parameters:
authenticator - authenticates incoming connections
info - the connection request info
Returns:
a new connection acceptor
Throws:
ResourceException - if an acceptor cannot be created

matchManagedConnections

public ManagedConnection matchManagedConnections(java.security.Principal principal,
                                                 ConnectionRequestInfo info)
                                          throws ResourceException
Returns a matched connection from the set of pooled connections.
Parameters:
principal - the security principal
info - the connection request info
Returns:
the first acceptable match, or null if none is found
Throws:
ResourceException - for any error

matchManagedConnectionAcceptors

public ManagedConnectionAcceptor matchManagedConnectionAcceptors(ConnectionRequestInfo info)
                                                          throws ResourceException
Returns a matched acceptor from the set of pooled connections.
Parameters:
info - the connection request info
Returns:
the first acceptable match, or null if none is found
Throws:
ResourceException - for any error

getManagedConnectionAcceptorListener

public ManagedConnectionAcceptorListener getManagedConnectionAcceptorListener()
                                                                       throws ResourceException
Returns a listener for handling accepted connections.
Returns:
a listener for handling accepted connections
Throws:
ResourceException - for any error

setCallerListener

public void setCallerListener(CallerListener listener)
Sets the listener for caller events.
Parameters:
listener - the listener

close

public void close()
           throws ResourceException
Closes this connection pool, cleaning up any allocated resources.
Throws:
ResourceException - for any error


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