com.microfocus.cobol.connector.cci
Class CobolConnection

java.lang.Object
  |
  +--com.microfocus.cobol.connector.cci.CobolConnection
All Implemented Interfaces:
Connection, MFCobolConnection, Serializable
Direct Known Subclasses:
CobolManagedConnection.aCobolCon

public class CobolConnection
extends Object
implements MFCobolConnection, Serializable

CobolConnection class represents an application level connection handle that is used by a component to access a Cobol Server instance.

See Also:
Serialized Form

Constructor Summary
protected CobolConnection(CobolManagedConnection mc)
          Cobol Connection is obtained through a CobolConnection Factory.
 
Method Summary
 void activate()
           
protected  void associateConnection(CobolManagedConnection newMc)
          Associate a connection handle with a physical managed connection
 void close()
          close the CobolConnection handle
 Interaction createInteraction()
          Create an interaction with the Cobol Server.
 void dispose()
          dispose a cobol connection.
 EJBContext getEJBContext()
          Get the EJBContext
 LocalTransaction getLocalTransaction()
          Get the Local Transaction instance that needs to be used by the bean.
protected  CobolManagedConnection getManagedConnection()
          Get the Managed Connection associated with this connection handle.
 ConnectionMetaData getMetaData()
          Get Connection Meta data.
 ResultSetInfo getResultSetInfo()
          Result Set is not supported
protected  void invalidate()
          Invalidate a Managed Connection
 boolean isStatefulBean()
          Check if the bean that obtained a connection handle was a stateful bean
 void passivate()
           
 void resetXAFlow()
           
 void setEJBContext(EJBContext e)
          Set the EJB context that the CobolConnection can later use to determine if the bean is stateful or stateless.
 
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

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

isStatefulBean

public boolean isStatefulBean()
Check if the bean that obtained a connection handle was a stateful bean
Returns:
true if it is a stateful bean

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 Local TRansaction 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
close the CobolConnection handle
Specified by:
close in interface Connection
Throws:
ResourceException -  

getMetaData

public ConnectionMetaData getMetaData()
                               throws ResourceException
Get Connection Meta data.
Specified by:
getMetaData in interface Connection
Returns:
CobolConnectionMetaData instance
Throws:
ResourceException -  
See Also:
CobolConnectionMetaData

dispose

public void dispose()
             throws ResourceException
dispose a cobol connection. This needs to be called from stateful ejb's ejbRemove only.
Specified by:
dispose in interface MFCobolConnection
Parameters:
-  
Throws:
ResourceException -  

activate

public void activate()
              throws ResourceException
Specified by:
activate in interface MFCobolConnection

passivate

public void passivate()
               throws ResourceException
Specified by:
passivate in interface MFCobolConnection

associateConnection

protected void associateConnection(CobolManagedConnection newMc)
                            throws ResourceException
Associate a connection handle with a physical managed connection
Parameters:
newMc - The Managed connection instance.
Throws:
ResourceException -  

invalidate

protected void invalidate()
Invalidate a Managed Connection

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



Copyright ? 2000 Micro Focus International Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.