Class CobolLocalTxManagedConnectionFactory

This ManagedConnectionFactory implementation class implements the LocalTransaction support. This is used by the App Server to create and match managed connections.
Restriction: This topic applies only when the Enterprise Server feature is enabled.
java.lang.Object

extended by com.microfocus.cobol.connector.spi.CobolLocalTxManagedConnectionFactory

Class Specifications

public class CobolLocalTxManagedConnectionFactory

extends Object

implements ManagedConnectionFactory, ResourceAdapterAssociation, Serializable

See Also:

Serialized Form

Field Summary

Constructor Summary

CobolLocalTxManagedConnectionFactory()
Create a Local TX Managed Connection Factory instance.

Methods

Method Summary
void setResourceAdapter(ResourceAdapter ra)
ResourceAdapter getResourceAdapter(ConnectionManager ra)
Object createConnectionFactory(cxManager)

Create a ConnectionFactory with a Connection Manager instance.

ManagedConnection createManagedConnection(Subject subject, ConnectionRequestInfo info)

Create a managed connection to Cobol Server.

ManagedConnection matchManagedConnections(Set connectionSet, Subject subject, ConnectionRequestInfo info)

Match Managed Connections. The App Server calls this function to match a connection from the set of connections. The match is based on security credentials.

void setLogWriter(PrintWriter out)

Set log writer.

void getLogWriter()

Get log writer.

boolean equals(Object obj)
int hashcode()
void setServerHost(String serverHost)

Set the server host.

String getServerHost()

Get the server host.

void setServerPort(String serverPort)

Set the server port.

String getServerPort()

Get the server port.

void setLogHost(String logHost)

Set the log host.

String getLogHost()

Get the log host.

void setLogPort(String logPort)

Set the log port.

String getLogPort()

Get the log port.

void setTrace(Boolean trace)

Set tracing.

Boolean getTrace()

Check if tracing is enabled.

void setSecureGUID(Boolean s)

Set secure GUID.

Boolean getSecureGUID()

Get secure GUID

void setReadTimeoutInSeconds(Integer readTimeoutInSeconds)

Set ReadTimeoutInSeconds

Integer getReadTimeoutInSeconds()

Get ReadTimeoutInSeconds

Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Field Detail

serverHost
protected String serverHost
serverPort
protected String serverPort
logHost
protected String logHost
logPort
protected String logPort
trace
protected Boolean trace
secureGUID
protected Boolean secureGUID
readTimeoutInSeconds
protected Integer readTimeoutInSeconds

Constructor Detail

CobolLocalTxManagedConnectionFactory
public CobolLocalTxManagedConnectionFactory

Create a Local TX Managed Connection Factory instance.

Method Detail

setResourceAdapter
public void setResourceAdapter(ResourceAdapter ra)
                  throws ResourceException
Specified by:
setResourceAdapter in interface ResourceAdapterAssociation
Throws:
ResourceException
getResourceAdapter
public ResourceAdapter getResourceAdapter(ConnectionManager ra)
                                   throws ResourceException)
Specified by:
getResourceAdapter in interface ResourceAdapterAssociation
createConnectionFactory
public Object createConnectionFactory(cxManager)

Create a ConnectionFactory with a Connection Manager instance.

Specified by:
createConnectionFactory in interface ManagedConnectionFactory
Parameters:
cxManager The connection Manager Instance. In a managed connection case, the app server supplies the connection manager.
Returns:
An instance of ConnectionFactory
Throws:
ResourceException
createManagedConnection
public ManagedConnection createManagedConnection(Subject subject,
                                                 ConnectionRequestInfo info)
                                          throws ResourceException

Create a managed connection to Cobol Server.

Specified by:
createManagedConnection in interface ManagedConnectionFactory
Parameters:
subject The subject instance.
info Connection request information.
Returns:
A Managed Connection instance if successful; null otherwise.
Throws:
ResourceException
matchManagedConnections
public ManagedConnection matchManagedConnections(Set connectionSet,
                                                 Subject subject,
                                                 ConnectionRequestInfo info)
                                          throws ResourceException

Match Managed Connections. The App Server calls this function to match a connection from the set of connections. The match is based on security credentials.

Specified by:
matchManagedConnections in interface ManagedConnectionFactory
Parameters:
connectionSet The connection pool of Managed Connections
subject The subject instance.
info Connection request information.
Returns:
A matched managed connection; null if not successful.
Throws:
ResourceException
setLogWriter
public void setLogWriter(PrintWriter out)
                  throws ResourceException

Set log writer.

Specified by:
setLogWriter in interface ManagedConnectionFactory
Parameters:
out PrintWriter instance.
Throws:
ResourceException
getLogWriter
public void getLogWriter()
                  throws ResourceException

Get log writer.

Specified by:
getLogWriter in interface ManagedConnectionFactory
Returns:
A PrintWriter instance.
Throws:
ResourceException
equals
public boolean equals (Object obj)
Specified by:
equals in interface ManagedConnectionFactory
hashCode
public int hashCode()
Specified by:
hashCode in interface ManagedConnectionFactory
setServerHost
public void setServerHost (String serverHost)

Set the server host.

Parameters:
serverHost
getServerHost
public String getServerHost()

Get the server host.

Returns:
The server host.
setServerPort
public void setServerPort(String serverPort)

Set the server port.

Parameters:
serverPort
getServerPort
public String getServerPort()

Get the server port.

Returns:
The server port.
setLogHost
public void setLogHost(String logHost)

Set the log host.

Parameters:
logHost
getLogHost
public String getLogHost()

Get the log host.

Returns:
The log host.
setLogPort
public void setLogPort(String logPort)

Set the log port

Parameters:
logPort
getLogPort
public String getLogPort()

Get the log port.

Returns:
The log port.
setTrace
public void setTrace(Boolean trace)

Set tracing.

Parameters:
trace
getTrace
public Boolean getTrace()

Check if tracing is enabled.

Returns:
true if it does; false otherwise
setSecureGUID
public void setSecureGUID(Boolean s)

Set secure GUID.

Parameters:
s
getSecureGUID
public Boolean getSecureGUID()

Check if secure GUID is enabled.

Returns:
true if it does; false otherwise
setReadTimeoutInSeconds
public void setReadTimeoutInSeconds(Integer readTimeoutInSeconds)

Set ReadTimeoutInSeconds.

Parameters:
readTimeoutInSeconds
getReadTimeoutInSeconds
public Integer getReadTimeoutInSeconds()

Get ReadTimeoutInSeconds

Returns:
readTimeoutInSeconds