javax.resource.spi
Interface ManagedConnectionFactory

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
BaseWrapperManagedConnectionFactory (src) , FSMangedConnectionFactory (src) , JmsManagedConnectionFactory (src) , RARDeployment (src) , TestManagedConnectionFactory (src)

public interface ManagedConnectionFactory
extends java.io.Serializable

A ManagedConnectionFactory is a factory for the creation of ManagedConnection objects and ConnectionFactory objects. It provides methods which can be used to match ManagedConnetions.


Method Summary
 java.lang.Object createConnectionFactory()
          Creates a connection factory instance.
 java.lang.Object createConnectionFactory(ConnectionManager (src)  cxManager)
          Creates a connection factory instance.
 ManagedConnection (src) createManagedConnection(javax.security.auth.Subject subject, ConnectionRequestInfo (src)  cxRequestInfo)
          Creates a new ManagedConnection
 boolean equals(java.lang.Object other)
          Tests object for equality
 java.io.PrintWriter getLogWriter()
          Gets the logwriter for this instance.
 int hashCode()
          Generates a hashCode for this object
 ManagedConnection (src) matchManagedConnections(java.util.Set connectionSet, javax.security.auth.Subject subject, ConnectionRequestInfo (src)  cxRequestInfo)
          Returns a matching connection from the set.
 void setLogWriter(java.io.PrintWriter out)
          Sets the logwriter for this instance.
 

Method Detail

createConnectionFactory

public java.lang.Object createConnectionFactory()
                                         throws ResourceException (src) 
Creates a connection factory instance. The connection manager is provided by the resource adapter.

Returns:
the connection factory
Throws:
ResourceException (src) - for a generic error
ResourceAdapterInternalException (src) - for an internal error in the resource adapter

createConnectionFactory

public java.lang.Object createConnectionFactory(ConnectionManager (src)  cxManager)
                                         throws ResourceException (src) 
Creates a connection factory instance. the connection manager is provided by the application server

Parameters:
cxManager - the connection manager
Returns:
the connection factory
Throws:
ResourceException (src) - for a generic error
ResourceAdapterInternalException (src) - for an internal error in the resource adapter

createManagedConnection

public ManagedConnection (src)  createManagedConnection(javax.security.auth.Subject subject,
                                                 ConnectionRequestInfo (src)  cxRequestInfo)
                                          throws ResourceException (src) 
Creates a new ManagedConnection

Parameters:
subject - the subject
cxRequestInfo - the connection request info
Returns:
the managed connection
Throws:
ResourceException (src) - for a generic error
ResourceAllocationException (src) - for an error allocting resources
ResourceAdapterInternalException (src) - for an internal error in the resource adapter
SecurityException (src) - for a security problem
EISSystemException (src) - for an error from the EIS

matchManagedConnections

public ManagedConnection (src)  matchManagedConnections(java.util.Set connectionSet,
                                                 javax.security.auth.Subject subject,
                                                 ConnectionRequestInfo (src)  cxRequestInfo)
                                          throws ResourceException (src) 
Returns a matching connection from the set.

Parameters:
connectionSet - the connection set
subject - the subject
cxRequestInfo - the connection request info
Returns:
the managed connection
Throws:
ResourceException (src) - for a generic error
ResourceAdapterInternalException (src) - for an internal error in the resource adapter
SecurityException (src) - for a security problem
NotSupportedException - if not supported

getLogWriter

public java.io.PrintWriter getLogWriter()
                                 throws ResourceException (src) 
Gets the logwriter for this instance.

Returns:
the log writer
Throws:
ResourceException (src) - for a generic error

setLogWriter

public void setLogWriter(java.io.PrintWriter out)
                  throws ResourceException (src) 
Sets the logwriter for this instance.

Parameters:
out - the log writer
Throws:
ResourceException (src) - for a generic error
ResourceAdapterInternalException (src) - for an internal error in the resource adapter

equals

public boolean equals(java.lang.Object other)
Tests object for equality

Parameters:
other - the other object
Returns:
true when equals, false otherwise

hashCode

public int hashCode()
Generates a hashCode for this object

Returns:
the hash code