|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.exolab.jms.net.connector.AbstractConnectionManager
Abstract implementation of the ConnectionManager
interface.
Constructor Summary | |
AbstractConnectionManager(InvocationHandler handler,
Authenticator authenticator,
java.util.Map properties)
Construct a new AbstractConnectionManager . |
Method Summary | |
void |
accept(ManagedConnectionFactory factory,
ConnectionRequestInfo info)
Start accepting connections. |
void |
accept(URI uri)
Listen for new connections on the specified URI, using the default connection acceptor properties. |
void |
accept(URI uri,
java.util.Map properties)
Listen for new connections on the specified URI, using the specified acceptor properties. |
protected void |
addManagedConnectionFactory(ManagedConnectionFactory factory)
Register a managed connection factory. |
Connection |
allocateConnection(ManagedConnectionFactory factory,
java.security.Principal principal,
ConnectionRequestInfo info)
Allocate a new connection. |
boolean |
canAccept(URI uri)
Determines if this factory supports listening for new connections on the specified URI. |
boolean |
canConnect(URI uri)
Determines if this factory supports connections to the specified URI. |
void |
close()
Close this connection manager. |
protected ConnectionPool |
createConnectionPool(ManagedConnectionFactory factory,
InvocationHandler handler,
ConnectionFactory resolver)
Creates a new connection pool. |
Connection |
getConnection(java.security.Principal principal,
URI uri)
Returns a connection to the specified URI, using the default connection properties. |
Connection |
getConnection(java.security.Principal principal,
URI uri,
java.util.Map properties)
Returns a connection to the specified URI, using the specified connection properties. |
protected ConnectionPool |
getConnectionPool(ManagedConnectionFactory factory)
Returns the ConnectionPool which pools connections for the
specified factory. |
protected ConnectionFactory |
getFactoryForAccept(URI uri)
Returns the first factory which can accept connections on the specified URI. |
protected ConnectionFactory |
getFactoryForConnect(URI uri)
Returns the first factory which can support connections to the specified URI. |
protected java.util.Collection |
getManagedConnectionFactories()
Returns all registered managed connection factories. |
void |
setCallerListener(CallerListener listener)
Sets the caller event listener. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AbstractConnectionManager(InvocationHandler handler, Authenticator authenticator, java.util.Map properties)
AbstractConnectionManager
.handler
- the invocation handlerauthenticator
- the connection authenticatorproperties
- configuration properties. May be null
Method Detail |
public Connection allocateConnection(ManagedConnectionFactory factory, java.security.Principal principal, ConnectionRequestInfo info) throws ResourceException
allocateConnection
in interface ConnectionManager
factory
- used by application server to delegate connection
matching/creationprincipal
- the security principalinfo
- the connection request infoResourceException
- if the connection cannot be allocatedpublic void accept(ManagedConnectionFactory factory, ConnectionRequestInfo info) throws ResourceException
accept
in interface ConnectionManager
factory
- used to delegate acceptor matching/creationinfo
- connection request infoResourceException
- if the connections cannot be acceptedpublic boolean canConnect(URI uri)
canConnect
in interface ConnectionFactory
uri
- the connection addresstrue
if this factory supports the URI;
false
otherwisepublic Connection getConnection(java.security.Principal principal, URI uri) throws ResourceException
getConnection
in interface ConnectionFactory
principal
- the security principal. May be null
uri
- the connection addressuri
ResourceException
- if a connection cannot be establishedpublic Connection getConnection(java.security.Principal principal, URI uri, java.util.Map properties) throws ResourceException
getConnection
in interface ConnectionFactory
principal
- the security principal. May be null
uri
- the connection addressproperties
- connection properties. If null
, use the
default connection propertiesuri
ResourceException
- if a connection cannot be establishedpublic boolean canAccept(URI uri)
canAccept
in interface ConnectionFactory
uri
- the connection addresstrue
if this factory supports the URI;
false
otherwisepublic void accept(URI uri) throws ResourceException
accept
in interface ConnectionFactory
uri
- the connection addressResourceException
- if connections can't be accepted on the
specified URIpublic void accept(URI uri, java.util.Map properties) throws ResourceException
accept
in interface ConnectionFactory
uri
- the connection addressproperties
- acceptor properties. May be null
ResourceException
- if connections can't be accepted on the
specified URIpublic void setCallerListener(CallerListener listener)
listener
- the listenerpublic void close() throws ResourceException
ResourceException
- if a connection pool cannot be closedprotected ConnectionFactory getFactoryForConnect(URI uri)
uri
- the URIuri
, or null
if none support itprotected ConnectionFactory getFactoryForAccept(URI uri)
uri
- the URIuri
, or null
if none support itprotected void addManagedConnectionFactory(ManagedConnectionFactory factory) throws ResourceException
factory
- the factory to registerResourceException
- if the registration failsprotected java.util.Collection getManagedConnectionFactories()
protected ConnectionPool createConnectionPool(ManagedConnectionFactory factory, InvocationHandler handler, ConnectionFactory resolver) throws ResourceException
factory
- the managed connection factoryhandler
- the invocation handler, assigned to each new managed
connectionresolver
- the connection factory for resolving connections via
their URIResourceException
- if the pool can't be createdprotected ConnectionPool getConnectionPool(ManagedConnectionFactory factory) throws ResourceException
ConnectionPool
which pools connections for the
specified factory.factory
- the factory to locate the pool forfactory
ResourceException
- if no connection pool exists
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |