com.ibm.connector2.hod
Class J2HODConnectionFactory

java.lang.Object
  |
  +--com.ibm.connector2.hod.J2HODConnectionFactory
All Implemented Interfaces:
javax.resource.cci.ConnectionFactory, javax.naming.Referenceable, javax.resource.Referenceable, java.io.Serializable

public class J2HODConnectionFactory
extends java.lang.Object
implements javax.resource.cci.ConnectionFactory, javax.resource.Referenceable

This is an application level handle to the Managed Connection Factory, returned from the JNDI lookup, and used to obtain connections. Subject to change once J2EE/CA specification includes Common Client Interfaces

See Also:
Serialized Form

Constructor Summary
J2HODConnectionFactory()
          Create an instance of J2HODConnection Factory.
J2HODConnectionFactory(javax.resource.spi.ConnectionManager aConnectionManager)
          Creates an instance of J2HODConnectionFactory and assigns a connectionManager.
 
Method Summary
 javax.resource.cci.Connection getConnection()
          Gets a connection to an EIS instance.
 javax.resource.cci.Connection getConnection(javax.resource.cci.ConnectionSpec aConnectionSpec)
          Gets a connection to an EIS instance.
 java.io.PrintWriter getLogWriter()
          Gets the log writer for the ConnectionFactory instance.
 javax.resource.spi.ManagedConnectionFactory getManagedConnectionFactory()
          Gets a ManagedConnectionFactory.
 javax.resource.cci.ResourceAdapterMetaData getMetaData()
          Gets metadata for the Resource Adapter.
 javax.resource.cci.RecordFactory getRecordFactory()
          This method is not supported.
 javax.naming.Reference getReference()
          Gets a naming reference.
 int getTimeout()
          This method is not supported.
 void setLogWriter(java.io.PrintWriter out)
          This method is not supported.
 void setReference(javax.naming.Reference ref)
          Sets naming reference.
 void setTimeout(int milliseconds)
          This method is not supported.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

J2HODConnectionFactory

public J2HODConnectionFactory()
Create an instance of J2HODConnection Factory.

J2HODConnectionFactory

public J2HODConnectionFactory(javax.resource.spi.ConnectionManager aConnectionManager)
Creates an instance of J2HODConnectionFactory and assigns a connectionManager.
Parameters:
aConnectionManager - javax.resource.spi.ConnectionManager - A connection manager
Method Detail

getConnection

public javax.resource.cci.Connection getConnection()
                                            throws javax.resource.ResourceException
Gets a connection to an EIS instance. This variant should be used when a component wants the container to manage EIS sign-on. The case is termed container-managed sign-on. The component does not pass any security information.
Specified by:
getConnection in interface javax.resource.cci.ConnectionFactory
Returns:
Connection
Throws:
javax.resource.ResourceException - - Failed to get the information for the EIS instance

getConnection

public javax.resource.cci.Connection getConnection(javax.resource.cci.ConnectionSpec aConnectionSpec)
                                            throws javax.resource.ResourceException
Gets a connection to an EIS instance. This variant is used when a component wants to manage the EIS sign-on itself if it needs to pass any resource adapter specific information and connection parameters. A component can also use this getConnection variant if it wants to pass any resource adapter-specific connection parameters in the container-managed sign-on case.

A client should use java.util.Map to pass resource adapter specific security information and connection parameters.

The connector architecture defines a set of standard properties - ServerName, PortNumber, UserName, Password, ConnectionURL - that can be passed to the getConnection method. In addition, a resource adapter can define additional properties specific to its underlying EIS.

Specified by:
getConnection in interface javax.resource.cci.ConnectionFactory
Parameters:
properties - - connection parameters and security information specified as map
Returns:
Connection
Throws:
javax.resource.ResourceException - - Failed to get a connection to the EIS instance

getLogWriter

public java.io.PrintWriter getLogWriter()
                                 throws javax.resource.ResourceException
Gets the log writer for the ConnectionFactory instance.

The log writer is a character output stream to which all logging and tracing messages for this connection factory instance will be printed. When a ConnectionFactory object is created the log writer is initially null, meaning that logging is disabled.

Specified by:
getLogWriter in interface javax.resource.cci.ConnectionFactory
Returns:
PrintWriter - a log writer associated with the ConnectionFactory
Throws:
javax.resource.ResourceException - - Failed to get the log writer for the ConnectionFactory

getManagedConnectionFactory

public javax.resource.spi.ManagedConnectionFactory getManagedConnectionFactory()
Gets a ManagedConnectionFactory.
Returns:
javax.resource.ManagedConnectionFactory

getMetaData

public javax.resource.cci.ResourceAdapterMetaData getMetaData()
                                                       throws javax.resource.ResourceException
Gets metadata for the Resource Adapter. Note that the metadata information is about the ResourceAdapter and not the EIS instance. An invocation of this method does not require that an active connection to an EIS instance should have been established.
Specified by:
getMetaData in interface javax.resource.cci.ConnectionFactory
Throws:
javax.resource.ResourceException - - Failed to get information about the resource adapter.

getRecordFactory

public javax.resource.cci.RecordFactory getRecordFactory()
                                                  throws javax.resource.NotSupportedException
This method is not supported.
Specified by:
getRecordFactory in interface javax.resource.cci.ConnectionFactory
Throws:
javax.resource.NotSupportedException - - Method not supported

getReference

public javax.naming.Reference getReference()
Gets a naming reference.
Specified by:
getReference in interface javax.naming.Referenceable
Returns:
javax.naming.Reference

getTimeout

public int getTimeout()
               throws javax.resource.ResourceException
This method is not supported.
Specified by:
getTimeout in interface javax.resource.cci.ConnectionFactory
Throws:
javax.resource.NotSupportedException - - Method not supported

setLogWriter

public void setLogWriter(java.io.PrintWriter out)
                  throws javax.resource.ResourceException
This method is not supported.
Specified by:
setLogWriter in interface javax.resource.cci.ConnectionFactory
Throws:
javax.resource.NotSupportedException - - Method not supported

setReference

public void setReference(javax.naming.Reference ref)
Sets naming reference.
Specified by:
setReference in interface javax.resource.Referenceable
Parameters:
ref - javax.naming.Reference

setTimeout

public void setTimeout(int milliseconds)
                throws javax.resource.ResourceException
This method is not supported.
Specified by:
setTimeout in interface javax.resource.cci.ConnectionFactory
Throws:
javax.resource.NotSupportedException - - Method not supported