public class ManagedConnectionFactoryImpl extends ManagedConnectionFactoryConfig implements ManagedConnectionFactory, ResourceAdapterAssociation, 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(ConnectionManager cxManager)
Method called by an application server (managed case) for creating an
OutboundConnectionFactory instance. |
protected XAConnectionFactory |
createFactory(ConnectionRequestInfo cxRequest) |
ManagedConnection |
createManagedConnection(Subject subject,
ConnectionRequestInfo cxRequest)
Creates a new physical connection to the underlying JORAM server,
and returns a
ManagedConnectionImpl instance for a
managed environment. |
protected XAConnection |
createXAConnection(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. |
ResourceAdapter |
getResourceAdapter()
Returns the resource adapter central authority instance.
|
int |
hashCode()
Returns a code depending on the managed factory configuration.
|
ManagedConnection |
matchManagedConnections(Set connectionSet,
Subject subject,
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(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(ConnectionManager cxManager) throws ResourceException
OutboundConnectionFactory
instance.createConnectionFactory
in interface ManagedConnectionFactory
cxManager
- Application server's connections pooling manager.ResourceException
- Never thrown.public Object createConnectionFactory() throws ResourceException
OutboundConnectionFactory
instance.createConnectionFactory
in interface ManagedConnectionFactory
ResourceException
- Never thrown.protected XAConnectionFactory createFactory(ConnectionRequestInfo cxRequest) throws ResourceException
ResourceException
protected XAConnection createXAConnection(XAConnectionFactory factory, String userName, String password) throws ResourceException
ResourceException
public final ManagedConnection createManagedConnection(Subject subject, ConnectionRequestInfo cxRequest) throws ResourceException
ManagedConnectionImpl
instance for a
managed environment.createManagedConnection
in interface ManagedConnectionFactory
subject
- Security data, not taken into account.cxRequest
- User identification data, may be null
.CommException
- If the JORAM server is not reachable.SecurityException
- If the connecting is not allowed.IllegalStateException
- If the central Joram adapter state is
invalid.ResourceException
- If the provided user info is invalid,
or if connecting fails for any other
reason.public final ManagedConnection matchManagedConnections(Set connectionSet, Subject subject, ConnectionRequestInfo cxRequest) throws ResourceException
ManagedConnectionImpl
instance.matchManagedConnections
in interface ManagedConnectionFactory
connectionSet
- Set of connections to test.subject
- Security data, not taken into account.cxRequest
- User identification data, may be null
.ResourceException
- If the provided connection request info is
invalid.public void setLogWriter(PrintWriter out) throws ResourceException
ManagedConnectionFactoryImpl
instance.setLogWriter
in interface ManagedConnectionFactory
ResourceException
public PrintWriter getLogWriter() throws ResourceException
ManagedConnectionFactoryImpl
instance.getLogWriter
in interface ManagedConnectionFactory
ResourceException
public int hashCode()
hashCode
in interface ManagedConnectionFactory
hashCode
in class Object
public boolean equals(Object o)
equals
in interface ManagedConnectionFactory
equals
in class Object
public ResourceAdapter getResourceAdapter()
getResourceAdapter
in interface ResourceAdapterAssociation
public void setResourceAdapter(ResourceAdapter ra) throws ResourceException
setResourceAdapter
in interface ResourceAdapterAssociation
ResourceException
- If the adapter could not be set.public Set getInvalidConnections(Set connectionSet) throws ResourceException
getInvalidConnections
in interface ValidatingManagedConnectionFactory
ResourceException
Copyright © 2015 ScalAgent D.T.. All Rights Reserved.