public class ManagedConnectionFactoryImpl extends ManagedConnectionFactoryConfig implements javax.resource.spi.ManagedConnectionFactory, javax.resource.spi.ResourceAdapterAssociation, javax.resource.spi.ValidatingManagedConnectionFactory, Serializable
ManagedConnectionFactoryImpl
instance manages
outbound connectivity to a given JORAM server.Modifier and Type | Field and Description |
---|---|
static org.objectweb.util.monolog.api.Logger |
logger |
protected PrintWriter |
out
Out stream for error logging and tracing.
|
(package private) JoramResourceAdapter |
ra
Resource adapter central authority.
|
private static long |
serialVersionUID
Define serialVersionUID for interoperability.
|
asyncSend, MODE_PTP, MODE_PUBSUB, MODE_UNIFIED
Constructor and Description |
---|
ManagedConnectionFactoryImpl()
Constructs a
ManagedConnectionFactoryImpl instance. |
Modifier and Type | Method and Description |
---|---|
Object |
createConnectionFactory()
Method called in the non managed case for creating an
OutboundConnectionFactory instance. |
Object |
createConnectionFactory(javax.resource.spi.ConnectionManager cxManager)
Method called by an application server (managed case) for creating an
OutboundConnectionFactory instance. |
protected javax.jms.XAConnectionFactory |
createFactory(javax.resource.spi.ConnectionRequestInfo cxRequest) |
javax.resource.spi.ManagedConnection |
createManagedConnection(Subject subject,
javax.resource.spi.ConnectionRequestInfo cxRequest)
Creates a new physical connection to the underlying JORAM server,
and returns a
ManagedConnectionImpl instance for a
managed environment. |
protected javax.jms.XAConnection |
createXAConnection(javax.jms.XAConnectionFactory factory,
String userName,
String password) |
boolean |
equals(Object o)
Compares managed factories according to their configuration.
|
Set |
getInvalidConnections(Set connectionSet)
From a set of managed connections, returns the set of invalid ones.
|
PrintWriter |
getLogWriter()
Gets the log writer of this
ManagedConnectionFactoryImpl
instance. |
javax.resource.spi.ResourceAdapter |
getResourceAdapter()
Returns the resource adapter central authority instance.
|
int |
hashCode()
Returns a code depending on the managed factory configuration.
|
javax.resource.spi.ManagedConnection |
matchManagedConnections(Set connectionSet,
Subject subject,
javax.resource.spi.ConnectionRequestInfo cxRequest)
Finds a matching connection from the candidate set of connections and
returns a
ManagedConnectionImpl instance. |
void |
setLogWriter(PrintWriter out)
Sets the log writer for this
ManagedConnectionFactoryImpl
instance. |
void |
setResourceAdapter(javax.resource.spi.ResourceAdapter ra)
Sets the resource adapter central authority.
|
getAsyncSend, getCnxPendingTimer, getConnectingTimer, getHostName, getIdentityClass, getMode, getMultiThreadSync, getMultiThreadSyncDelay, getName, getOutLocalAddress, getOutLocalPort, getPassword, getServerPort, getTxPendingTimer, getUserName, isAsyncSend, isCollocated, isMultiThreadSync, setAsyncSend, setCnxPendingTimer, setCollocated, setConnectingTimer, setHostName, setIdentityClass, setInInterceptors, setManagedConnectionFactoryConfig, setMode, setMultiThreadSync, setMultiThreadSyncDelay, setName, setOutInterceptors, setOutLocalAddress, setOutLocalPort, setParameters, setPassword, setServerPort, setTxPendingTimer, setUserName
public static org.objectweb.util.monolog.api.Logger logger
private static final long serialVersionUID
protected transient PrintWriter out
transient JoramResourceAdapter ra
public ManagedConnectionFactoryImpl()
ManagedConnectionFactoryImpl
instance.public Object createConnectionFactory(javax.resource.spi.ConnectionManager cxManager) throws javax.resource.ResourceException
OutboundConnectionFactory
instance.createConnectionFactory
in interface javax.resource.spi.ManagedConnectionFactory
cxManager
- Application server's connections pooling manager.javax.resource.ResourceException
- Never thrown.public Object createConnectionFactory() throws javax.resource.ResourceException
OutboundConnectionFactory
instance.createConnectionFactory
in interface javax.resource.spi.ManagedConnectionFactory
javax.resource.ResourceException
- Never thrown.protected javax.jms.XAConnectionFactory createFactory(javax.resource.spi.ConnectionRequestInfo cxRequest) throws javax.resource.ResourceException
javax.resource.ResourceException
protected javax.jms.XAConnection createXAConnection(javax.jms.XAConnectionFactory factory, String userName, String password) throws javax.resource.ResourceException
javax.resource.ResourceException
public final javax.resource.spi.ManagedConnection createManagedConnection(Subject subject, javax.resource.spi.ConnectionRequestInfo cxRequest) throws javax.resource.ResourceException
ManagedConnectionImpl
instance for a
managed environment.createManagedConnection
in interface javax.resource.spi.ManagedConnectionFactory
subject
- Security data, not taken into account.cxRequest
- User identification data, may be null
.javax.resource.spi.CommException
- If the JORAM server is not reachable.javax.resource.spi.SecurityException
- If the connecting is not allowed.javax.jms.IllegalStateException
- If the central Joram adapter state is
invalid.javax.resource.ResourceException
- If the provided user info is invalid,
or if connecting fails for any other
reason.public final javax.resource.spi.ManagedConnection matchManagedConnections(Set connectionSet, Subject subject, javax.resource.spi.ConnectionRequestInfo cxRequest) throws javax.resource.ResourceException
ManagedConnectionImpl
instance.matchManagedConnections
in interface javax.resource.spi.ManagedConnectionFactory
connectionSet
- Set of connections to test.subject
- Security data, not taken into account.cxRequest
- User identification data, may be null
.javax.resource.ResourceException
- If the provided connection request info is
invalid.public void setLogWriter(PrintWriter out) throws javax.resource.ResourceException
ManagedConnectionFactoryImpl
instance.setLogWriter
in interface javax.resource.spi.ManagedConnectionFactory
javax.resource.ResourceException
public PrintWriter getLogWriter() throws javax.resource.ResourceException
ManagedConnectionFactoryImpl
instance.getLogWriter
in interface javax.resource.spi.ManagedConnectionFactory
javax.resource.ResourceException
public int hashCode()
public boolean equals(Object o)
public javax.resource.spi.ResourceAdapter getResourceAdapter()
getResourceAdapter
in interface javax.resource.spi.ResourceAdapterAssociation
public void setResourceAdapter(javax.resource.spi.ResourceAdapter ra) throws javax.resource.ResourceException
setResourceAdapter
in interface javax.resource.spi.ResourceAdapterAssociation
javax.resource.ResourceException
- If the adapter could not be set.public Set getInvalidConnections(Set connectionSet) throws javax.resource.ResourceException
getInvalidConnections
in interface javax.resource.spi.ValidatingManagedConnectionFactory
javax.resource.ResourceException
Copyright © 2018 ScalAgent D.T.. All Rights Reserved.