org.mobicents.slee.resource.parlay.jca
Class ManagedConnectionImpl

java.lang.Object
  extended by org.mobicents.slee.resource.parlay.jca.ManagedConnectionImpl
All Implemented Interfaces:
javax.resource.spi.ManagedConnection, ParlayConnectionProxy

public class ManagedConnectionImpl
extends java.lang.Object
implements javax.resource.spi.ManagedConnection, ParlayConnectionProxy

Stateful representation of a Parlay Connection. May be pooled for optimisation. Must allow multiplexing of multiple instances to the same gateway service session. This managed connection is associated with a single ParlayConnection which may change during the lifespan of this connection.


Constructor Summary
ManagedConnectionImpl(ParlaySession session)
           
 
Method Summary
 void addConnectionEventListener(javax.resource.spi.ConnectionEventListener l)
           
 void associateConnection(java.lang.Object arg0)
           
 void associationClosed(ParlayConnectionProxyAssociation association)
          Called by an association if it is closed due to an external operation e.g.
 void cleanup()
           
 void destroy()
           
 boolean equals(java.lang.Object obj)
           
protected  void fireConnectionClosed(javax.resource.spi.ConnectionEvent e)
          Fires connection closed event to all registered listeners
protected  void fireConnectionErrorOccurred(javax.resource.spi.ConnectionEvent e)
          Fired connection error event to all registered listeners
 java.lang.Object getConnection(javax.security.auth.Subject arg0, javax.resource.spi.ConnectionRequestInfo arg1)
           
 org.mobicents.csapi.jr.slee.IpServiceConnection getIpServiceConnection(org.mobicents.csapi.jr.slee.TpServiceIdentifier serviceIdentifier)
          Get a IpServiceConnection.
 javax.resource.spi.LocalTransaction getLocalTransaction()
           
 java.io.PrintWriter getLogWriter()
           
 javax.resource.spi.ManagedConnectionMetaData getMetaData()
           
 org.mobicents.csapi.jr.slee.TpServiceIdentifier getService(java.lang.String serviceTypeName, java.util.Properties serviceProperties)
          Gets an ID representing an instance of a Parlay service
 javax.transaction.xa.XAResource getXAResource()
           
 int hashCode()
           
 void removeConnectionEventListener(javax.resource.spi.ConnectionEventListener l)
           
 void setLogWriter(java.io.PrintWriter arg0)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ManagedConnectionImpl

public ManagedConnectionImpl(ParlaySession session)
Method Detail

getService

public org.mobicents.csapi.jr.slee.TpServiceIdentifier getService(java.lang.String serviceTypeName,
                                                                  java.util.Properties serviceProperties)
                                                           throws javax.slee.resource.ResourceException
Description copied from interface: ParlayConnectionProxy
Gets an ID representing an instance of a Parlay service

Specified by:
getService in interface ParlayConnectionProxy
Parameters:
serviceTypeName - the parlay defined service type name
serviceProperties - the set of service properties relating to this service
Returns:
an identifier for the service TODO service properties not correctly typed
Throws:
javax.slee.resource.ResourceException - if the Connection cannot be created

getIpServiceConnection

public org.mobicents.csapi.jr.slee.IpServiceConnection getIpServiceConnection(org.mobicents.csapi.jr.slee.TpServiceIdentifier serviceIdentifier)
                                                                       throws javax.slee.resource.ResourceException
Description copied from interface: ParlayConnectionProxy
Get a IpServiceConnection. This can be downcasted to a service specific connection e.g. IpMultiPartyCallControlManagerConnection.

Specified by:
getIpServiceConnection in interface ParlayConnectionProxy
Parameters:
serviceIdentifier - an identifier for the service
Returns:
a IpServiceConnection object
Throws:
javax.slee.resource.ResourceException - if the Connection cannot be created

getConnection

public java.lang.Object getConnection(javax.security.auth.Subject arg0,
                                      javax.resource.spi.ConnectionRequestInfo arg1)
                               throws javax.resource.ResourceException
Specified by:
getConnection in interface javax.resource.spi.ManagedConnection
Throws:
javax.resource.ResourceException

destroy

public void destroy()
             throws javax.resource.ResourceException
Specified by:
destroy in interface javax.resource.spi.ManagedConnection
Throws:
javax.resource.ResourceException

cleanup

public void cleanup()
             throws javax.resource.ResourceException
Specified by:
cleanup in interface javax.resource.spi.ManagedConnection
Throws:
javax.resource.ResourceException

associateConnection

public void associateConnection(java.lang.Object arg0)
                         throws javax.resource.ResourceException
Specified by:
associateConnection in interface javax.resource.spi.ManagedConnection
Throws:
javax.resource.ResourceException

addConnectionEventListener

public void addConnectionEventListener(javax.resource.spi.ConnectionEventListener l)
Specified by:
addConnectionEventListener in interface javax.resource.spi.ManagedConnection

removeConnectionEventListener

public void removeConnectionEventListener(javax.resource.spi.ConnectionEventListener l)
Specified by:
removeConnectionEventListener in interface javax.resource.spi.ManagedConnection

getXAResource

public javax.transaction.xa.XAResource getXAResource()
                                              throws javax.resource.ResourceException
Specified by:
getXAResource in interface javax.resource.spi.ManagedConnection
Throws:
javax.resource.ResourceException

getLocalTransaction

public javax.resource.spi.LocalTransaction getLocalTransaction()
                                                        throws javax.resource.ResourceException
Specified by:
getLocalTransaction in interface javax.resource.spi.ManagedConnection
Throws:
javax.resource.ResourceException

getMetaData

public javax.resource.spi.ManagedConnectionMetaData getMetaData()
                                                         throws javax.resource.ResourceException
Specified by:
getMetaData in interface javax.resource.spi.ManagedConnection
Throws:
javax.resource.ResourceException

setLogWriter

public void setLogWriter(java.io.PrintWriter arg0)
                  throws javax.resource.ResourceException
Specified by:
setLogWriter in interface javax.resource.spi.ManagedConnection
Throws:
javax.resource.ResourceException

getLogWriter

public java.io.PrintWriter getLogWriter()
                                 throws javax.resource.ResourceException
Specified by:
getLogWriter in interface javax.resource.spi.ManagedConnection
Throws:
javax.resource.ResourceException

associationClosed

public void associationClosed(ParlayConnectionProxyAssociation association)
Description copied from interface: ParlayConnectionProxy
Called by an association if it is closed due to an external operation e.g. client calls close().

Specified by:
associationClosed in interface ParlayConnectionProxy

fireConnectionClosed

protected void fireConnectionClosed(javax.resource.spi.ConnectionEvent e)
Fires connection closed event to all registered listeners

Parameters:
e - the event

fireConnectionErrorOccurred

protected void fireConnectionErrorOccurred(javax.resource.spi.ConnectionEvent e)
Fired connection error event to all registered listeners

Parameters:
e - the event

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object


Copyright © 2008. All Rights Reserved.