|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.mx.util.JBossNotificationBroadcasterSupport
org.jboss.system.ServiceMBeanSupport
org.jboss.resource.connectionmanager.BaseConnectionManager2
public abstract class BaseConnectionManager2
The BaseConnectionManager2 is an abstract base class for JBoss ConnectionManager implementations. It includes functionality to obtain managed connections from a ManagedConnectionPool mbean, find the Subject from a SubjectSecurityDomain, and interact with the CachedConnectionManager for connections held over transaction and method boundaries. Important mbean references are to a ManagedConnectionPool supplier (typically a JBossManagedConnectionPool), and a RARDeployment representing the ManagedConnectionFactory.
| Nested Class Summary | |
|---|---|
protected class |
BaseConnectionManager2.BaseConnectionEventListener
|
static class |
BaseConnectionManager2.ConnectionManagerProxy
|
| Field Summary | |
|---|---|
protected CachedConnectionManager |
ccm
|
protected javax.management.ObjectName |
ccmName
|
protected javax.management.ObjectName |
jaasSecurityManagerService
|
protected String |
jndiName
|
protected javax.management.ObjectName |
managedConnectionPoolName
|
protected ManagedConnectionPool |
poolingStrategy
|
protected org.jboss.security.SubjectSecurityManager |
securityDomain
|
protected String |
securityDomainJndiName
|
static String |
STOPPING_NOTIFICATION
|
protected boolean |
trace
|
| Fields inherited from class org.jboss.system.ServiceMBeanSupport |
|---|
log, server, SERVICE_CONTROLLER_SIG, serviceName |
| Fields inherited from interface org.jboss.resource.connectionmanager.BaseConnectionManager2MBean |
|---|
OBJECT_NAME |
| Fields inherited from interface org.jboss.system.ServiceMBean |
|---|
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED |
| Constructor Summary | |
|---|---|
BaseConnectionManager2()
Default BaseConnectionManager2 managed constructor for use by subclass mbeans. |
|
BaseConnectionManager2(CachedConnectionManager ccm,
ManagedConnectionPool poolingStrategy)
Creates a new BaseConnectionManager2 instance. |
|
| Method Summary | |
|---|---|
Object |
allocateConnection(javax.resource.spi.ManagedConnectionFactory mcf,
javax.resource.spi.ConnectionRequestInfo cri)
|
void |
disconnect(Collection crs,
Set unsharableResources)
|
protected void |
disconnectManagedConnection(ConnectionListener cl)
Invoked when a managed connection is no longer associated |
javax.management.ObjectName |
getCachedConnectionManager()
Describe getCachedConnectionManager method here. |
protected CachedConnectionManager |
getCcm()
|
int |
getConnectionCount()
|
BaseConnectionManager2 |
getInstance()
Describe getInstance method here. |
javax.management.ObjectName |
getJaasSecurityManagerService()
Get the JaasSecurityManagerService value. |
String |
getJndiName()
The JndiName attribute holds the jndi name the ConnectionFactory will be bound under in jndi. |
ConnectionListener |
getManagedConnection(Subject subject,
javax.resource.spi.ConnectionRequestInfo cri)
Describe getManagedConnection method here. |
protected ConnectionListener |
getManagedConnection(Transaction transaction,
Subject subject,
javax.resource.spi.ConnectionRequestInfo cri)
Get the managed connection from the pool |
javax.resource.spi.ManagedConnectionFactory |
getManagedConnectionFactory()
ManagedConnectionFactory is an internal attribute that holds the ManagedConnectionFactory instance managed by this ConnectionManager. |
javax.management.ObjectName |
getManagedConnectionPool()
The ManagedConnectionPool holds the ObjectName of the mbean representing the pool for this connection manager. |
javax.management.MBeanNotificationInfo[] |
getNotificationInfo()
|
ManagedConnectionPool |
getPoolingStrategy()
For testing |
String |
getSecurityDomainJndiName()
Get the SecurityDomainJndiName value. |
long |
getTimeLeftBeforeTransactionTimeout(boolean errorRollback)
|
TransactionManager |
getTransactionManagerInstance()
Get the transaction manager |
int |
getTransactionTimeout()
|
boolean |
isTransactional()
Determine whether is a transaction |
protected void |
managedConnectionDisconnected(ConnectionListener cl)
For polymorphism. |
protected void |
managedConnectionReconnected(ConnectionListener cl)
For polymorphism. |
void |
reconnect(Collection conns,
Set unsharableResources)
Describe reconnect method here. |
protected void |
reconnectManagedConnection(ConnectionListener cl)
Invoked to reassociate a managed connection |
protected static void |
rethrowAsResourceException(String message,
Throwable t)
Deprecated. use JBossResourceException.rethrowAsResourceException |
void |
returnManagedConnection(ConnectionListener cl,
boolean kill)
|
void |
setCachedConnectionManager(javax.management.ObjectName ccmName)
The CachecConnectionManager holds the ObjectName of the CachedConnectionManager mbean used by this ConnectionManager. |
void |
setJaasSecurityManagerService(javax.management.ObjectName jaasSecurityManagerService)
Set the JaasSecurityManagerService value. |
void |
setJndiName(String jndiName)
Set the JndiName value. |
void |
setManagedConnectionPool(javax.management.ObjectName newManagedConnectionPool)
Set the ManagedConnectionPool value. |
void |
setSecurityDomainJndiName(String securityDomainJndiName)
The SecurityDomainJndiName holds the jndi name of the security domain configured for the ManagedConnectionFactory this ConnectionManager manages. |
protected void |
startService()
|
protected void |
stopService()
|
void |
transactionStarted(Collection conns)
|
protected void |
unregisterAssociation(ConnectionListener cl,
Object c)
|
| Methods inherited from class org.jboss.system.ServiceMBeanSupport |
|---|
create, createService, destroy, destroyService, getDeploymentInfo, 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 |
|---|
addNotificationListener, handleNotification, nextNotificationSequenceNumber, removeNotificationListener, removeNotificationListener, sendNotification |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.jboss.system.ServiceMBean |
|---|
getName, getState, getStateString, jbossInternalLifecycle |
| Methods inherited from interface org.jboss.system.Service |
|---|
create, destroy, start, stop |
| Methods inherited from interface org.jboss.resource.connectionmanager.ConnectionListenerFactory |
|---|
createConnectionListener |
| Field Detail |
|---|
public static final String STOPPING_NOTIFICATION
protected javax.management.ObjectName managedConnectionPoolName
protected ManagedConnectionPool poolingStrategy
protected String jndiName
protected String securityDomainJndiName
protected org.jboss.security.SubjectSecurityManager securityDomain
protected javax.management.ObjectName jaasSecurityManagerService
protected javax.management.ObjectName ccmName
protected CachedConnectionManager ccm
protected boolean trace
| Constructor Detail |
|---|
public BaseConnectionManager2()
public BaseConnectionManager2(CachedConnectionManager ccm,
ManagedConnectionPool poolingStrategy)
BaseConnectionManager2 instance.
for TESTING ONLY! not a managed operation.
ccm - a CachedConnectionManager valuepoolingStrategy - a ManagedConnectionPool value| Method Detail |
|---|
protected static void rethrowAsResourceException(String message,
Throwable t)
throws javax.resource.ResourceException
javax.resource.ResourceExceptionpublic ManagedConnectionPool getPoolingStrategy()
public String getJndiName()
getJndiName in interface BaseConnectionManager2MBeanpublic void setJndiName(String jndiName)
setJndiName in interface BaseConnectionManager2MBeanjndiName - The JndiName value.public javax.management.ObjectName getManagedConnectionPool()
getManagedConnectionPool in interface BaseConnectionManager2MBeanpublic void setManagedConnectionPool(javax.management.ObjectName newManagedConnectionPool)
setManagedConnectionPool in interface BaseConnectionManager2MBeannewManagedConnectionPool - The new ManagedConnectionPool value.public void setCachedConnectionManager(javax.management.ObjectName ccmName)
setCachedConnectionManager in interface BaseConnectionManager2MBeanccmName - an ObjectName valuepublic javax.management.ObjectName getCachedConnectionManager()
getCachedConnectionManager method here.
getCachedConnectionManager in interface BaseConnectionManager2MBeanObjectName valuepublic void setSecurityDomainJndiName(String securityDomainJndiName)
setSecurityDomainJndiName in interface BaseConnectionManager2MBeansecurityDomainJndiName - an String valuepublic String getSecurityDomainJndiName()
getSecurityDomainJndiName in interface BaseConnectionManager2MBeanpublic javax.management.ObjectName getJaasSecurityManagerService()
getJaasSecurityManagerService in interface BaseConnectionManager2MBeanpublic void setJaasSecurityManagerService(javax.management.ObjectName jaasSecurityManagerService)
setJaasSecurityManagerService in interface BaseConnectionManager2MBeanjaasSecurityManagerService - The new JaasSecurityManagerService value.public javax.resource.spi.ManagedConnectionFactory getManagedConnectionFactory()
getManagedConnectionFactory in interface BaseConnectionManager2MBeanpublic BaseConnectionManager2 getInstance()
getInstance method here.
getInstance in interface BaseConnectionManager2MBeanBaseConnectionManager2 value
public long getTimeLeftBeforeTransactionTimeout(boolean errorRollback)
throws RollbackException
getTimeLeftBeforeTransactionTimeout in interface org.jboss.tm.TransactionTimeoutConfigurationRollbackException
public int getTransactionTimeout()
throws SystemException
getTransactionTimeout in interface org.jboss.tm.TransactionTimeoutConfigurationSystemException
protected void startService()
throws Exception
startService in class org.jboss.system.ServiceMBeanSupportException
protected void stopService()
throws Exception
stopService in class org.jboss.system.ServiceMBeanSupportException
public ConnectionListener getManagedConnection(Subject subject,
javax.resource.spi.ConnectionRequestInfo cri)
throws javax.resource.ResourceException
getManagedConnection method here.
Public for use in testing pooling functionality by itself.
called by both allocateConnection and reconnect.
subject - a Subject valuecri - a ConnectionRequestInfo value
ManagedConnection value
javax.resource.ResourceException - if an error occurs
protected ConnectionListener getManagedConnection(Transaction transaction,
Subject subject,
javax.resource.spi.ConnectionRequestInfo cri)
throws javax.resource.ResourceException
transaction - the transaction for track by transactionsubject - the subjectcri - the ConnectionRequestInfo
javax.resource.ResourceException - if an error occurs
public void returnManagedConnection(ConnectionListener cl,
boolean kill)
public int getConnectionCount()
public Object allocateConnection(javax.resource.spi.ManagedConnectionFactory mcf,
javax.resource.spi.ConnectionRequestInfo cri)
throws javax.resource.ResourceException
mcf - cri - javax.resource.ResourceException -
public void transactionStarted(Collection conns)
throws SystemException
transactionStarted in interface ConnectionCacheListenerSystemException
public void reconnect(Collection conns,
Set unsharableResources)
throws javax.resource.ResourceException
reconnect method here.
reconnect in interface ConnectionCacheListenerconns - a Collection value
javax.resource.ResourceException - if an error occurs
public void disconnect(Collection crs,
Set unsharableResources)
throws javax.resource.ResourceException
disconnect in interface ConnectionCacheListenerjavax.resource.ResourceExceptionpublic javax.management.MBeanNotificationInfo[] getNotificationInfo()
getNotificationInfo in interface javax.management.NotificationBroadcastergetNotificationInfo in class org.jboss.mx.util.JBossNotificationBroadcasterSupport
protected void unregisterAssociation(ConnectionListener cl,
Object c)
throws javax.resource.ResourceException
javax.resource.ResourceExceptionprotected final CachedConnectionManager getCcm()
protected void reconnectManagedConnection(ConnectionListener cl)
throws javax.resource.ResourceException
cl - the managed connection
javax.resource.ResourceExceptionprotected void disconnectManagedConnection(ConnectionListener cl)
cl - the managed connection
protected void managedConnectionReconnected(ConnectionListener cl)
throws javax.resource.ResourceException
Do not invoke directly use reconnectManagedConnection which does the relevent exception handling
javax.resource.ResourceException
protected void managedConnectionDisconnected(ConnectionListener cl)
throws javax.resource.ResourceException
Do not invoke directly use disconnectManagedConnection which does the relevent exception handling
javax.resource.ResourceExceptionpublic boolean isTransactional()
ConnectionListenerFactory
isTransactional in interface ConnectionListenerFactorypublic TransactionManager getTransactionManagerInstance()
ConnectionListenerFactory
getTransactionManagerInstance in interface ConnectionListenerFactory
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||