org.ow2.jasmine.adapter.jmx.pool.outbound
Class ManagedConnectionFactoryImpl

java.lang.Object
  extended by org.ow2.jasmine.adapter.jmx.pool.outbound.ManagedConnectionFactoryImpl
All Implemented Interfaces:
java.io.Serializable, javax.resource.spi.ManagedConnectionFactory

public class ManagedConnectionFactoryImpl
extends java.lang.Object
implements javax.resource.spi.ManagedConnectionFactory, java.io.Serializable

Implementation of the ManagedConnectionFactory interface. This can provide a new JmxCnxConnectionFactory.

Author:
Guillaume Renault
See Also:
Serialized Form

Constructor Summary
ManagedConnectionFactoryImpl()
           
 
Method Summary
 java.lang.Object createConnectionFactory()
          Creates a JmxCnxConnectionFactory instance.
 java.lang.Object createConnectionFactory(javax.resource.spi.ConnectionManager cxManager)
          Creates a JmxCnxConnectionFactory instance.
 javax.resource.spi.ManagedConnection createManagedConnection(javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo cxRequestInfo)
          Creates a new physical connection to the underlying EIS resource manager.
static java.util.logging.Logger getLogger()
          Get the logger.
 java.io.PrintWriter getLogWriter()
          Get the log writer for this ManagedConnectionFactory instance.
 java.io.PrintWriter getPrintWriter()
          Get the printWriter.
 javax.resource.spi.ManagedConnection matchManagedConnections(java.util.Set connectionSet, javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo cxRequestInfo)
          Returns a matched connection from the candidate set of connections.
 void setLogWriter(java.io.PrintWriter out)
          Set the log writer for this ManagedConnectionFactory instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.resource.spi.ManagedConnectionFactory
equals, hashCode
 

Constructor Detail

ManagedConnectionFactoryImpl

public ManagedConnectionFactoryImpl()
Method Detail

createConnectionFactory

public final java.lang.Object createConnectionFactory()
                                               throws javax.resource.ResourceException
Creates a JmxCnxConnectionFactory instance. The Connection Factory instance gets initialized with a default ConnectionManager provided by the resource adapter.

Specified by:
createConnectionFactory in interface javax.resource.spi.ManagedConnectionFactory
Returns:
EIS-specific Connection Factory instance or javax.resource.cci.ConnectionFactory instance
Throws:
javax.resource.ResourceException - Generic exception ResourceAdapterInternalException Resource adapter related error condition
See Also:
ManagedConnectionFactory#createConnectionFactory()

createConnectionFactory

public final java.lang.Object createConnectionFactory(javax.resource.spi.ConnectionManager cxManager)
                                               throws javax.resource.ResourceException
Creates a JmxCnxConnectionFactory instance. The Connection Factory instance gets initialized with the passed ConnectionManager. In the managed scenario, ConnectionManager is provided by the application server.

Specified by:
createConnectionFactory in interface javax.resource.spi.ManagedConnectionFactory
Parameters:
cxManager - ConnectionManager to be associated with created EIS connection factory instance.
Returns:
EIS-specific Connection Factory instance or javax.resource.cci.ConnectionFactory instance.
Throws:
javax.resource.ResourceException - Generic exception ResourceAdapterInternalException Resource adapter related error condition
See Also:
createConnectionFactory(ConnectionManager)

createManagedConnection

public final javax.resource.spi.ManagedConnection createManagedConnection(javax.security.auth.Subject subject,
                                                                          javax.resource.spi.ConnectionRequestInfo cxRequestInfo)
                                                                   throws javax.resource.ResourceException
Creates a new physical connection to the underlying EIS resource manager. ManagedConnectionFactory uses the security information (passed as Subject) and additional ConnectionRequestInfo (which is specific to ResourceAdapter and opaque to application server) to create this new connection.

Specified by:
createManagedConnection in interface javax.resource.spi.ManagedConnectionFactory
Parameters:
subject - Caller's security information. arg1 Additional resource
cxRequestInfo - Additional resource adapter specific connection request information
Returns:
null.
Throws:
javax.resource.ResourceException - generic exception
See Also:
createManagedConnection(Subject, ConnectionRequestInfo)

getLogWriter

public final java.io.PrintWriter getLogWriter()
                                       throws javax.resource.ResourceException
Get the log writer for this ManagedConnectionFactory instance. The log writer is a character output stream to which all logging and tracing messages for this ManagedConnectionFactory instance will be printed ApplicationServer manages the association of output stream with the ManagedConnectionFactory. When a ManagedConnectionFactory object is created the log writer is initially null, in other words, logging is disabled.

Specified by:
getLogWriter in interface javax.resource.spi.ManagedConnectionFactory
Returns:
PrintWriter
Throws:
javax.resource.ResourceException - generic exception.
See Also:
ManagedConnectionFactory.getLogWriter()

matchManagedConnections

public final javax.resource.spi.ManagedConnection matchManagedConnections(java.util.Set connectionSet,
                                                                          javax.security.auth.Subject subject,
                                                                          javax.resource.spi.ConnectionRequestInfo cxRequestInfo)
                                                                   throws javax.resource.ResourceException
Returns a matched connection from the candidate set of connections. ManagedConnectionFactory uses the security info (as in Subject) and information provided through ConnectionRequestInfo and additional Resource Adapter specific criteria to do matching. Note that criteria used for matching is specific to a resource adapter and is not prescribed by the Connector specification. This method returns a ManagedConnection instance that is the best match for handling the connection allocation request.

Specified by:
matchManagedConnections in interface javax.resource.spi.ManagedConnectionFactory
Parameters:
connectionSet - Candidate connection set.
subject - Caller's security information.
cxRequestInfo - Additional resource adapter specific connection request information.
Returns:
null
Throws:
javax.resource.ResourceException - Generic exception
See Also:
matchManagedConnections(Set, Subject, ConnectionRequestInfo)

setLogWriter

public final void setLogWriter(java.io.PrintWriter out)
                        throws javax.resource.ResourceException
Set the log writer for this ManagedConnectionFactory instance. The log writer is a character output stream to which all logging and tracing messages for this ManagedConnectionfactory instance will be printed. ApplicationServer manages the association of output stream with the ManagedConnectionFactory. When a ManagedConnectionFactory object is created the log writer is initially null, in other words, logging is disabled. Once a log writer is associated with a ManagedConnectionFactory, logging and tracing for ManagedConnectionFactory instance is enabled. The ManagedConnection instances created by ManagedConnectionFactory "inherits" the log writer, which can be overridden by ApplicationServer using ManagedConnection.setLogWriter to set ManagedConnection specific logging and tracing.

Specified by:
setLogWriter in interface javax.resource.spi.ManagedConnectionFactory
Parameters:
out - PrintWriter - an out stream for error logging and tracing.
Throws:
javax.resource.ResourceException - Generic exception.
See Also:
setLogWriter(PrintWriter)

getPrintWriter

public java.io.PrintWriter getPrintWriter()
Get the printWriter.

Returns:
the printWriter

getLogger

public static java.util.logging.Logger getLogger()
Get the logger.

Returns:
the logger


Copyright © 2008 OW2 Consortium. All Rights Reserved.