com.ibm.connector2.ims.ico
Class IMSConnection
- java.lang.Object
com.ibm.connector2.ims.ico.IMSConnection
- public class IMSConnection
- extends java.lang.Object
An IMSConnection instance is an application-level handle that is used by a component to access an underlying physical connection to IMS Connect. IMS Connect in turn uses the Cross System Coupling Facility (XCF) to access IMS OTMA. A physical connection, such as a TCP/IP socket or Local Option connection, is represented by an IMSManagedConnection instance. An application that uses the Common Client Interface (CCI) obtains an IMSConnection instance by invoking the getConnection() method of an IMSConnectionFactory instance.
The variant of the getConnection() method that is used depends on how the the application is configured. For example:
- If an application uses component-managed sign-on, an IMSConnectionSpec object containing the security information must be provided to the getConnection() method.
Connection connection = null; // Populate an IMSConnectionSpec object IMSConnectionSpec aCSpec = new IMSConnectionSpec(); aCSpec.setUserName("myUserName"); aCSpec.setPassword("myPassword"); aCSpec.setGroupName("myGroupName"); // Obtain a connection handle connection = connectionFactory.getConnection(aCSpec);
Connection connection = null; // Populate an IMSConnectionSpec object IMSConnectionSpec aCSpec = new IMSConnectionSpec(); aCSpec.setClientID("CLIENT01"); // Obtain a connection handle connection = connectionFactory.getConnection(aCSpec);
Connection connection = null; // Obtain a connection handle connection = connectionFactory.getConnection();
Connection connection = null; IMSConnectionMetaData meta = (IMSConnectionMetaData)connection.getMetaData(); String clientID = meta.getClientID();
Constructor Summary
Constructor and Description |
---|
IMSConnection(ManagedConnection aManagedConnection)
Creates an IMSConnection instance as an application
handle to an IMSManagedConnection instance
representing a physical connection such as a TCP/IP
socket or a Local Option connection.
|
Method Summary
Modifier and Type | Method and Description |
---|---|
|
close()
Releases an allocated connection handle.
|
|
createInteraction()
Creates an IMSInteraction instance to use to
interact with IMS OTMA via IMS Connect.
|
getConnectionFactory()
|
|
|
getLocalTransaction()
Returns a LocalTransaction instance that enables
a component to demarcate resource manager
local transactions (not supported).
|
|
getMetaData()
Returns information about the IMS Connect and IMS
instances connected by an IMSConnection
instance.
|
|
getResultSetInfo()
Returns a ResultSetInfo object (not supported).
|
|
setConnectionFactory(IMSConnectionFactory connectionFactory)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail
IMSConnection
- public IMSConnection(ManagedConnection aManagedConnection)
aManagedConnection
- The instance representing
the physical connection
to IMS Connect. Method Detail
close
- public void close()
- throws javax.resource.ResourceException
javax.resource.ResourceException
- Note: The derived exception javax.resource.spi.IllegalStateException is thrown by close() if the IMSConnection instance is already closed.
createInteraction
- public javax.resource.cci.Interaction createInteraction( )
- throws javax.resource.ResourceException
javax.resource.ResourceException
- Note: The derived exception javax.resource.spi.IllegalStateException is thrown by createInteraction() when an attempt to create an IMSInteraction instance is made when the IMSConnection instance is already closed.
getLocalTransaction
- public javax.resource.cci.LocalTransaction getLocalTransaction( )
- throws javax.resource.ResourceException
Note: IMS TM Resource Adapter currently does not have local transaction support.
javax.resource.ResourceException
- Note: The derived exception javax.resource.NotSupportedException is thrown by getLocalTransaction().
getMetaData
- public javax.resource.cci.ConnectionMetaData getMetaData( )
- throws javax.resource.ResourceException
javax.resource.ResourceException
getResultSetInfo
- public javax.resource.cci.ResultSetInfo getResultSetInfo( )
- throws javax.resource.ResourceException
Note: ResultSetInfo is not supported by IMS TM Resource Adapter.
javax.resource.ResourceException
- Note: The derived exception javax.resource.NotSupportedException is thrown by getResultSetInfo(). .
getConnectionFactory
- public IMSConnectionFactory getConnectionFactory( )
setConnectionFactory
- public void setConnectionFactory( IMSConnectionFactory connectionFactory)
connectionFactory
- The connectionFactory to set.