tyrex.resource.jca
Class ConnectorLoader

java.lang.Object
  extended bytyrex.resource.jca.ConnectorLoader

final class ConnectorLoader
extends java.lang.Object

Provides a means to create managed connections and connection factories from a connector loaded in a separate class loader.

In order to enable deployment of multiple connector versions and their dependent JARs, each connector can be loaded in a separate class loader.

The connector deployment descriptor specifies the interface and implementation classes used by the connector.

This class provides a mechanism to obtain a new managed connection and a new connection factory from a connector loaded in a separate class loader. In addition, it validates that connection and factory objects match the classes specified in the deployment descriptor.

Version:
$Revision: 1.2 $
Author:
Assaf Arkin

Field Summary
protected  boolean _localSupported
          True if local transactions supported by this connector.
protected  javax.resource.spi.ManagedConnectionFactory _managedFactory
          An instance of the managed connection factory.
protected  boolean _xaSupported
          True if XA transactions supported by this connector.
 
Constructor Summary
(package private) ConnectorLoader(java.lang.ClassLoader loader, java.lang.String managedFactoryCN, java.lang.String factoryCN, java.lang.String connCN, boolean xaSupported, boolean localSupported)
          Constructs a new connection loader.
 
Method Summary
protected  java.lang.Object createConnectionFactory(javax.resource.spi.ConnectionManager manager)
          Creates a new client connection factory.
protected  javax.resource.spi.ManagedConnection createManagedConnection(javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo requestInfo)
          Creates a new managed connection.
protected  javax.resource.spi.ManagedConnectionFactory getConfigFactory()
          Returns the managed connection factory.
protected  java.lang.Object getConnection(javax.resource.spi.ManagedConnection managed, javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo requestInfo)
          Creates a new client connection.
protected  javax.resource.spi.ManagedConnection matchManagedConnections(java.util.Set set, javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo requestInfo)
          Matches a managed connection.
protected  void setLogWriter(java.io.PrintWriter logWriter)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_managedFactory

protected final javax.resource.spi.ManagedConnectionFactory _managedFactory
An instance of the managed connection factory. This is used to create new managed connections and connection factories.


_xaSupported

protected final boolean _xaSupported
True if XA transactions supported by this connector.


_localSupported

protected final boolean _localSupported
True if local transactions supported by this connector.

Constructor Detail

ConnectorLoader

ConnectorLoader(java.lang.ClassLoader loader,
                java.lang.String managedFactoryCN,
                java.lang.String factoryCN,
                java.lang.String connCN,
                boolean xaSupported,
                boolean localSupported)
          throws java.lang.Exception
Constructs a new connection loader.

Parameters:
loader - The class loader to use
managedFactoryCN - The class name of the managed connection factory
factoryCN - The class name of the client connection factory
connCN - The class name of the client connection
xaSupported - True if XA transactions supported
localSupported - True if local transactions supported
Throws:
java.lang.Exception - An error occured attempting to resolve any of the specified class names
Method Detail

setLogWriter

protected void setLogWriter(java.io.PrintWriter logWriter)
                     throws javax.resource.ResourceException
Throws:
javax.resource.ResourceException

matchManagedConnections

protected javax.resource.spi.ManagedConnection matchManagedConnections(java.util.Set set,
                                                                       javax.security.auth.Subject subject,
                                                                       javax.resource.spi.ConnectionRequestInfo requestInfo)
                                                                throws javax.resource.ResourceException
Matches a managed connection. This method is similar to matchManagedConnections in ConnectionManagedFactory, but validates that the resulting managed connection matches the specified class.

Returns:
A managed connection, or null
Throws:
javax.resource.ResourceException

createManagedConnection

protected javax.resource.spi.ManagedConnection createManagedConnection(javax.security.auth.Subject subject,
                                                                       javax.resource.spi.ConnectionRequestInfo requestInfo)
                                                                throws javax.resource.ResourceException
Creates a new managed connection. This method is similar to createManagedConnection in ConnectionManagedFactory, but validates that the resulting managed connection matches the specified class.

Returns:
A managed connection
Throws:
javax.resource.ResourceException

getConnection

protected java.lang.Object getConnection(javax.resource.spi.ManagedConnection managed,
                                         javax.security.auth.Subject subject,
                                         javax.resource.spi.ConnectionRequestInfo requestInfo)
                                  throws javax.resource.ResourceException
Creates a new client connection. This method is similar to getConection in ManagedConnection, but validates that the resulting client connection matches the specified class.

Returns:
A client connection
Throws:
javax.resource.ResourceException

createConnectionFactory

protected java.lang.Object createConnectionFactory(javax.resource.spi.ConnectionManager manager)
                                            throws javax.resource.ResourceException
Creates a new client connection factory. This method is similar to createConnectionFactory in ManagedConnectionFactory, but validates that the resulting client connection factory matches the specified class.

Returns:
A client connection factory
Throws:
javax.resource.ResourceException

getConfigFactory

protected javax.resource.spi.ManagedConnectionFactory getConfigFactory()
Returns the managed connection factory. The managed connection factory is used to configure the connector.

Returns:
The managed connection factory


Original code is Copyright (c) 1999-2001, Intalio, Inc. All Rights Reserved. Contributions by MetaBoss team are Copyright (c) 2003-2005, Softaris Pty. Ltd. All Rights Reserved.