| java.lang.Object example.ManagedConnectionFactoryImpl
ManagedConnectionFactoryImpl | public class ManagedConnectionFactoryImpl implements ManagedConnectionFactory(Code) | | Main interface between Resin and the connector. It's the
top-level SPI class for creating the SPI ManagedConnections.
The resource configuration in Resin's web.xml will use bean-style
configuration to configure the ManagecConnectionFactory.
|
Method Summary | |
public Object | createConnectionFactory(ConnectionManager manager) Creates the application's view of the connection factory.
The ConnectionFactory is the equivalent of the JDBC DataSource.
Applications will use the ConnectionFactory to create connections.
The connector can use any API that makes sense for it. | public Object | createConnectionFactory() createConnectionFactory with no arguments is for a connection factory
outside of an application server. | public ManagedConnection | createManagedConnection(Subject subject, ConnectionRequestInfo reqInfo) Creates the SPI-side of a connection, like the XAConnection of
JDBC. | public String | generateConnectionName() Returns the connection name. | public PrintWriter | getLogWriter() Logging should use JDK 1.4 java.util.logging. | public ResourceAdapter | getResourceAdapter() This connection factory does not have a separate resource adapter. | public ManagedConnection | matchManagedConnections(Set set, Subject subject, ConnectionRequestInfo reqInfo) A connection pool method which lets the connector choose which
idle connection are allowed to be reused for a request.
It returns a connection from the set matching the subject and request
info.
Many connectors can just return the first connection, if it doesn't
matter which connection is used. | public void | setLogWriter(PrintWriter out) Logging should use JDK 1.4 java.util.logging. | public void | setName(String name) | public void | setResourceAdapter(ResourceAdapter ra) This connection factory does not have a separate resource adapter. | public String | toString() |
createConnectionFactory | public Object createConnectionFactory(ConnectionManager manager)(Code) | | Creates the application's view of the connection factory.
The ConnectionFactory is the equivalent of the JDBC DataSource.
Applications will use the ConnectionFactory to create connections.
The connector can use any API that makes sense for it. JDBC
connectors will return a DataSource. JMS connectors will return
SessionFactory, etc.
Parameters: manager - ConnectionManager provided by Resin gives access tosome application server resources. |
createConnectionFactory | public Object createConnectionFactory()(Code) | | createConnectionFactory with no arguments is for a connection factory
outside of an application server. Although most connection factories
will implement it, Resin never uses it.
|
createManagedConnection | public ManagedConnection createManagedConnection(Subject subject, ConnectionRequestInfo reqInfo)(Code) | | Creates the SPI-side of a connection, like the XAConnection of
JDBC. Resin will use the returned ManagedConnection
to create the application connections, manage transactions,
and manage the pool.
The ConnectionRequestInfo is not used in this example.
When needed, the ConnectionFactoryImpl will create a
ConnectionRequestInfo and pass it to Resin with
the allocateConnection call.
Parameters: subject - security identifier of the application requestingthe connection. Parameters: reqInfo - connection-specific configuration information |
generateConnectionName | public String generateConnectionName()(Code) | | Returns the connection name.
|
getLogWriter | public PrintWriter getLogWriter()(Code) | | Logging should use JDK 1.4 java.util.logging.
|
getResourceAdapter | public ResourceAdapter getResourceAdapter()(Code) | | This connection factory does not have a separate resource adapter.
More complicated connection factories will have a
separate ResourceAdapter object to share state among multiple
connection factories and to manage threads, etc, using
the application server.
|
matchManagedConnections | public ManagedConnection matchManagedConnections(Set set, Subject subject, ConnectionRequestInfo reqInfo)(Code) | | A connection pool method which lets the connector choose which
idle connection are allowed to be reused for a request.
It returns a connection from the set matching the subject and request
info.
Many connectors can just return the first connection, if it doesn't
matter which connection is used. However, the pool might contain
connections with different configurations and subjects. This method
lets the connector return a connection that properly matches the
request.
Parameters: set - Resin's current pool of idle connections Parameters: subject - the application id asking for a connection Parameters: reqInfo - connector-specific information used to configurethe connection a connection matching the subject and reqInfo requirements ornull if none match |
setLogWriter | public void setLogWriter(PrintWriter out)(Code) | | Logging should use JDK 1.4 java.util.logging.
|
setName | public void setName(String name)(Code) | | Sets the name for the connector
|
setResourceAdapter | public void setResourceAdapter(ResourceAdapter ra)(Code) | | This connection factory does not have a separate resource adapter.
More complicated connection factories will have a
separate ResourceAdapter object to share state among multiple
connection factories and to manage threads, etc, using
the application server.
|
|
|