Class CobolConnection

CobolConnection class represents an application level connection handle that is used by a component to access a Cobol Server instance.
Restriction: This topic applies only when the Enterprise Server feature is enabled.
java.lang.Object

extended bycom.microfocus.cobol.connector.cci.CobolConnection

All Implemented Interfaces

Connection, MFCobolConnection, Serializable

Direct Known Subclasses

CobolManagedConnection.aCobolCon

Class Specifications

public class CobolConnection

extends Object

implements MFCobolConnection, Serializable

See Also:

Serialized Form

Constructor Summary

protected CobolConnection(CobolManagedConnection mc)

Cobol Connection is obtained through a CobolConnection Factory.

Methods

Method Summary
String getSessionId()
void setEJBContext(EJBContext e)

Set the EJB context that the CobolConnection can later use to determine if the bean is stateful or stateless. The EJB context is set to be transient.

EJBContext getEJBContext()

Get the EJBContext.

Interaction CreateInteraction()

Create an interaction with the Cobol Server.

LocalTransaction getLocalTransaction()

Get the Local Transaction instance that needs to be used by the bean.

ResultSetInfo getResultSetInfo()

Result Set is not supported.

void close()

Close the CobolConnection handle.

ConnectionMetaData getMetaData()

Get an instance of Connection Meta Data.

static void dispose(String sessionId)

Dispose a Cobol Connection. This needs to be called from stateful EJB's ejbRemove only.

void activate()
void passivate()
protected void associateConnection(CobolManagedConnection newMc)

Associate a connection handle with a physical managed connection.

protected void invalidate()
protected CobolManagedConnection getManagedConnection()

Associate a connection handle with a physical managed connection .

void resetXAFlow()
void resetLocalTransaction()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

CobolConnection
protected CobolConnection(CobolManagedConnection mc)

Cobol Connection is obtained through a CobolConnection Factory.

Parameters:
mc The Managed Connection instance.

Method Detail

getSessionId
public String getSessionId() 
                    throws ResourceException
Specified by:
getSessionId in interface MFCobolConnection
Throws:
ResourceException
setEJBContext
public void setEJBContext(EJBContext e)
                   throws RemoteException

Set the EJB context that the CobolConnection can later use to determine if the bean is stateful or stateless. The EJB context is set to be transient.

Parameters:
e The EJBContext to be set.
Throws:
RemoteException
getEJBContext
public EJBContext getEJBContext()

Get the EJBContext.

Returns:
The EJBContext; null if no context was set.
createInteraction
public Interaction createInteraction()
                              throws ResourceException

Create an interaction with the Cobol Server.

Specified by:
createInteraction in interface Connection
Returns:
An instance of CobolInteraction.
Throws:
ResourceException
See Also:
CobolInteraction
getLocalTransaction
public LocalTransaction getLocalTransaction()
                                     throws ResourceException

Get the Local Transaction instance that needs to be used by the bean.

Specified by:
getLocalTransaction in interface Connection
Returns:
The LocalTransaction instance.
Throws:
ResourceException
See Also:
CobolLocalTransaction
getResultSetInfo
public ResultSetInfo getResultSetInfo()
                               throws ResourceException

Result Set is not supported.

Specified by:
getResultSetInfo in interface Connection
Returns:
ResultSetInfo.
Throws:
ResourceException
close
public void close()
           throws ResourceException
getMetaData
public ConnectionMetaData getMetaData()
                               throws ResourceException

Get an instance of Connection Meta Data.

Specified by:
getMetaData in interface Connection
Returns:
CobolConnectionMetaData instance.
Throws:
ResourceException
See Also:
CobolConnectionMetaData
dispose
public static void dispose(String sessionId) 
                    throws ResourceException

Dispose a Cobol Connection. This needs to be called from stateful EJB's ejbRemove only.

Throws:
ResourceException
activate
public void activate() 
              throws ResourceException
Specified by:
activate in interface MFCobolConnection
Throws:
ResourceException
passivate
public void passivate() 
               throws ResourceException
Specified by:
passivate in interface MFCobolConnection
Throws:
ResourceException
associateConnection
protected void associateConnection(CobolManagedConnection newMc,
                                   String sessionId)
                            throws ResourceException

Associate a connection handle with a physical managed connection.

Parameters:
newMc The Managed Connection instance.
Throws:
ResourceException
invalidate
protected void invalidate()
getManagedConnection
protected CobolManagedConnection getManagedConnection()

Get the Managed Connection associated with this connection handle.

Returns:
The Managed Connection instance.
resetXAFlow
public void resetXAFlow()
Specified by:
resetXAFlow in interface MFCobolConnection
resetLocalTransaction
public void resetLocalTransaction()