public class JRemoteManagedConnectionFactory
extends java.lang.Object
implements javax.resource.spi.ManagedConnectionFactory, javax.resource.spi.ValidatingManagedConnectionFactory
This class implements the JCA ManagedConnectionFactory. It contains configuration information for connecting to remote jBASE instances and implements all of the matching and creations semantics for connection pooling.
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_PORT |
Constructor and Description |
---|
JRemoteManagedConnectionFactory() |
Modifier and Type | Method and Description |
---|---|
protected JConnection |
connect() |
protected javax.resource.spi.ManagedConnection |
createConnection(javax.security.auth.Subject subject,
JConnectionCallbackHandler callbackHandler) |
java.lang.Object |
createConnectionFactory()
Construct a new connection factory for use in a non managed
environment.
|
java.lang.Object |
createConnectionFactory(javax.resource.spi.ConnectionManager cm)
Construct a new connection factory using the ConnectionManager supplied
by the application server.
|
javax.resource.spi.ManagedConnection |
createManagedConnection(javax.security.auth.Subject subject,
javax.resource.spi.ConnectionRequestInfo cxRequestInfo) |
boolean |
equals(java.lang.Object other)
The following excerpt is taken from Chapter 6 Connection Management 6-19 of the
JCA specification.
|
java.lang.String |
getAccount() |
java.lang.Integer |
getActionTimeout() |
java.lang.Boolean |
getAllowInput() |
java.lang.Boolean |
getCompression() |
java.lang.Integer |
getCompressionThreshold() |
protected java.util.Map<java.lang.String,java.lang.String> |
getEnvironments() |
java.lang.String |
getEnvVariables() |
java.lang.String |
getHost() |
java.util.Set |
getInvalidConnections(java.util.Set connections)
Ping each of the supplied connections to check they are alive
and return any invalid connections.
|
java.io.PrintWriter |
getLogWriter() |
java.lang.Boolean |
getNaiveTrustManager() |
java.lang.String |
getPassword() |
java.lang.Integer |
getPort() |
java.lang.Boolean |
getSSL() |
java.lang.String |
getUser() |
java.io.PrintWriter |
getWriter() |
int |
hashCode() |
javax.resource.spi.ManagedConnection |
matchManagedConnections(java.util.Set connectionSet,
javax.security.auth.Subject subject,
javax.resource.spi.ConnectionRequestInfo cxRequestInfo)
The application server must delegate the decision of which
pooled connection to use to this method.
|
void |
setAccount(java.lang.String a) |
void |
setActionTimeout(java.lang.Integer i) |
void |
setAllowInput(java.lang.Boolean ai) |
void |
setCharset(java.lang.String charset) |
void |
setCompression(java.lang.Boolean compression) |
void |
setCompressionThreshold(java.lang.Integer i) |
void |
setEnv(java.lang.String env) |
void |
setEnvVariables(java.lang.String envString) |
void |
setHost(java.lang.String host) |
void |
setLogWriter(java.io.PrintWriter writer) |
void |
setNaiveTrustManager(java.lang.Boolean ntm) |
void |
setPassword(java.lang.String p) |
void |
setPort(int port) |
void |
setPort(java.lang.Integer port) |
void |
setSSL(java.lang.Boolean ssl) |
void |
setUser(java.lang.String u) |
void |
setWriter(java.io.PrintWriter writer) |
public static final int DEFAULT_PORT
public java.lang.Object createConnectionFactory(javax.resource.spi.ConnectionManager cm) throws javax.resource.ResourceException
Construct a new connection factory using the ConnectionManager supplied by the application server.
createConnectionFactory
in interface javax.resource.spi.ManagedConnectionFactory
javax.resource.ResourceException
ManagedConnectionFactory.createConnectionFactory(ConnectionManager)
public java.lang.Object createConnectionFactory() throws javax.resource.ResourceException
Construct a new connection factory for use in a non managed environment. The factory will use a default connection manager.
createConnectionFactory
in interface javax.resource.spi.ManagedConnectionFactory
javax.resource.ResourceException
ManagedConnectionFactory.createConnectionFactory()
public javax.resource.spi.ManagedConnection createManagedConnection(javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo cxRequestInfo) throws javax.resource.ResourceException
createManagedConnection
in interface javax.resource.spi.ManagedConnectionFactory
javax.resource.ResourceException
ManagedConnectionFactory.createManagedConnection(Subject, ConnectionRequestInfo)
protected javax.resource.spi.ManagedConnection createConnection(javax.security.auth.Subject subject, JConnectionCallbackHandler callbackHandler) throws javax.resource.ResourceException
javax.resource.ResourceException
protected JConnection connect() throws javax.resource.ResourceException
javax.resource.ResourceException
public javax.resource.spi.ManagedConnection matchManagedConnections(java.util.Set connectionSet, javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo cxRequestInfo) throws javax.resource.ResourceException
The application server must delegate the decision of which pooled connection to use to this method. The current implementation either returns the first connection from the supplied set or if the subject is supplied the first connection configured for that subject, an existing connection will be switched to the supplied subject if no connection for subject is found.
matchManagedConnections
in interface javax.resource.spi.ManagedConnectionFactory
javax.resource.ResourceException
ManagedConnectionFactory.matchManagedConnections(Set, Subject, ConnectionRequestInfo)
public void setLogWriter(java.io.PrintWriter writer) throws javax.resource.ResourceException
setLogWriter
in interface javax.resource.spi.ManagedConnectionFactory
javax.resource.ResourceException
ManagedConnectionFactory.setLogWriter(PrintWriter)
public java.io.PrintWriter getLogWriter() throws javax.resource.ResourceException
getLogWriter
in interface javax.resource.spi.ManagedConnectionFactory
javax.resource.ResourceException
ManagedConnectionFactory.getLogWriter()
public java.util.Set getInvalidConnections(java.util.Set connections)
Ping each of the supplied connections to check they are alive and return any invalid connections.
getInvalidConnections
in interface javax.resource.spi.ValidatingManagedConnectionFactory
connections
- A Set of connections to checkValidatingManagedConnectionFactory.getInvalidConnections(java.util.Set)
public boolean equals(java.lang.Object other)
The following excerpt is taken from Chapter 6 Connection Management 6-19 of the
JCA specification.
The ManagedConnectionFactory implementation must extend the implementation
of the hashCode and equals methods defined in java.lang.Object. These two
methods are used by an application server to structure its connection pool
in an implementation-specific way. The equals and hashCode method implementation
should be based on a complete set of configuration properties that make a
ManagedConnectionFactory instance unique and specific to an EIS instance.
equals
in interface javax.resource.spi.ManagedConnectionFactory
equals
in class java.lang.Object
public int hashCode()
hashCode
in interface javax.resource.spi.ManagedConnectionFactory
hashCode
in class java.lang.Object
public void setHost(java.lang.String host)
public java.lang.String getHost()
public java.lang.Integer getPort()
public void setPort(java.lang.Integer port)
public void setPort(int port)
public java.lang.String getUser()
public void setUser(java.lang.String u)
public java.lang.String getPassword()
public void setPassword(java.lang.String p)
public java.lang.String getAccount()
public void setAccount(java.lang.String a)
public java.lang.Boolean getAllowInput()
public void setAllowInput(java.lang.Boolean ai)
public java.lang.Boolean getSSL()
public void setCharset(java.lang.String charset)
public void setSSL(java.lang.Boolean ssl)
public java.lang.Boolean getNaiveTrustManager()
public void setNaiveTrustManager(java.lang.Boolean ntm)
public java.lang.Boolean getCompression()
public void setCompression(java.lang.Boolean compression)
public java.lang.Integer getCompressionThreshold()
public void setCompressionThreshold(java.lang.Integer i)
public java.lang.Integer getActionTimeout()
public void setActionTimeout(java.lang.Integer i)
public void setEnv(java.lang.String env)
protected java.util.Map<java.lang.String,java.lang.String> getEnvironments()
public java.io.PrintWriter getWriter()
public void setWriter(java.io.PrintWriter writer)
public void setEnvVariables(java.lang.String envString)
public java.lang.String getEnvVariables()