com.sun.emp.cci.eci
Class ECIManagedConnectionFactory

java.lang.Object
  |
  +--com.sun.emp.cci.eci.ECIManagedConnectionFactory
All Implemented Interfaces:
ManagedConnectionFactory, Serializable

public class ECIManagedConnectionFactory
extends Object
implements ManagedConnectionFactory

The ECI Managed Connection Factory.

This class is the root of all connection management for both managed and unmanaged environments.

Managed Environment

For a managed environment, an instance of this class is created by the container, and it is used by that container to create ConnectionFactorys. This process is hidden from the application. For this environment, the application should deal with the ConnectionFactory obtained from a JNDI lookup.

Unmanaged Environment

For an unmanaged environment, the application is responsible for the construction and configuration of an object of this class. It is from this object that the application creates a connection factory and thus obtains a connection.

The default values for the properties of this object are:

regionName
"" (Empty)
nameServiceHost
"localhost"
nameServicePort
1050


Constructor Summary
ECIManagedConnectionFactory()
          Default constructor.
 
Method Summary
 Object createConnectionFactory()
          Create a connection factory using a default connection manager.
 Object createConnectionFactory(ConnectionManager connectionManager)
          Create a connection factory.
 ManagedConnection createManagedConnection(Subject subject, ConnectionRequestInfo cri)
          This method is not useful in an unmanaged environment.
 boolean equals(Object other)
           
 PrintWriter getLogWriter()
          Get the destination for debug information.
 String getNameServiceHost()
          Get the name of the host upon which the COD Name Service is located.
 Integer getNameServicePort()
          Get the port number upon which the COS Name Service is listening.
 String getRegionName()
          Get the name of the region to communicate with.
 int hashCode()
           
 ManagedConnection matchManagedConnections(Set connectionSet, Subject subject, ConnectionRequestInfo cxRequestInfo)
          This method is not useful in an unmanaged environment.
 void setLogWriter(PrintWriter out)
          Set the destination for debug information.
 void setNameServiceHost(String nameServiceHost)
          Set the name of the host upon which the COS Name Service is located.
 void setNameServicePort(Integer nameServicePort)
          Set the port number upon which the COS Name Service is listening.
 void setRegionName(String regionName)
          Set the name of the region to communicate with.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ECIManagedConnectionFactory

public ECIManagedConnectionFactory()
Default constructor.

Method Detail

setRegionName

public void setRegionName(String regionName)
Set the name of the region to communicate with.

This name is that registered by the CCI Gateway in the COS Name Server.

Parameters:
regionName - The name of the region

getRegionName

public String getRegionName()
Get the name of the region to communicate with.

Returns:
The region name

setNameServiceHost

public void setNameServiceHost(String nameServiceHost)
Set the name of the host upon which the COS Name Service is located.

Parameters:
nameServiceHost - The name of host

getNameServiceHost

public String getNameServiceHost()
Get the name of the host upon which the COD Name Service is located.

Returns:
The name of host

setNameServicePort

public void setNameServicePort(Integer nameServicePort)
Set the port number upon which the COS Name Service is listening.

Parameters:
nameServicePort - The port number

getNameServicePort

public Integer getNameServicePort()
Get the port number upon which the COS Name Service is listening.

Returns:
The port number

createConnectionFactory

public Object createConnectionFactory(ConnectionManager connectionManager)
                               throws ResourceException
Create a connection factory.

Specified by:
createConnectionFactory in interface ManagedConnectionFactory
Parameters:
connectionManager - The connection manager controlling the creation of connections.
Returns:
An instance of ECIConnectionFactory
ResourceException
See Also:
ECIConnectionFactory

createConnectionFactory

public Object createConnectionFactory()
                               throws ResourceException
Create a connection factory using a default connection manager.

Specified by:
createConnectionFactory in interface ManagedConnectionFactory
Returns:
An instance of ECIConnectionFactory
ResourceException
See Also:
ECIConnectionFactory

createManagedConnection

public ManagedConnection createManagedConnection(Subject subject,
                                                 ConnectionRequestInfo cri)
                                          throws ResourceException
This method is not useful in an unmanaged environment. Please do not call this method directly. It exists for use by containers in a managed environment.

Specified by:
createManagedConnection in interface ManagedConnectionFactory
ResourceException

matchManagedConnections

public ManagedConnection matchManagedConnections(Set connectionSet,
                                                 Subject subject,
                                                 ConnectionRequestInfo cxRequestInfo)
                                          throws ResourceException
This method is not useful in an unmanaged environment. Please do not call this method directly. It exists for use by containers in a managed environment.

Specified by:
matchManagedConnections in interface ManagedConnectionFactory
ResourceException

equals

public boolean equals(Object other)
Specified by:
equals in interface ManagedConnectionFactory
Overrides:
equals in class Object

hashCode

public int hashCode()
Specified by:
hashCode in interface ManagedConnectionFactory
Overrides:
hashCode in class Object

setLogWriter

public void setLogWriter(PrintWriter out)
                  throws ResourceException
Set the destination for debug information.

Specified by:
setLogWriter in interface ManagedConnectionFactory
Parameters:
out - The destination
ResourceException

getLogWriter

public PrintWriter getLogWriter()
                         throws ResourceException
Get the destination for debug information.

Specified by:
getLogWriter in interface ManagedConnectionFactory
Returns:
The destination
ResourceException