tyrex.resource.jca

Class ConnectorLoader

final class ConnectorLoader extends 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 ManagedConnectionFactory_managedFactory
An instance of the managed connection factory.
protected boolean_xaSupported
True if XA transactions supported by this connector.
Constructor Summary
ConnectorLoader(ClassLoader loader, String managedFactoryCN, String factoryCN, String connCN, boolean xaSupported, boolean localSupported)
Constructs a new connection loader.
Method Summary
protected ObjectcreateConnectionFactory(ConnectionManager manager)
Creates a new client connection factory.
protected ManagedConnectioncreateManagedConnection(Subject subject, ConnectionRequestInfo requestInfo)
Creates a new managed connection.
protected ManagedConnectionFactorygetConfigFactory()
Returns the managed connection factory.
protected ObjectgetConnection(ManagedConnection managed, Subject subject, ConnectionRequestInfo requestInfo)
Creates a new client connection.
protected ManagedConnectionmatchManagedConnections(Set set, Subject subject, ConnectionRequestInfo requestInfo)
Matches a managed connection.
protected voidsetLogWriter(PrintWriter logWriter)

Field Detail

_localSupported

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

_managedFactory

protected final 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.

Constructor Detail

ConnectorLoader

ConnectorLoader(ClassLoader loader, String managedFactoryCN, String factoryCN, String connCN, boolean xaSupported, boolean localSupported)
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 configProperties Vector of DDConfigProperty objects. The vector may be null.

Throws: Exception An error occured attempting to resolve any of the specified class names

Method Detail

createConnectionFactory

protected Object createConnectionFactory(ConnectionManager manager)
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

createManagedConnection

protected ManagedConnection createManagedConnection(Subject subject, ConnectionRequestInfo requestInfo)
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

getConfigFactory

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

Returns: The managed connection factory

getConnection

protected Object getConnection(ManagedConnection managed, Subject subject, ConnectionRequestInfo requestInfo)
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

matchManagedConnections

protected ManagedConnection matchManagedConnections(Set set, Subject subject, ConnectionRequestInfo requestInfo)
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

setLogWriter

protected void setLogWriter(PrintWriter logWriter)
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.