org.jboss.resource.connectionmanager
Class CachedConnectionManager

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport (src) 
      extended byorg.jboss.system.ServiceMBeanSupport (src) 
          extended byorg.jboss.resource.connectionmanager.CachedConnectionManager
All Implemented Interfaces:
java.util.EventListener, MBeanRegistration (src) , NotificationBroadcaster (src) , NotificationEmitter (src) , ServerVMClientUserTransaction.UserTransactionStartedListener (src) , Service (src) , ServiceMBean (src)

public class CachedConnectionManager
extends ServiceMBeanSupport (src)
implements ServerVMClientUserTransaction.UserTransactionStartedListener (src)

The CachedConnectionManager mbean manages associations between meta-aware objects (those accessed through interceptor chains) and connection handles, and between user transactions and connection handles. Normally there should only be one such mbean. It is called by CachedConnectionInterceptor, UserTransaction, and all BaseConnectionManager2 instances. Created: Sat Jan 5 18:50:27 2002


Field Summary
protected  boolean trace
           
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport (src)
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.system.ServiceMBean (src)
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
CachedConnectionManager()
          Default CachedConnectionManager managed constructor for mbeans.
 
Method Summary
 CachedConnectionManager (src) getInstance()
          The Instance attribute simply holds the current instance, which is normally the only instance of CachedConnectionManager.
 int getInUseConnections()
          Get the inuse connections
 ObjectName (src) getTransactionManagerServiceName()
          Get the TransactionManagerServiceName value.
 boolean isDebug()
          Get the debug value.
 boolean isSpecCompliant()
          Get the SpecCompliant value.
 java.util.Map listInUseConnections()
          List the inuse connections
 void popMetaAwareObject(java.util.Set unsharableResources)
          Describe popMetaAwareObject method here.
 void pushMetaAwareObject(java.lang.Object rawKey, java.util.Set unsharableResources)
          Describe pushMetaAwareObject method here.
 void setDebug(boolean value)
          Set the Debug value.
 void setSpecCompliant(boolean specCompliant)
          Set the SpecCompliant value.
 void setTransactionManagerServiceName(ObjectName (src)  transactionManagerServiceName)
          Set the TransactionManagerServiceName value.
protected  void startService()
          Sub-classes should override this method to provide custum 'start' logic.
protected  void stopService()
          Sub-classes should override this method to provide custum 'stop' logic.
 void userTransactionStarted()
           
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport (src)
create, createService, destroy, destroyService, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, stop
 
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport (src)
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

trace

protected boolean trace
Constructor Detail

CachedConnectionManager

public CachedConnectionManager()
Default CachedConnectionManager managed constructor for mbeans. Remember that this mbean should be a singleton.

Method Detail

isSpecCompliant

public boolean isSpecCompliant()
Get the SpecCompliant value.

Returns:
the SpecCompliant value.

setSpecCompliant

public void setSpecCompliant(boolean specCompliant)
Set the SpecCompliant value.

Parameters:
specCompliant - The new SpecCompliant value.

isDebug

public boolean isDebug()
Get the debug value.

Returns:
the debug value.

setDebug

public void setDebug(boolean value)
Set the Debug value.

Parameters:
value - The new debug value.

getTransactionManagerServiceName

public ObjectName (src)  getTransactionManagerServiceName()
Get the TransactionManagerServiceName value.

Returns:
the TransactionManagerServiceName value.

setTransactionManagerServiceName

public void setTransactionManagerServiceName(ObjectName (src)  transactionManagerServiceName)
Set the TransactionManagerServiceName value.

Parameters:
transactionManagerServiceName - The new TransactionManagerServiceName value.

getInstance

public CachedConnectionManager (src)  getInstance()
The Instance attribute simply holds the current instance, which is normally the only instance of CachedConnectionManager.

Returns:
a CachedConnectionManager value

getInUseConnections

public int getInUseConnections()
Get the inuse connections

Returns:
the number of inuse connections

listInUseConnections

public java.util.Map listInUseConnections()
List the inuse connections

Returns:
a map of connections to allocation stack traces

startService

protected void startService()
                     throws java.lang.Exception
Description copied from class: ServiceMBeanSupport (src)
Sub-classes should override this method to provide custum 'start' logic.

This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.

Overrides:
startService in class ServiceMBeanSupport (src)
Throws:
java.lang.Exception

stopService

protected void stopService()
                    throws java.lang.Exception
Description copied from class: ServiceMBeanSupport (src)
Sub-classes should override this method to provide custum 'stop' logic.

This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.

Overrides:
stopService in class ServiceMBeanSupport (src)
Throws:
java.lang.Exception

pushMetaAwareObject

public void pushMetaAwareObject(java.lang.Object rawKey,
                                java.util.Set unsharableResources)
                         throws ResourceException (src) 
Describe pushMetaAwareObject method here. PUBLIC for TESTING PURPOSES ONLY!

Throws:
ResourceException (src) - if an error occurs

popMetaAwareObject

public void popMetaAwareObject(java.util.Set unsharableResources)
                        throws ResourceException (src) 
Describe popMetaAwareObject method here. PUBLIC for TESTING PURPOSES ONLY!

Throws:
ResourceException (src) - if an error occurs

userTransactionStarted

public void userTransactionStarted()
                            throws SystemException (src) 
Specified by:
userTransactionStarted in interface ServerVMClientUserTransaction.UserTransactionStartedListener (src)
Throws:
SystemException (src)