public abstract class AbstractConnectionManager extends java.lang.Object implements ConnectionManager
Modifier and Type | Field and Description |
---|---|
protected boolean |
connectable
Connectable
|
protected boolean |
enlistment
Enlistment
|
protected java.lang.Boolean |
enlistmentTrace
Enlistment trace
|
protected java.lang.Boolean |
tracking
Tracking
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractConnectionManager()
Creates a new instance of connection manager.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
allocateConnection(javax.resource.spi.ManagedConnectionFactory mcf,
javax.resource.spi.ConnectionRequestInfo cri) |
void |
associateConnection(java.lang.Object connection,
javax.resource.spi.ManagedConnectionFactory mcf,
javax.resource.spi.ConnectionRequestInfo cri) |
javax.resource.spi.ManagedConnection |
associateManagedConnection(java.lang.Object connection,
javax.resource.spi.ManagedConnectionFactory mcf,
javax.resource.spi.ConnectionRequestInfo cri)
Associate a managed connection to a logical connection
|
boolean |
cancelShutdown()
Cancel shutdown
|
protected void |
disconnectManagedConnection(ConnectionListener cl)
Invoked when a managed connection is no longer associated
|
boolean |
dissociateManagedConnection(java.lang.Object connection,
javax.resource.spi.ManagedConnection mc,
javax.resource.spi.ManagedConnectionFactory mcf)
Dissociate a managed connection from a logical connection.
|
int |
getAllocationRetry()
Get the number of allocation retries
|
long |
getAllocationRetryWaitMillis()
Get the wait time between each allocation retry
|
CachedConnectionManager |
getCachedConnectionManager()
Gets cached connection manager.
|
int |
getDelay()
Get the delay until shutdown occurs
|
java.lang.Boolean |
getEnlistmentTrace()
Get enlistment trace
|
org.jboss.jca.common.api.metadata.common.FlushStrategy |
getFlushStrategy()
Get the flush strategy
|
java.lang.String |
getJndiName()
Gets jndi name.
|
protected abstract CoreLogger |
getLogger()
Get the logger.
|
ConnectionListener |
getManagedConnection(javax.security.auth.Subject subject,
javax.resource.spi.ConnectionRequestInfo cri)
Public for use in testing pooling functionality by itself.
|
protected ConnectionListener |
getManagedConnection(javax.transaction.Transaction transaction,
javax.security.auth.Subject subject,
javax.resource.spi.ConnectionRequestInfo cri)
Get the managed connection from the pool.
|
javax.resource.spi.ManagedConnectionFactory |
getManagedConnectionFactory()
Gets managed connection factory.
|
Pool |
getPool()
Get the pool.
|
java.lang.String |
getSecurityDomain()
Get the security domain.
|
SubjectFactory |
getSubjectFactory()
Get the subject factory
|
java.lang.Boolean |
getTracking()
Get tracking
|
abstract TransactionIntegration |
getTransactionIntegration()
Get the transaction integration.
|
void |
inactiveConnectionClosed(java.lang.Object connection,
javax.resource.spi.ManagedConnectionFactory mcf) |
boolean |
isConnectable()
Is connectable
|
boolean |
isEnlistment()
Is enlistment
|
boolean |
isSharable()
Is sharable
|
boolean |
isShutdown()
Is the component shutdown
|
abstract boolean |
isTransactional()
Determine whether there connection is a transactional.
|
void |
lazyEnlist(javax.resource.spi.ManagedConnection mc) |
protected void |
managedConnectionDisconnected(ConnectionListener cl)
For polymorphism.
|
protected void |
managedConnectionReconnected(ConnectionListener cl)
For polymorphism.
|
void |
prepareShutdown()
Signal the component to prepare for shutdown
|
void |
prepareShutdown(GracefulCallback cb)
Signal the component to prepare for shutdown
|
void |
prepareShutdown(int seconds)
Signal the component to prepare for shutdown
|
void |
prepareShutdown(int seconds,
GracefulCallback cb)
Signal the component to prepare for shutdown
|
protected void |
reconnectManagedConnection(ConnectionListener cl)
Invoked to reassociate a managed connection.
|
void |
returnManagedConnection(ConnectionListener bcl,
boolean kill)
Kill given connection listener wrapped connection instance.
|
void |
setAllocationRetry(int number)
Set the number of allocation retries
|
void |
setAllocationRetryWaitMillis(long millis)
Set the wait time between each allocation retry
|
void |
setCachedConnectionManager(CachedConnectionManager cachedConnectionManager)
Sets cached connection manager.
|
void |
setConnectable(boolean v)
Set the connectable flag
|
void |
setEnlistment(boolean v)
Set the enlistment flag
|
void |
setEnlistmentTrace(java.lang.Boolean v)
Set the enlistment trace flag
|
void |
setFlushStrategy(org.jboss.jca.common.api.metadata.common.FlushStrategy v)
Set the flush strategy
|
void |
setJndiName(java.lang.String jndiName)
Sets jndi name.
|
void |
setPool(Pool pool)
Set the pool.
|
void |
setSecurityDomain(java.lang.String securityDomain)
Sets security domain
|
void |
setSharable(boolean v)
Set the sharable flag
|
void |
setSubjectFactory(SubjectFactory subjectFactory)
Sets subject factory.
|
void |
setTracking(java.lang.Boolean v)
Set the tracking flag
|
void |
shutdown()
Shutdown the component
|
abstract void |
transactionStarted(java.util.Collection<ConnectionRecord> conns)
Notification of transaction started
|
void |
unregisterAssociation(ConnectionListener cl,
java.lang.Object c)
Unregister association.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createConnectionListener
protected boolean enlistment
protected boolean connectable
protected java.lang.Boolean tracking
protected java.lang.Boolean enlistmentTrace
protected AbstractConnectionManager()
protected abstract CoreLogger getLogger()
public void setPool(Pool pool)
pool
- the poolpublic Pool getPool()
public void setCachedConnectionManager(CachedConnectionManager cachedConnectionManager)
cachedConnectionManager
- cached connection managerpublic CachedConnectionManager getCachedConnectionManager()
public boolean cancelShutdown()
cancelShutdown
in interface GracefulShutdown
public void prepareShutdown()
prepareShutdown
in interface GracefulShutdown
public void prepareShutdown(GracefulCallback cb)
prepareShutdown
in interface GracefulShutdown
cb
- The callback handlepublic void prepareShutdown(int seconds)
prepareShutdown
in interface GracefulShutdown
seconds
- The number of seconds after which shutdown is forcedpublic void prepareShutdown(int seconds, GracefulCallback cb)
prepareShutdown
in interface GracefulShutdown
seconds
- The number of seconds after which shutdown is forcedcb
- The callback handlepublic void shutdown()
shutdown
in interface GracefulShutdown
public boolean isShutdown()
isShutdown
in interface GracefulShutdown
public int getDelay()
getDelay
in interface GracefulShutdown
Integer.MAX_VALUE
for active,
or Integer.MIN_VALUE
for inactivepublic java.lang.String getJndiName()
public void setJndiName(java.lang.String jndiName)
jndiName
- jndi namepublic boolean isSharable()
public void setSharable(boolean v)
v
- The valuepublic boolean isEnlistment()
public void setEnlistment(boolean v)
v
- The valuepublic boolean isConnectable()
public void setConnectable(boolean v)
v
- The valuepublic java.lang.Boolean getTracking()
public void setTracking(java.lang.Boolean v)
v
- The valuepublic java.lang.Boolean getEnlistmentTrace()
public void setEnlistmentTrace(java.lang.Boolean v)
v
- The valuepublic java.lang.String getSecurityDomain()
public void setSecurityDomain(java.lang.String securityDomain)
securityDomain
- security domainpublic SubjectFactory getSubjectFactory()
public void setSubjectFactory(SubjectFactory subjectFactory)
subjectFactory
- subject factorypublic org.jboss.jca.common.api.metadata.common.FlushStrategy getFlushStrategy()
public void setFlushStrategy(org.jboss.jca.common.api.metadata.common.FlushStrategy v)
v
- The valuepublic javax.resource.spi.ManagedConnectionFactory getManagedConnectionFactory()
public void setAllocationRetry(int number)
number
- retry numberpublic int getAllocationRetry()
public void setAllocationRetryWaitMillis(long millis)
millis
- wait in mspublic long getAllocationRetryWaitMillis()
public ConnectionListener getManagedConnection(javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo cri) throws javax.resource.ResourceException
subject
- a Subject
valuecri
- a ConnectionRequestInfo
valueManagedConnection
valuejavax.resource.ResourceException
- if an error occursprotected ConnectionListener getManagedConnection(javax.transaction.Transaction transaction, javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo cri) throws javax.resource.ResourceException
transaction
- the transaction for track by transactionsubject
- the subjectcri
- the ConnectionRequestInfojavax.resource.ResourceException
- if an error occurspublic void returnManagedConnection(ConnectionListener bcl, boolean kill)
bcl
- connection listener that wraps connectionkill
- kill connection or notpublic java.lang.Object allocateConnection(javax.resource.spi.ManagedConnectionFactory mcf, javax.resource.spi.ConnectionRequestInfo cri) throws javax.resource.ResourceException
allocateConnection
in interface javax.resource.spi.ConnectionManager
javax.resource.ResourceException
public void associateConnection(java.lang.Object connection, javax.resource.spi.ManagedConnectionFactory mcf, javax.resource.spi.ConnectionRequestInfo cri) throws javax.resource.ResourceException
associateConnection
in interface javax.resource.spi.LazyAssociatableConnectionManager
javax.resource.ResourceException
public javax.resource.spi.ManagedConnection associateManagedConnection(java.lang.Object connection, javax.resource.spi.ManagedConnectionFactory mcf, javax.resource.spi.ConnectionRequestInfo cri) throws javax.resource.ResourceException
connection
- The connectionmcf
- The managed connection factorycri
- The connection request informationjavax.resource.ResourceException
- Thrown if an error occurspublic boolean dissociateManagedConnection(java.lang.Object connection, javax.resource.spi.ManagedConnection mc, javax.resource.spi.ManagedConnectionFactory mcf) throws javax.resource.ResourceException
cleanup
method
will be calledconnection
- The connectionmc
- The managed connectionmcf
- The managed connection factoryjavax.resource.ResourceException
- Thrown if an error occurspublic void inactiveConnectionClosed(java.lang.Object connection, javax.resource.spi.ManagedConnectionFactory mcf)
inactiveConnectionClosed
in interface javax.resource.spi.LazyAssociatableConnectionManager
public void unregisterAssociation(ConnectionListener cl, java.lang.Object c)
cl
- connection listenerc
- connectionpublic void lazyEnlist(javax.resource.spi.ManagedConnection mc) throws javax.resource.ResourceException
lazyEnlist
in interface javax.resource.spi.LazyEnlistableConnectionManager
javax.resource.ResourceException
protected void reconnectManagedConnection(ConnectionListener cl) throws javax.resource.ResourceException
cl
- the managed connectionjavax.resource.ResourceException
- for exceptionprotected void disconnectManagedConnection(ConnectionListener cl)
cl
- the managed connectionprotected void managedConnectionReconnected(ConnectionListener cl) throws javax.resource.ResourceException
Do not invoke directly, use reconnectManagedConnection which does the relevent exception handling
cl
- connection listenerjavax.resource.ResourceException
- for exceptionprotected void managedConnectionDisconnected(ConnectionListener cl) throws javax.resource.ResourceException
Do not invoke directly, use disconnectManagedConnection which does the relevent exception handling
cl
- connection listenerjavax.resource.ResourceException
- for exceptionpublic abstract void transactionStarted(java.util.Collection<ConnectionRecord> conns) throws javax.transaction.SystemException
conns
- the connectionsjavax.transaction.SystemException
- for any errorpublic abstract boolean isTransactional()
public abstract TransactionIntegration getTransactionIntegration()
Copyright © 2014 IronJacamar (http://www.ironjacamar.org)