Package All Classes All Fields and Methods Deprecated


com.ibm.connector2.ims.ico
Class IMSConnectionFactory

java.lang.Object
  extended bycom.ibm.connector2.ims.ico.IMSConnectionFactory
All Implemented Interfaces:
javax.resource.cci.ConnectionFactory, javax.resource.Referenceable, javax.naming.Referenceable, java.io.Serializable

public class IMSConnectionFactory
extends java.lang.Object
implements javax.resource.cci.ConnectionFactory, java.io.Serializable, javax.resource.Referenceable

The IMSConnectionFactory class provides an interface for getting connections to IMS Connect and, in turn, IMS OTMA. Connections are represented by IMSConnection instances, and are application-level handles to underlying physical connections such as TCP/IP sockets or Local Option connections. An application that uses the Common Client Interface (CCI) can look up an IMSConnectionFactory instance from the JNDI namespace and then use it to get an IMSConnection instance. This method is typically used when running in the managed environment of an application server such as WebSphere. For example:

        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();		
 

See Also:
IMSConnection, IMSManagedConnectionFactory, Serialized Form

Constructor Summary
IMSConnectionFactory()
          Creates an IMSConnectionFactory instance.
IMSConnectionFactory(javax.resource.spi.ConnectionManager aConnectionManager)
          This constructor is used by IMSManagedConnectionFactory to create an IMSConnectionFactory instance.
 
Method Summary
 javax.resource.cci.Connection getConnection()
          Gets a connection to a particular IMS Connect instance and, in turn, to a particular IMS OTMA.
 javax.resource.cci.Connection getConnection(javax.resource.cci.ConnectionSpec aConnectionSpec)
          Gets a connection to a particular IMS Connect instance and, in turn, to a particular IMS OTMA.
 javax.resource.cci.ResourceAdapterMetaData getMetaData()
          Returns meta information about IMS Connector for Java, the resource adapter.
 javax.resource.cci.RecordFactory getRecordFactory()
          Gets a RecordFactory (not supported).
 javax.naming.Reference getReference()
           
 void 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()
Creates an IMSConnectionFactory instance.


IMSConnectionFactory

public IMSConnectionFactory(javax.resource.spi.ConnectionManager aConnectionManager)
This constructor is used by IMSManagedConnectionFactory to create an IMSConnectionFactory instance.

Parameters:
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
Gets a connection to a particular IMS Connect instance and, in turn, to a particular IMS OTMA. This variant of the getConnection() method is used when the component requires the container to manage sign-on to IMS Connect/IMS (which is called container-managed sign-on), and does not need to send any other IMSConnectionSpec properties such as clientID.

Specified by:
getConnection in interface javax.resource.cci.ConnectionFactory
Returns:
An IMSConnection instance.
Throws:
javax.resource.ResourceException - Failed to get an IMSConnection instance.
See Also:
IMSConnection

getConnection

public javax.resource.cci.Connection getConnection(javax.resource.cci.ConnectionSpec aConnectionSpec)
                                            throws javax.resource.ResourceException
Gets a connection to a particular IMS Connect instance and, in turn, to a particular IMS OTMA. This variant of the getConnection() method is used when a component needs to pass resource adapter specific security information and additional connection parameters.

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.

Specified by:
getConnection in interface javax.resource.cci.ConnectionFactory
Parameters:
aConnectionSpec - An IMSConnectionSpec instance containing security and/or connection information provided by the component.
Returns:
An IMSConnection instance.
Throws:
javax.resource.ResourceException -

If failed to get an IMSConnection instance.

See Also:
IMSConnection

getMetaData

public javax.resource.cci.ResourceAdapterMetaData getMetaData()
                                                       throws javax.resource.ResourceException
Returns meta information about IMS Connector for Java, the resource adapter. An invocation of this method does not require that an active connection to IMS via IMS Connect exists.

Specified by:
getMetaData in interface javax.resource.cci.ConnectionFactory
Returns:
An IMSResourceAdapterMetaData instance containing information about IMS Connector for Java.
Throws:
javax.resource.ResourceException

getRecordFactory

public javax.resource.cci.RecordFactory getRecordFactory()
                                                  throws javax.resource.ResourceException
Gets a RecordFactory (not supported).

Note: RecordFactory is not supported by IMS Connector for Java.

Specified by:
getRecordFactory in interface javax.resource.cci.ConnectionFactory
Returns:
A RecordFactory instance.
Throws:
javax.resource.ResourceExecption -

Note: The derived exception javax.resource.NotSupportedExecption is thrown by getRecordFactory().

javax.resource.ResourceException

getReference

public final javax.naming.Reference getReference()
                                          throws javax.naming.NamingException
Specified by:
getReference in interface javax.naming.Referenceable
Returns:
A javax.naming.Reference instance.
Throws:
javax.naming.NamingException

setReference

public final void setReference(javax.naming.Reference aRef)
Sets the reference instance.

Specified by:
setReference in interface javax.resource.Referenceable
Parameters:
aRef - The reference instance to set.

Package All Classes All Fields and Methods Deprecated