|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.stc.connector.framework.jca.system.STCManagedConnection
This class implements the ManagedConnection interface which represents a physical connection to the underlying EIS. A ManagedConnection instance provides access to a pair of interfaces: javax.transaction.xa.XAResource and javax.resource.spi.LocalTransaction. XAResource interface is used by the transaction manager to associate and dissociate a transaction with the underlying EIS resource manager instance and to perform two-phase commit protocol. The ManagedConnection interface is not directly used by the transaction manager. More details on the XAResource interface are described in the JTA specification. The LocalTransaction interface is used by the application server to manage local transactions. This class also implments the ManagedConnectionCallback interface so that the EwayConnection associated with the ManagedConnection can get services from the ManagedConnection.
| Constructor Summary | |
STCManagedConnection(STCManagedConnectionFactory mcf,
javax.security.auth.Subject subject,
STCPropertiesInfo cri)
No-args constructor needed so subclasses can use constructors with different signatures. |
|
| Method Summary | |
void |
addConnectionEventListener(javax.resource.spi.ConnectionEventListener connectionEventListener)
Adds a connection event listener to the ManagedConnection instance. |
void |
addConnectionHandle(AssociateableHandle connHandle)
Adds a connection handle to the ManagedConnection instance. |
void |
associateConnection(java.lang.Object obj)
Used by the container to change the association of an application-level connection handle with a ManagedConneciton instance. |
void |
cleanup()
Application server calls this method to force any cleanup on the ManagedConnection instance. |
void |
createMBean(java.lang.String mbeanClassName,
java.lang.String mbeanName)
Creates the MBean |
void |
destroy()
Destroys the physical connection to the underlying resource manager. |
java.lang.Object |
getConnection(javax.security.auth.Subject subject,
javax.resource.spi.ConnectionRequestInfo cri)
Creates a new connection handle for the underlying physical connection represented by the ManagedConnection instance. |
int |
getConnectionHandleCount()
Gets the current number active connection handles associated with an instance of ManagedConnection. |
EwayConnection |
getEwayConnection()
Get the EwayConnection instance associated with the ManagedConnection instance. |
javax.resource.spi.LocalTransaction |
getLocalTransaction()
Returns an javax.resource.spi.LocalTransaction instance. |
java.io.PrintWriter |
getLogWriter()
Gets the log writer for this ManagedConnection instance. |
javax.resource.spi.ManagedConnection |
getManagedConnection()
Get the ManagedConnection instance associated with the ManagedConnectionCallback instance. |
STCManagedConnectionFactory |
getManagedConnectionFactory()
Get the ManagedConnectionFactory which created this instance of ManagedConnection. |
java.lang.Object |
getMBean()
Getter for ManagedConnection's MBean |
javax.resource.spi.ManagedConnectionMetaData |
getMetaData()
Gets the metadata information for this connection's underlying EIS resource manager instance. |
javax.transaction.xa.XAResource |
getXAResource()
Returns an javax.transaction.xa.XAresource instance. |
boolean |
matchConnection(javax.security.auth.Subject subject,
javax.resource.spi.ConnectionRequestInfo cri)
Determines whether this instance of the ManagedConnection matches the the connection request with the connection information in Subject and/or ConnectionRequestInfo. |
void |
notifyConnectionEvent(javax.resource.spi.ConnectionEvent event)
Notify the ManagedConnection associated with the EwayConnection instance that a connection event had occurred. |
protected void |
postDestroy()
Last chance to do anything else after the ManagedConnection is destroyed. |
protected void |
preDestroy()
Performs any special operations before the ManagedConnection instance is destroyed. |
void |
removeConnectionEventListener(javax.resource.spi.ConnectionEventListener connectionEventListener)
Removes a connection event listener from the ManagedConnection instance. |
void |
removeConnectionHandle(AssociateableHandle connHandle)
Removes a connection handle from the ManagedConnection instance. |
void |
setLogWriter(java.io.PrintWriter out)
Sets the log writer for this ManagedConnection instance. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public STCManagedConnection(STCManagedConnectionFactory mcf,
javax.security.auth.Subject subject,
STCPropertiesInfo cri)
throws javax.resource.ResourceException
mcf - DOCUMENT ME!subject - DOCUMENT ME!cri - DOCUMENT ME!
javax.resource.ResourceException - DOCUMENT ME!| Method Detail |
public void addConnectionEventListener(javax.resource.spi.ConnectionEventListener connectionEventListener)
addConnectionEventListener in interface javax.resource.spi.ManagedConnectionconnectionEventListener - An instance of ConnectionEventListener to
register for event notifications.public void removeConnectionEventListener(javax.resource.spi.ConnectionEventListener connectionEventListener)
removeConnectionEventListener in interface javax.resource.spi.ManagedConnectionconnectionEventListener - An instance of ConnectionEventListener to
uregister.public void addConnectionHandle(AssociateableHandle connHandle)
addConnectionHandle in interface ManagedConnectionCallbackconnHandle - An connection handle which implements the
AssociateableHandle.public void removeConnectionHandle(AssociateableHandle connHandle)
removeConnectionHandle in interface ManagedConnectionCallbackconnHandle - An connection handle which implements the
AssociateableHandle.
public java.lang.Object getConnection(javax.security.auth.Subject subject,
javax.resource.spi.ConnectionRequestInfo cri)
throws javax.resource.ResourceException
getConnection in interface javax.resource.spi.ManagedConnectionsubject - The Subject provided by the container which can be used
for reauthentication if the EIS supports reauthentication.cri - The ConnectionRequestInfo containing additional information
which can be used for sign on.
javax.resource.ResourceException - - generic exception if operation fails
public void associateConnection(java.lang.Object obj)
throws javax.resource.ResourceException
associateConnection in interface javax.resource.spi.ManagedConnectionobj - An opague connection handle Object instance which must
implement AssociateableHandle.
javax.resource.ResourceException - - Failed to associate the connection handle
with this ManagedConnection instance
public void cleanup()
throws javax.resource.ResourceException
cleanup in interface javax.resource.spi.ManagedConnectionjavax.resource.ResourceException - - generic exception if operation fails
public void destroy()
throws javax.resource.ResourceException
destroy in interface javax.resource.spi.ManagedConnectionjavax.resource.ResourceException - - generic exception if operation failed
protected void preDestroy()
throws javax.resource.ResourceException
javax.resource.ResourceException - - generic exception if operation failedprotected void postDestroy()
public javax.resource.spi.LocalTransaction getLocalTransaction()
throws javax.resource.ResourceException
getLocalTransaction in interface javax.resource.spi.ManagedConnectionjavax.resource.ResourceException - - generic exception if operation fails
public javax.transaction.xa.XAResource getXAResource()
throws javax.resource.ResourceException
getXAResource in interface javax.resource.spi.ManagedConnectionjavax.resource.ResourceException - - generic exception if operation fails
public javax.resource.spi.ManagedConnectionMetaData getMetaData()
throws javax.resource.ResourceException
getMetaData in interface javax.resource.spi.ManagedConnectionjavax.resource.ResourceException - - generic exception if operation fails
public java.io.PrintWriter getLogWriter()
throws javax.resource.ResourceException
getLogWriter in interface javax.resource.spi.ManagedConnectionjavax.resource.ResourceException - DOCUMENT ME!
public void setLogWriter(java.io.PrintWriter out)
throws javax.resource.ResourceException
setLogWriter in interface javax.resource.spi.ManagedConnectionout - Character Output stream to be associated.
javax.resource.ResourceException - DOCUMENT ME!public void notifyConnectionEvent(javax.resource.spi.ConnectionEvent event)
notifyConnectionEvent in interface ManagedConnectionCallbackevent - A ConnectionEvent instance containing the event that had
occurred.public EwayConnection getEwayConnection()
getEwayConnection in interface ManagedConnectionCallbackpublic STCManagedConnectionFactory getManagedConnectionFactory()
public boolean matchConnection(javax.security.auth.Subject subject,
javax.resource.spi.ConnectionRequestInfo cri)
subject - The Subject instance which holds the credentials for EIS
signon.cri - The ConnectionRequestInfo instance which holds both EIS EIS
signon information or general connection specific information.
The ConnectionRequestInfo provided will contain the union of the
properties from the client connection request properties, the
ResourceAdapter properties, and the ManagedConnectionFactory
properties.
public int getConnectionHandleCount()
getConnectionHandleCount in interface ManagedConnectionCallbackpublic javax.resource.spi.ManagedConnection getManagedConnection()
getManagedConnection in interface ManagedConnectionCallbackpublic java.lang.Object getMBean()
getMBean in interface STCManagedMaster
public void createMBean(java.lang.String mbeanClassName,
java.lang.String mbeanName)
throws STCCreateMBeanException
createMBean in interface STCManagedMastermbeanClassName - classname of MBean impl classmbeanName - name of MBean
STCCreateMBeanException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||