|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.mulesoft.adapter.ra.SPIManagedConnection
public class SPIManagedConnection
A SpiManagedConnection represents a physical, managed connection
from the resource adapter to the connected external system. In this sample
resource adapter it represents a simple file.
| Method Summary | |
|---|---|
void |
addCciConnection(CCIConnection cciCon)
Adds a CCI connection in order to operate on this managed connection (ra implementation specific) |
void |
addConnectionEventListener(javax.resource.spi.ConnectionEventListener listener)
Store a new connection event listener (instantiated by the (J2EE server) container) for this managed connection. |
void |
associateConnection(Object connection)
Associate a previously created CCI connection to this managed connection (SPI JCA 1.0) |
void |
cleanup()
Cleanups this managed connection. |
IPILogger |
createLogger(com.sap.engine.interfaces.messaging.api.Message message)
|
void |
destroy()
Destroys the underlying physical connection (i.e. |
Object |
getConnection(Subject subject,
javax.resource.spi.ConnectionRequestInfo info)
Returns a CCI connection that operates on this managed connection. |
javax.resource.spi.LocalTransaction |
getLocalTransaction()
Get the JCA local transaction if this kind of transaction is supported by the adapter. |
PrintWriter |
getLogWriter()
Gets the JCA J2EE logwriter PrintWriter object. |
javax.resource.spi.ManagedConnectionFactory |
getManagedConnectionFactory()
Returns the associated ManagedConnectionFactory
(ra implementation specific) |
javax.resource.spi.ManagedConnectionMetaData |
getMetaData()
Returns the descriptive and configuration data for this managed connection as ManagedConnectionMetaData. |
PIModule |
getModule()
|
boolean |
getSupportsLocalTx()
Returns true if local transactions are supported. |
XAResource |
getXAResource()
Get the two-way JTA transaction if this kind of transaction is supported by the adapter. |
void |
removeCciConnection(CCIConnection cciCon)
Removes a CCI connection which operates on this managed connection (ra implementation specific) |
void |
removeConnectionEventListener(javax.resource.spi.ConnectionEventListener listener)
Remove a connection event listener (instantiated by the (J2EE server) container) from this managed connection. |
void |
sendEvent(int eventType,
Exception ex)
Sends a ConnectionEvent to all registered
ConnectionEventListeners. |
void |
sendEvent(int eventType,
Exception ex,
Object connectionHandle)
Sends a ConnectionEvent to all registered
ConnectionEventListeners. |
void |
setLogWriter(PrintWriter out)
Sets the JCA J2EE logwriter PrintWriter object. |
void |
setManagedConnectionFactory(SPIManagedConnectionFactory mcf)
Assignes this ManagedConnection to a (new)
ManagedConnectionFactory
(ra implementation specific) |
void |
setSupportsLocalTx(boolean ltx)
Switches on the support of local transactions. |
void |
start()
Propagates the start request to the mcf (ra implementation specific) |
void |
stop()
Propagates the stop request to the mcf (ra implementation specific) |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public IPILogger createLogger(com.sap.engine.interfaces.messaging.api.Message message)
public final PIModule getModule()
public void setSupportsLocalTx(boolean ltx)
throws javax.resource.NotSupportedException
ltx - True, if local transactions must be supported, else false.
Must be false currently.
javax.resource.NotSupportedException - If supportsLocalTx equals true since local transactions are
currently not supportedpublic boolean getSupportsLocalTx()
public void setManagedConnectionFactory(SPIManagedConnectionFactory mcf)
ManagedConnection to a (new)
ManagedConnectionFactory
(ra implementation specific)
mcf - ManagedConnectionFactory to which this connection
must be assigned topublic javax.resource.spi.ManagedConnectionFactory getManagedConnectionFactory()
ManagedConnectionFactory
(ra implementation specific)
ManagedConnectionFactory
public Object getConnection(Subject subject,
javax.resource.spi.ConnectionRequestInfo info)
throws javax.resource.ResourceException
CciConnection object is always created newly. The
credentials must be equal to the one which was used when the
ManagedConnectionFactory was created. (SPI JCA 1.0)
getConnection in interface javax.resource.spi.ManagedConnectionSecurityException - Subject does not fit to the original specified credentials
javax.resource.ResourceException - CCI connection cannot be created
IllegalStateException - Managed connection is already destroyed
public void destroy()
throws javax.resource.ResourceException
destroy in interface javax.resource.spi.ManagedConnectionjavax.resource.ResourceException - CCI connection cannot be invalidated or file cannot be closed
public void cleanup()
throws javax.resource.ResourceException
cleanup in interface javax.resource.spi.ManagedConnectionjavax.resource.ResourceException - CCI connection cannot be invalidated or file cannot be closed
public void associateConnection(Object connection)
throws javax.resource.ResourceException
associateConnection in interface javax.resource.spi.ManagedConnectionconnection - CciConnection which has to be assigned to this managed
connection
IllegalStateException - connection is not instanceof CciConnection
javax.resource.ResourceExceptionpublic void addConnectionEventListener(javax.resource.spi.ConnectionEventListener listener)
addConnectionEventListener in interface javax.resource.spi.ManagedConnectionlistener - ConnectionEventListener to store.public void removeConnectionEventListener(javax.resource.spi.ConnectionEventListener listener)
removeConnectionEventListener in interface javax.resource.spi.ManagedConnectionlistener - ConnectionEventListener to remove.
public XAResource getXAResource()
throws javax.resource.ResourceException
XAResources it throws always an exception. (SPI JCA 1.0)
getXAResource in interface javax.resource.spi.ManagedConnectionXAResource to remove.
javax.resource.NotSupportedException - Always thrown
javax.resource.ResourceException
public javax.resource.spi.LocalTransaction getLocalTransaction()
throws javax.resource.ResourceException
LocalTransaction it throws always an exception. (SPI JCA
1.0)
getLocalTransaction in interface javax.resource.spi.ManagedConnectionXAResource to remove.
javax.resource.NotSupportedException - Always thrown
javax.resource.ResourceException
public javax.resource.spi.ManagedConnectionMetaData getMetaData()
throws javax.resource.ResourceException
ManagedConnectionMetaData. (SPI JCA 1.0)
getMetaData in interface javax.resource.spi.ManagedConnectionIllegalStateException - Thrown if connection is already deleted
javax.resource.ResourceException
public void setLogWriter(PrintWriter out)
throws javax.resource.ResourceException
PrintWriter object. Although JCA
specifies this mechansim it is not being used by XI AF. Instead the
resource adapters should use the XI AF trace service classes as done here
in this sample.
(SPI JCA 1.0)
setLogWriter in interface javax.resource.spi.ManagedConnectionout - PrintWriter print writer for logging purposes
javax.resource.ResourceException
public PrintWriter getLogWriter()
throws javax.resource.ResourceException
PrintWriter object. (SPI JCA
1.0)
getLogWriter in interface javax.resource.spi.ManagedConnectionPrintWriter print writer for logging purposes
javax.resource.ResourceException
public void sendEvent(int eventType,
Exception ex)
ConnectionEvent to all registered
ConnectionEventListeners. (ra implementation specific)
eventType - One of the ConnectionEvent event typesex - Exception if event is related to an exception, might be
null
public void sendEvent(int eventType,
Exception ex,
Object connectionHandle)
ConnectionEvent to all registered
ConnectionEventListeners. (ra implementation specific)
eventType - One of the ConnectionEvent event typesex - Exception if event is related to an exception, might be
nullconnectionHandle - An object that represents the "handle" to the
ManagedConnection, might be nullpublic void addCciConnection(CCIConnection cciCon)
cciCon - CCI connection to addpublic void removeCciConnection(CCIConnection cciCon)
cciCon - CCI connection which must be removed
public void start()
throws javax.resource.ResourceException
javax.resource.ResourceException
public void stop()
throws javax.resource.ResourceException
javax.resource.ResourceException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||