com.ibm.connector2.ims.ico
Class IMSConnectionFactory
- java.lang.Object
com.ibm.connector2.ims.ico.IMSConnectionFactory
- public class IMSConnectionFactory
- extends java.lang.Object
- implements java.io.Serializable
IMSConnectionFactory cf = null;
Context ctx = null;
// Create the initial context
ctx = new InitialContext();
// Get an IMSConnectionFactory instance.
cf = (IMSConnectionFactory) ctx.lookup("java:comp/env/myIMSTarget");
If JNDI is not configured, a CCI application can manually configure an IMSManagedConnectionFactory object and use it to obtain a connection factory. This method can be used in a non-managed environment such as running outside of an application server, in development mode, or when JNDI lookup fails.
IMSConnectionFactory cf = null;
IMSManagedConnectionFactory mcf = new IMSManagedConnectionFactory();
mcf.setHostName("myHostName");
mcf.setPortNumber(new Integer(9999));
mcf.setDataStoreName("myIMS");
...
cf = (IMSConnectionFactory) mcf.createConnectionFactory();
Constructor Summary
| Constructor and Description |
|---|
IMSConnectionFactory()
Creates an IMSConnectionFactory instance.
|
IMSConnectionFactory(javax.resource.spi.ConnectionManager aConnectionManager)
This constructor is used by
IMSManagedConnectionFactory
to create an IMSConnectionFactory instance.
|
Method Summary
| Modifier and Type | Method and Description |
|---|---|
|
getConnection()
Gets a connection to a particular IMS Connect
instance and, in turn, to a particular IMS OTMA.
|
|
getConnection(javax.resource.cci.ConnectionSpec aConnectionSpec)
Gets a connection to a particular IMS Connect
instance and, in turn, to a particular IMS OTMA.
|
|
getConnectionManager()
Returns a reference to the ConnectionManager.
|
|
getMetaData()
Returns meta information about IMS Connector for
Java, the resource adapter.
|
|
getRecordFactory()
Gets a RecordFactory (not supported).
|
|
getReference()
|
|
setReference(javax.naming.Reference aRef)
Sets the reference instance.
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail
IMSConnectionFactory
- public IMSConnectionFactory()
IMSConnectionFactory
- public IMSConnectionFactory(javax.resource.spi.ConnectionManager aConnectionManager)
aConnectionManager - The connection manager to be used
to manage the connections created
by this IMSConnectionFactory instance.
The Connection Manager could be DefaultConnectionManager
for the non-managed case or
a connection manager provided by
the application server in the
managed case. Method Detail
getConnection
- public javax.resource.cci.Connection getConnection( )
- throws javax.resource.ResourceException
javax.resource.ResourceException - Failed to get an IMSConnection
instance. getConnection
- public javax.resource.cci.Connection getConnection( javax.resource.cci.ConnectionSpec aConnectionSpec)
- throws javax.resource.ResourceException
- For the IMS resource adapter, security information includes userName, password, and groupName. This information is provided in the component-managed sign-on case.
- For the IMS resource adapter, additional connection parameters include the clientID. A value for clientID must be passed when the application is using a dedicated persistent socket connection to IMS Connect.
Both the security information and additional connection parameters are passed in an IMSConnectionSpec object.
Note: This will always be the version of getConnection used for component-managed sign-on.
aConnectionSpec - An IMSConnectionSpec instance
containing security and/or
connection information
provided by the component. javax.resource.ResourceException - If failed to get an IMSConnection instance.
getMetaData
- public ResourceAdapterMetaData getMetaData( )
- throws javax.resource.ResourceException
javax.resource.ResourceExceptiongetRecordFactory
- public RecordFactory getRecordFactory( )
- throws javax.resource.ResourceException
Note: RecordFactory is not supported by IMS TM Resource Adapter.
javax.resource.ResourceExecption - Note: The derived exception javax.resource.NotSupportedExecption is thrown by getRecordFactory().
javax.resource.ResourceExceptiongetReference
- public final javax.naming.Reference getReference( )
- throws javax.naming.NamingException
javax.naming.NamingExceptionsetReference
- public final void setReference( javax.naming.Reference aRef)
aRef - The reference instance to set. getConnectionManager
- public ConnectionManager getConnectionManager( )