|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ikasan.client.ConnectionTemplate
public class ConnectionTemplate
Similar in style to Spring's JMSTemplate, this code ensures that all code mean to run against a JCA connection will be supplied with a Connection from the ConnectionFactory, ensuring that that Connection is safely closed when done, regardless of the way the routine completes
| Constructor Summary | |
|---|---|
ConnectionTemplate(javax.resource.cci.ConnectionFactory connectionFactory,
javax.resource.cci.ConnectionSpec connectionSpec)
Constructor |
|
| Method Summary | |
|---|---|
static void |
closeConnection(javax.resource.cci.Connection connection)
Closes the connection, suppressing any exceptions |
Object |
execute(ConnectionCallback action)
Execute the action specified by the given action object with a Connection. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ConnectionTemplate(javax.resource.cci.ConnectionFactory connectionFactory,
javax.resource.cci.ConnectionSpec connectionSpec)
connectionFactory - The factory for the connectionsconnectionSpec - The connection spec| Method Detail |
|---|
public Object execute(ConnectionCallback action)
throws javax.resource.ResourceException
action - callback object that exposes the Connection
javax.resource.ResourceException - if there is any problempublic static void closeConnection(javax.resource.cci.Connection connection)
connection - - possibly null, not necessarily open
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||