IBM WebSphere Adapters Network Card User Manual


 
public Object createConnectionFactory(ConnectionManager connMgr) throws
ResourceException
{
return new TwineBallConnectionFactory(connMgr, this);
}
2. ManagedConnection createManagedConnection(Subject,
ConnectionRequestInfo)
This method is used by the JCA container to acquire a physical connection to
the EIS instance. Subclass implementation should return a EIS-specific
ManagedConnection instance which is a subclass of WBIManagedConnection.
public javax.resource.spi.ManagedConnection createManagedConnection(
javax.security.auth.Subject subject,
javax.resource.spi.ConnectionRequestInfo connReqInfo)
throws javax.resource.ResourceException
{
return new TwineBallManagedConnection(this, subject,
(WBIConnectionRequestInfo) connectionRequestInfo,
this.getResourceAdapter());
}
WBIManagedConnection:
WBIManagedconnection is an abstract class which implements
javax.resource.spi.ManagedConnection. A javax.resource.spi.ManagedConnection
instance represents a physical connection to the underlying EIS. The
WBIManagedConnection instance implements methods that enable the JCA
container to monitor its status and manage its life cycle.
Subclass methods to implement
1. public ManagedConnection(WBIManagedConnectionFactory mcf, Subject
subject, WBIConnectionRequestInfo)
This constructor should connect to the EIS instance and maintain a handle to
the connection as a property in the ManagedConnection. This method also
must call super to ensure that the credentials are present for later matching.
2. ManagedConnectionMetaData getMetaData()
Create and return a new instance of WBIManagedConnectionMetadata by
passing the EIS specific details such as product name, product version,
maximum connections and user name.
public ManagedConnectionMetaData getMetaData()
throws ResourceException
{
return new WBIManagedConnectionMetaData("TwineBall","0.2",200,userID);
}
3. Object getWBIConnection(PasswordCredential, boolean)
If reauthentication is supported, implementation should perform an EIS-specific
sign-on based on the credentials passed. Otherwise, it should return a CCI
handle to this managed connection.
public java.lang.Object getWBIConnection( javax.resource.spi.security.PasswordCredential arg0,
boolean reauthenticate)
throws javax.resource.ResourceException
{
return new TwineBallConnection(this);
}
4. destroy()
This method should close this connection to the EIS and release any resources.
100 WebSphere Adapters: WebSphere Adapter Toolkit User Guide