jremote jbase5.2.1

com.jbase.jremote.jca
Class JRemoteManagedConnectionFactory

java.lang.Object
  extended by com.jbase.jremote.jca.JRemoteManagedConnectionFactory
All Implemented Interfaces:
Serializable, javax.resource.spi.ManagedConnectionFactory, javax.resource.spi.ValidatingManagedConnectionFactory
Direct Known Subclasses:
CCIJRemoteManagedConnectionFactory

public class JRemoteManagedConnectionFactory
extends 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.

Author:
aphethean
See Also:
Serialized Form

Field Summary
static int DEFAULT_PORT
           
 
Constructor Summary
JRemoteManagedConnectionFactory()
           
 
Method Summary
protected  JConnection connect()
           
protected  javax.resource.spi.ManagedConnection createConnection(Subject subject, JConnectionCallbackHandler callbackHandler)
           
 Object createConnectionFactory()
          Construct a new connection factory for use in a non managed environment.
 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(Subject subject, javax.resource.spi.ConnectionRequestInfo cxRequestInfo)
           
 boolean equals(Object other)
          The following excerpt is taken from Chapter 6 Connection Management 6-19 of the JCA specification.
 String getAccount()
           
 Integer getActionTimeout()
           
 Boolean getAllowInput()
           
 Boolean getCompression()
           
 Integer getCompressionThreshold()
           
protected  Map<String,String> getEnvironments()
           
 String getEnvVariables()
           
 String getHost()
           
 Set getInvalidConnections(Set connections)
          Ping each of the supplied connections to check they are alive and return any invalid connections.
 PrintWriter getLogWriter()
           
 Boolean getNaiveTrustManager()
           
 String getPassword()
           
 Integer getPort()
           
 Boolean getSSL()
           
 String getUser()
           
 PrintWriter getWriter()
           
 int hashCode()
           
 javax.resource.spi.ManagedConnection matchManagedConnections(Set connectionSet, 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(String a)
           
 void setActionTimeout(Integer i)
           
 void setAllowInput(Boolean ai)
           
 void setCharset(String charset)
           
 void setCompression(Boolean compression)
           
 void setCompressionThreshold(Integer i)
           
 void setEnv(String env)
           
 void setEnvVariables(String envString)
           
 void setHost(String host)
           
 void setLogWriter(PrintWriter writer)
           
 void setNaiveTrustManager(Boolean ntm)
           
 void setPassword(String p)
           
 void setPort(int port)
           
 void setPort(Integer port)
           
 void setSSL(Boolean ssl)
           
 void setUser(String u)
           
 void setWriter(PrintWriter writer)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PORT

public static final int DEFAULT_PORT
See Also:
Constant Field Values
Constructor Detail

JRemoteManagedConnectionFactory

public JRemoteManagedConnectionFactory()
Method Detail

createConnectionFactory

public Object createConnectionFactory(javax.resource.spi.ConnectionManager cm)
                               throws javax.resource.ResourceException

Construct a new connection factory using the ConnectionManager supplied by the application server.

Specified by:
createConnectionFactory in interface javax.resource.spi.ManagedConnectionFactory
Throws:
javax.resource.ResourceException
See Also:
ManagedConnectionFactory.createConnectionFactory(ConnectionManager)

createConnectionFactory

public 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.

Specified by:
createConnectionFactory in interface javax.resource.spi.ManagedConnectionFactory
Throws:
javax.resource.ResourceException
See Also:
ManagedConnectionFactory.createConnectionFactory()

createManagedConnection

public javax.resource.spi.ManagedConnection createManagedConnection(Subject subject,
                                                                    javax.resource.spi.ConnectionRequestInfo cxRequestInfo)
                                                             throws javax.resource.ResourceException
Specified by:
createManagedConnection in interface javax.resource.spi.ManagedConnectionFactory
Throws:
javax.resource.ResourceException
See Also:
ManagedConnectionFactory.createManagedConnection(Subject, ConnectionRequestInfo)

createConnection

protected javax.resource.spi.ManagedConnection createConnection(Subject subject,
                                                                JConnectionCallbackHandler callbackHandler)
                                                         throws javax.resource.ResourceException
Throws:
javax.resource.ResourceException

connect

protected JConnection connect()
                       throws javax.resource.ResourceException
Throws:
javax.resource.ResourceException

matchManagedConnections

public javax.resource.spi.ManagedConnection matchManagedConnections(Set connectionSet,
                                                                    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.

Specified by:
matchManagedConnections in interface javax.resource.spi.ManagedConnectionFactory
Throws:
javax.resource.ResourceException
See Also:
ManagedConnectionFactory.matchManagedConnections(Set, Subject, ConnectionRequestInfo)

setLogWriter

public void setLogWriter(PrintWriter writer)
                  throws javax.resource.ResourceException
Specified by:
setLogWriter in interface javax.resource.spi.ManagedConnectionFactory
Throws:
javax.resource.ResourceException
See Also:
ManagedConnectionFactory.setLogWriter(PrintWriter)

getLogWriter

public PrintWriter getLogWriter()
                         throws javax.resource.ResourceException
Specified by:
getLogWriter in interface javax.resource.spi.ManagedConnectionFactory
Throws:
javax.resource.ResourceException
See Also:
ManagedConnectionFactory.getLogWriter()

getInvalidConnections

public Set getInvalidConnections(Set connections)

Ping each of the supplied connections to check they are alive and return any invalid connections.

Specified by:
getInvalidConnections in interface javax.resource.spi.ValidatingManagedConnectionFactory
Parameters:
connections - A Set of connections to check
Returns:
a Set of invalid connections
See Also:
ValidatingManagedConnectionFactory.getInvalidConnections(java.util.Set)

equals

public boolean equals(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.

Specified by:
equals in interface javax.resource.spi.ManagedConnectionFactory
Overrides:
equals in class Object

hashCode

public int hashCode()
Specified by:
hashCode in interface javax.resource.spi.ManagedConnectionFactory
Overrides:
hashCode in class Object

setHost

public void setHost(String host)

getHost

public String getHost()

getPort

public Integer getPort()

setPort

public void setPort(Integer port)

setPort

public void setPort(int port)

getUser

public String getUser()

setUser

public void setUser(String u)

getPassword

public String getPassword()

setPassword

public void setPassword(String p)

getAccount

public String getAccount()

setAccount

public void setAccount(String a)

getAllowInput

public Boolean getAllowInput()

setAllowInput

public void setAllowInput(Boolean ai)

getSSL

public Boolean getSSL()

setCharset

public void setCharset(String charset)

setSSL

public void setSSL(Boolean ssl)

getNaiveTrustManager

public Boolean getNaiveTrustManager()

setNaiveTrustManager

public void setNaiveTrustManager(Boolean ntm)

getCompression

public Boolean getCompression()

setCompression

public void setCompression(Boolean compression)

getCompressionThreshold

public Integer getCompressionThreshold()

setCompressionThreshold

public void setCompressionThreshold(Integer i)

getActionTimeout

public Integer getActionTimeout()

setActionTimeout

public void setActionTimeout(Integer i)

setEnv

public void setEnv(String env)

getEnvironments

protected Map<String,String> getEnvironments()

getWriter

public PrintWriter getWriter()

setWriter

public void setWriter(PrintWriter writer)

setEnvVariables

public void setEnvVariables(String envString)

getEnvVariables

public String getEnvVariables()

jremote jbase5.2.1

Copyright © 2016 TEMENOS. All Rights Reserved.