javax.resource.spi
Interface ManagedConnectionFactory

All Superinterfaces:
Serializable

public interface ManagedConnectionFactory
extends 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
 Object createConnectionFactory()
          Creates a connection factory instance.
 Object createConnectionFactory(ConnectionManager cxManager)
          Creates a connection factory instance.
 ManagedConnection createManagedConnection(Subject subject, ConnectionRequestInfo cxRequestInfo)
          Creates a new ManagedConnection
 boolean equals(Object other)
          Tests object for equality
 PrintWriter getLogWriter()
          Gets the logwriter for this instance.
 int hashCode()
          Generates a hashCode for this object
 ManagedConnection matchManagedConnections(Set connectionSet, Subject subject, ConnectionRequestInfo cxRequestInfo)
          Returns a matching connection from the set.
 void setLogWriter(PrintWriter out)
          Sets the logwriter for this instance.
 

Method Detail

createConnectionFactory

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

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

createConnectionFactory

Object createConnectionFactory(ConnectionManager cxManager)
                               throws ResourceException
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 - for a generic error
ResourceAdapterInternalException - for an internal error in the resource adapter

createManagedConnection

ManagedConnection createManagedConnection(Subject subject,
                                          ConnectionRequestInfo cxRequestInfo)
                                          throws ResourceException
Creates a new ManagedConnection

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

matchManagedConnections

ManagedConnection matchManagedConnections(Set connectionSet,
                                          Subject subject,
                                          ConnectionRequestInfo cxRequestInfo)
                                          throws ResourceException
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 - for a generic error
ResourceAdapterInternalException - for an internal error in the resource adapter
SecurityException - for a security problem
NotSupportedException - if not supported

getLogWriter

PrintWriter getLogWriter()
                         throws ResourceException
Gets the logwriter for this instance.

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

setLogWriter

void setLogWriter(PrintWriter out)
                  throws ResourceException
Sets the logwriter for this instance.

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

equals

boolean equals(Object other)
Tests object for equality

Overrides:
equals in class Object
Parameters:
other - the other object
Returns:
true when equals, false otherwise

hashCode

int hashCode()
Generates a hashCode for this object

Overrides:
hashCode in class Object
Returns:
the hash code


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.