Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bea.adapter.spi
Class AbstractManagedConnectionFactory

    java.lang.Object
      com.bea.adapter.spi.AbstractManagedConnectionFactory

All Implemented Interfaces:
  javax.resource.spi.ManagedConnectionFactory, Serializable

Direct Known Subclasses:
  AbstractBEAManagedConnectionFactory

public abstract class AbstractManagedConnectionFactory
extends Object
implements javax.resource.spi.ManagedConnectionFactory, Serializable

A `ManagedConnectionFactory` creates physical connections to the underlying EIS for the application server. A physical connection is encapsulated by a `ManagedConnection` instance. This class encapsulates functionality that is generic across all types of adapters. It provides the following features:

- Initializes the ADK logging framework with root context, priority level, and locale information.
- Initializes a `ResourceBundle` using the base message bundle property.
- Hides the complexity around creating and matching connections

Each instance of this class is configured with properties set in the app-server specific descriptor for the RAR module as deployed in the app server.

Author:
  Copyright (c) 1998-2000 by BEA Systems, Inc. All Rights Reserved.
See Also:
  Serialized Form

Field Summary
`protected char[]` | `m_achPassword` Standard connection parameters; treated as optional
`protected PropertyChangeSupport` | `m_changes`
`protected String` | `m_strAdapterDescription` Basic adapter metadata; these come from a resource bundle
`protected String` | `m_strAdapterName` Basic adapter metadata; these come from a resource bundle
`protected String` | `m_strAdapterVendorName` Basic adapter metadata; these come from a resource bundle
`protected String` | `m_strAdapterVersion` Basic adapter metadata; these come from a resource bundle
`protected String` | `m_strAdditionalLogContext` This value associates "this" with an application component in the runtime environment.
`protected String` | `m_strConnectionURL` Standard connection parameters; treated as optional
`protected String` | `m_strCountryCode` Associates a country code for determining the locale for logging
`protected String` | `m_strLanguageCode` Associates a language code for determining the locale for logging
`protected String` | `m_strLogConfigFile` This value provides the name of the log configuration file
`protected String` | `m_strLogLevel` Log level - warning by default
`protected String` | `m_strMessageBundleBase` Base name for message bundle
`protected String` | `m_strPortNumber` Standard connection parameters; treated as optional
`protected String` | `m_strRootLogContext` Allows for the categorization of log messages for this adapter.
`protected String` | `m_strServerName` Standard connection parameters; treated as optional
`protected String` | `m_strUserName` Standard connection parameters; treated as optional
`protected VetoableChangeSupport` | `m_vetos`

Constructor Summary
`AbstractManagedConnectionFactory()` Constructs a managed connection factory instance.

Method Summary
`void` | `addPropertyChangeListener(PropertyChangeListener l)` To support JavaBeans constrained properties
`void` | `addVetoableChangeListener(VetoableChangeListener l)` To support JavaBeans constrained properties
`protected void` | `appendField(StringBuffer sb, String strPropertyName, Object objValue)`
`protected void` | `assertValidLicense()` Verifies the existence of a valid license for this adapter; if there is no valid license available, this method throws an exception to prevent the instantiation of a `ManagedConnectionFactory` object.
`protected void` | `assertValidState()` Verifies that "this" is in a valid state that allows "this" to perform its factory responsibilities successfully.
`protected ValidationResult` | `checkLicense()` Returns true if the adapter can locate a valid license in the runtime environment.
`protected boolean` | `checkState()` Returns true if all the members of this class are set correctly.
`protected boolean` | `compareCharArrays(char[] achMyProperty, char[] achOtherProperty)` Compares two property arrays for equality.
`protected boolean` | `comparePropertyValues(Object myProperty, Object otherProperty)` Compares two properties for equality.
`Object` | `createConnectionFactory()` This method is invoked in the non-managed case.
`Object` | `createConnectionFactory(javax.resource.spi.ConnectionManager connectionManager)` Creates an EIS-specific connection factory.
`protected abstract Object` | `createConnectionFactory(javax.resource.spi.ConnectionManager connectionManager, String strAdapterName, String strAdapterDescription, String strAdapterVersion, String strAdapterVendorName)` Creates a new instance of a connection factory using the supplied parameters.
`boolean` | `equals(Object other)`
`String` | `getAdapterDescription()`
`String` | `getAdapterName()`
`String` | `getAdapterVendor()`
`String` | `getAdapterVersion()`
`String` | `getAdditionalLogContext()`
`String` | `getConnectionURL()` Retrieves the ConnectionURL; a "standard" connection property as suggested by the J2EE Connector Architecture
`String` | `getCountryCode()`
`String` | `getLanguageCode()`
`String` | `getLogConfigFile()`
`protected LogContext` | `getLogContext()` Retrieves an object that determines the logging configuration for this instance in the logging framework.
`protected ILogger` | `getLogger()` Retrieves an object used to log information to.
`String` | `getLogLevel()`
`PrintWriter` | `getLogWriter()`
`String` | `getMessageBundleBase()`
`String` | `getPassword()` Retrieves the Password; a "standard" connection property as suggested by the J2EE Connector Architecture
`javax.resource.spi.security.PasswordCredential` | `getPasswordCredential(Subject subject, javax.resource.spi.ConnectionRequestInfo info)` Returns an object that encapsulates a user name and password, gathered from either the JAAS Subject object or the connection request info object.
`protected String` | `getPasswordFromRequestInfo(javax.resource.spi.ConnectionRequestInfo info)` Retrieves the password from the supplied connection request info object.
`String` | `getPortNumber()` Retrieves the PortNumber; a "standard" connection property as suggested by the J2EE Connector Architecture
`String` | `getRootLogContext()`
`String` | `getServerName()` Retrieves the ServerName; a "standard" connection property as suggested by the J2EE Connector Architecture.
`String` | `getUserName()` Retrieves the UserName; a "standard" connection property as suggested by the J2EE Connector Architecture
`protected String` | `getUserNameFromRequestInfo(javax.resource.spi.ConnectionRequestInfo info)` Retrieves the user name from the supplied connection request info object.
`int` | `hashCode()` Calculates an integer code for use in lookup from hash tables.
`protected boolean` | `hasSameBaseProperties(AbstractManagedConnectionFactory otherMcf)` Compares all the non-connection related properties provided by `com.bea.adapter.spi.AbstractManagedConnectionFactory`
`protected boolean` | `hasSameConnectionProperties(AbstractManagedConnectionFactory otherMcf)` Adapter developers should override this method if they have connection properties other than the standard ones provided by this implementation.
`protected void` | `initAdapterMetaData(ResourceBundle resourceBundle)` Retrieves metadata about the resource adapter from a message bundle.
`protected void` | `initializeLogResources()` Initializes resources needed by this instance to support localized logging after all base member variables have been initialized correctly by the application server.
`protected boolean` | `isValidState()` The application server creates an instance of this class and then calls the setter methods.
`protected void` | `logInfo()` Writes information about 'this' instance to the underlying logger as a info message.
`javax.resource.spi.ManagedConnection` | `matchManagedConnections(Set connectionSet, Subject subject, javax.resource.spi.ConnectionRequestInfo info)` This method gets called by the ConnectionManager to try to find a valid connection in the pool it is managing.
`void` | `removePropertyChangeListener(PropertyChangeListener l)` To support JavaBeans constrained properties
`void` | `removeVetoableChangeListener(VetoableChangeListener l)` To support JavaBeans constrained properties
`void` | `setAdapterDescription(String strAdapterDescription)` Sets the adapter description; this overrides the setting provided by the message bundle for this instance if the adapter_description key is mapped to a value in the message bundle.
`void` | `setAdapterName(String strAdapterName)` Sets the adapter name; this overrides the setting provided by the message bundle for this instance if the adapter_name key is mapped to a value in the message bundle.
`void` | `setAdapterVendor(String strAdapterVendor)` Sets the adapter vendor; this overrides the setting provided by the message bundle for this instance if the adapter_vendor key is mapped to a value in the message bundle.
`void` | `setAdapterVersion(String strAdapterVersion)` Sets the adapter version; this overrides the setting provided by the message bundle for this instance if the adapter_version key is mapped to a value in the message bundle.
`void` | `setAdditionalLogContext(String strAdditionalLogContext)` Sets additional context information for identifying logging configuration.
`void` | `setConnectionURL(String strConnectionURL)` Sets the ConnectionURL for connecting to the underlying EIS.
`void` | `setCountryCode(String strCountryCode)` Sets the country code for enabling I18N log and exception messages from instances of this class.
`void` | `setLanguageCode(String strLanguageCode)` Sets the language code for enabling I18N log and exception messages from instances of this class.
`void` | `setLogConfigFile(String strLogConfigFile)` Sets the name for the log configuration file used by this instance.
`void` | `setLogLevel(String strLogLevel)` Sets the log priority level for 'this' instance.
`void` | `setLogWriter(PrintWriter out)`
`void` | `setMessageBundleBase(String strMessageBundleBase)` Sets the base name for the message bundle used by this instance.
`void` | `setPassword(String strPassword)` Sets the Password for connecting to the underlying EIS.
`void` | `setPortNumber(String strPortNumber)` Sets the PortNumber for connecting to the underlying EIS.
`void` | `setRootLogContext(String strRootLogContext)` Sets the root log context for this factory.
`void` | `setServerName(String strServerName)` Sets the ServerName for connecting to the underlying EIS.
`void` | `setUserName(String strUserName)` Sets the UserName for connecting to the underlying EIS.
`String` | `toString()`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Methods inherited from interface javax.resource.spi.ManagedConnectionFactory
`createManagedConnection`

Field Detail

### m_vetos

    protected VetoableChangeSupport m_vetos

### m_changes

    protected PropertyChangeSupport m_changes

### m_strRootLogContext

    protected String m_strRootLogContext

  Allows for the categorization of log messages for this adapter.

### m_strAdditionalLogContext

    protected String m_strAdditionalLogContext

  This value associates "this" with an application component in the runtime environment.

### m_strLogConfigFile

    protected String m_strLogConfigFile

  This value provides the name of the log configuration file

### m_strLogLevel

    protected String m_strLogLevel

  Log level - warning by default

### m_strMessageBundleBase

    protected String m_strMessageBundleBase

  Base name for message bundle

### m_strLanguageCode

    protected String m_strLanguageCode

  Associates a language code for determining the locale for logging

### m_strCountryCode

    protected String m_strCountryCode

  Associates a country code for determining the locale for logging

### m_strAdapterName

    protected String m_strAdapterName

  Basic adapter metadata; these come from a resource bundle

### m_strAdapterDescription

    protected String m_strAdapterDescription

  Basic adapter metadata; these come from a resource bundle

### m_strAdapterVersion

    protected String m_strAdapterVersion

  Basic adapter metadata; these come from a resource bundle

### m_strAdapterVendorName

    protected String m_strAdapterVendorName

  Basic adapter metadata; these come from a resource bundle

### m_strUserName

    protected String m_strUserName

  Standard connection parameters; treated as optional

### m_achPassword

    protected char[] m_achPassword

  Standard connection parameters; treated as optional

### m_strServerName

    protected String m_strServerName

  Standard connection parameters; treated as optional

### m_strPortNumber

    protected String m_strPortNumber

  Standard connection parameters; treated as optional

### m_strConnectionURL

    protected String m_strConnectionURL

  Standard connection parameters; treated as optional

Constructor Detail

### AbstractManagedConnectionFactory

    public AbstractManagedConnectionFactory()
                                     throws javax.resource.ResourceException

  Constructs a managed connection factory instance. This method ensures there is a valid license in the runtime environment.

Throws:
  `javax.resource.ResourceException` - - an exceptional condition was encountered while attempting to initialize the managed connection factory instance

Method Detail

### assertValidLicense

    protected void assertValidLicense()
                               throws javax.resource.ResourceException

  Verifies the existence of a valid license for this adapter; if there is no valid license available, this method throws an exception to prevent the instantiation of a `ManagedConnectionFactory` object. Adapter developers should override the `checkLicense` method to perform the adapter specific license check.
  Note that this method is called only after a call to the checkState() method returns true. This means that this method is free to use the logging framework to log any license errors that are encountered. This method calls the checkLicense() method.

  Throws:
    `javax.resource.spi.ResourceAdapterInternalException` - - license verification failed for this adapter.
    `javax.resource.ResourceException`
  See Also:
    `checkLicense method`

### assertValidState

    protected void assertValidState()
                             throws javax.resource.ResourceException

  Verifies that "this" is in a valid state that allows "this" to perform its factory responsibilities successfully.

  Throws:
    `javax.resource.ResourceException` - if an error occurs while determining if this object is in a valid state; which may result from initializing the log resources needed by this instance.

### isValidState

    protected boolean isValidState()
                            throws javax.resource.ResourceException

  The application server creates an instance of this class and then calls the setter methods. This method checks that all the required properties have been set. This method delegates the "check" of the state of this object to the "checkState" method. This method is called before instances of this class attempt to perform any of its factory responsibilities, such as creating a `javax.resource.spi.ConnectionFactory` instances or `javax.resource.spi.ManagedConnection` instances.

  Returns:
    true if the properties of this object have been set such that it is in a valid state to perform its factory responsibilities; false otherwise.
  Throws:
    `javax.resource.ResourceException`

### checkState

    protected boolean checkState()

  Returns true if all the members of this class are set correctly. Adapter developers should override this method to actually check the state of their concrete class's members. This method will not be called until all of the base class's members have been initialized correctly. Thus, sub-classes can use resources, such as logging, provided by this class.

### initializeLogResources

    protected void initializeLogResources()
                                   throws javax.resource.ResourceException

  Initializes resources needed by this instance to support localized logging after all base member variables have been initialized correctly by the application server. We have to support post-constructor initialization because of the JavaBeans approach to initializing instances of this class.

  Throws:
    `javax.resource.ResourceException` - if this method fails to initialize the logging framework or message bundle for this instance.

### getLogger

    protected ILogger getLogger()
                         throws IllegalStateException

  Retrieves an object used to log information to. This method uses the RootLogContext, AdditionalLogContext, LanguageCode, and CountryCode properties to determine its logger. Adapter developers can override this method to return a logger that is not based solely on the supplied logging context.

  Returns:
    an object used to log information to.
  Throws:
    `IllegalStateException` - if the log context is null

### getLogContext

    protected LogContext getLogContext()
                                throws IllegalStateException

  Retrieves an object that determines the logging configuration for this instance in the logging framework.

  Returns:
    an object that determines the logging configuration for this instance.
  Throws:
    `IllegalStateException` - if the log context is null, i.e. this object has not been initialized correctly.

### setLogLevel

    public void setLogLevel(String strLogLevel)
                     throws javax.resource.ResourceException

  Sets the log priority level for 'this' instance. The log priority determines which messages are actually sent to the log at runtime. By default, this value is "WARN" - all messages with severity of WARN or greater are sent to the log.

  Throws:
    `javax.resource.ResourceException`

### getLogLevel

    public String getLogLevel()

  Returns:
    the log level for this instance. The log level determines whether a message is printed to the log.

### setRootLogContext

    public void setRootLogContext(String strRootLogContext)
                           throws javax.resource.ResourceException

  Sets the root log context for this factory. The root log context facilitates the categorization of log messages. In other words, all messages generated by this instance and the other objects it creates, i.e. connection factory and managed connection instances will log under this category.

  Parameters:
    `strRootLogContext` - - the root context from which all log messages generated will be associated. This helps identify log messages according to resource adapter type. Typically, this is related to the adapter/EIS type, etc.
  Throws:
    `javax.resource.ResourceException` - - an exceptional condition was encountered while attempting to set the root log context; the argument cannot be null or "".

### getRootLogContext

    public String getRootLogContext()

  Returns:
    the root log context for this factory

### setAdditionalLogContext

    public void setAdditionalLogContext(String strAdditionalLogContext)
                                 throws javax.resource.ResourceException

  Sets additional context information for identifying logging configuration. For example, if this managed connection factory is associated with an order processing application in SAP R/3, the additional log context could be "OrderProcessing" and the root log context could be "SAPR3".

  Parameters:
    `strAdditionalLogContext` - - a value that provides additional context information for this instance.
  Throws:
    `javax.resource.ResourceException` - - an exceptional condition was encountered while attempting to set the additional context; the argument cannot be null or "".

### getAdditionalLogContext

    public String getAdditionalLogContext()

### setUserName

    public void setUserName(String strUserName)
                     throws javax.resource.ResourceException

  Sets the UserName for connecting to the underlying EIS. As suggested by the J2EE Connector Architecture specification, there are a standard set of connection properties; UserName is a standard property.

  Parameters:
    `strUserName` - - a valid UserName for the underlying EIS.
  Throws:
    `javax.resource.ResourceException` - - an exceptional condition was encountered while attempting to set the UserName; the argument cannot be null or empty "".

### getUserName

    public String getUserName()

  Retrieves the UserName; a "standard" connection property as suggested by the J2EE Connector Architecture

  Returns:
    the UserName used to connect to the underlying EIS.

### setPassword

    public void setPassword(String strPassword)
                     throws javax.resource.ResourceException

  Sets the Password for connecting to the underlying EIS. As suggested by the J2EE Connector Architecture specification, there are a standard set of connection properties; Password is a standard property.

  Parameters:
    `strPassword` - - a valid Password for the underlying EIS.
  Throws:
    `javax.resource.ResourceException` - - an exceptional condition was encountered while attempting to set the Password; the argument cannot be null or empty "".

### getPassword

    public String getPassword()

  Retrieves the Password; a "standard" connection property as suggested by the J2EE Connector Architecture

  Returns:
    the Password used to connect to the underlying EIS.

### setServerName

    public void setServerName(String strServerName)
                       throws javax.resource.ResourceException

  Sets the ServerName for connecting to the underlying EIS. As suggested by the J2EE Connector Architecture specification, there are a standard set of connection properties; ServerName is a standard property.

  Parameters:
    `strServerName` - - a valid ServerName for the underlying EIS.
  Throws:
    `javax.resource.ResourceException` - - an exceptional condition was encountered while attempting to set the ServerName; the argument cannot be null or empty "".

### getServerName

    public String getServerName()

  Retrieves the ServerName; a "standard" connection property as suggested by the J2EE Connector Architecture.

  Returns:
    the ServerName used to connect to the underlying EIS.

### setPortNumber

    public void setPortNumber(String strPortNumber)
                       throws javax.resource.ResourceException

  Sets the PortNumber for connecting to the underlying EIS. As suggested by the J2EE Connector Architecture specification, there are a standard set of connection properties; PortNumber is a standard property.

  Parameters:
    `strPortNumber` - - a valid PortNumber for the underlying EIS.
  Throws:
    `javax.resource.ResourceException` - - an exceptional condition was encountered while attempting to set the PortNumber; the argument cannot be null or empty "".

### getPortNumber

    public String getPortNumber()

  Retrieves the PortNumber; a "standard" connection property as suggested by the J2EE Connector Architecture

  Returns:
    the PortNumber used to connect to the underlying EIS.

### setConnectionURL

    public void setConnectionURL(String strConnectionURL)
                          throws javax.resource.ResourceException

  Sets the ConnectionURL for connecting to the underlying EIS. As suggested by the J2EE Connector Architecture specification, there are a standard set of connection properties; ConnectionURL is a standard property.

  Parameters:
    `strConnectionURL` - - a valid ConnectionURL for the underlying EIS.
  Throws:
    `javax.resource.ResourceException` - - an exceptional condition was encountered while attempting to set the ConnectionURL; the argument cannot be null or empty "".

### getConnectionURL

    public String getConnectionURL()

  Retrieves the ConnectionURL; a "standard" connection property as suggested by the J2EE Connector Architecture

  Returns:
    the ConnectionURL used to connect to the underlying EIS.

### setLanguageCode

    public void setLanguageCode(String strLanguageCode)
                         throws javax.resource.ResourceException

  Sets the language code for enabling I18N log and exception messages from instances of this class.

  Parameters:
    `strLanguageCode` - - lowercase two-letter ISO-639 code.
  Throws:
    `javax.resource.ResourceException` - - if the parameter is null, empty, or is not a valid lowercase two-letter ISO-639 code.

### getLanguageCode

    public String getLanguageCode()

### setCountryCode

    public void setCountryCode(String strCountryCode)
                        throws javax.resource.ResourceException

  Sets the country code for enabling I18N log and exception messages from instances of this class.

  Parameters:
    `strCountryCode` - - uppercase two-letter ISO-3166 code
  Throws:
    `javax.resource.ResourceException` - - if the parameter is null, empty, or is not a valid uppercase two-letter ISO-3166 code.

### getCountryCode

    public String getCountryCode()

### setMessageBundleBase

    public void setMessageBundleBase(String strMessageBundleBase)
                              throws javax.resource.ResourceException

  Sets the base name for the message bundle used by this instance.

  Parameters:
    `strMessageBundleBase` - - a valid message bundle base name.
  Throws:
    `javax.resource.ResourceException` - - an exceptional condition was encountered while attempting to set the MessageBundleBase; the argument cannot be null or empty "".

### getMessageBundleBase

    public String getMessageBundleBase()

### setLogConfigFile

    public void setLogConfigFile(String strLogConfigFile)
                          throws javax.resource.ResourceException

  Sets the name for the log configuration file used by this instance.

  Parameters:
    `strLogConfigFile` - - a valid message bundle base name.
  Throws:
    `javax.resource.ResourceException` - - an exceptional condition was encountered while attempting to set the LogConfigFile; the argument cannot be null or empty "".

### getLogConfigFile

    public String getLogConfigFile()

### logInfo

    protected void logInfo()

  Writes information about 'this' instance to the underlying logger as a info message.

### initAdapterMetaData

    protected void initAdapterMetaData(ResourceBundle resourceBundle)

  Retrieves metadata about the resource adapter from a message bundle.

  Parameters:
    `resourceBundle` - - provides internationalized and localized versions of adapter metadata.

### getUserNameFromRequestInfo

    protected String getUserNameFromRequestInfo(javax.resource.spi.ConnectionRequestInfo info)

  Retrieves the user name from the supplied connection request info object. By default, the connection request info object is assumed to be a `java.util.Map` with the user name mapped to key "userName". Adapter developers can override this method to process a connection request info object that doesn't meet this criteria.

### getPasswordFromRequestInfo

    protected String getPasswordFromRequestInfo(javax.resource.spi.ConnectionRequestInfo info)

  Retrieves the password from the supplied connection request info object. By default, the connection request info object is assumed to be a `java.util.Map` with the password mapped to key "password". Adapter developers can override this method to process a connection request info object that doesn't meet this criteria.

### getPasswordCredential

    public javax.resource.spi.security.PasswordCredential getPasswordCredential(Subject subject,
                                                                                javax.resource.spi.ConnectionRequestInfo info)
                                                                         throws javax.resource.ResourceException

  Returns an object that encapsulates a user name and password, gathered from either the JAAS Subject object or the connection request info object. This method supports the security contract options A and C. Option A is where the resource adapter explicitly checks whether the Subject instance is non-null and carries a PasswordCredential instance using the getPrivateCredentials method. Option C is where the Subject instance is null. In this case, the resource adapter has two options: 1) extract security information from the ConnectionRequestInfo object if it is not null, or 2) if it does not find appropriate security credentials on the ConnectionRequestInfo instance, then the resource adapter uses the default security configuration on the ManagedConnectionFactory instance.

  Throws:
    `javax.resource.ResourceException`

### checkLicense

    protected ValidationResult checkLicense()

  Returns true if the adapter can locate a valid license in the runtime environment. Currently, this method always returns VALID for the license check. Adapter developers should override this method to perform an actual license check.

  Returns:
    ValidationResult - an object that describes the result of a validation check; a `ValidationResult` object may or may not have additional information associated with it. The additional information is used to generate a "better" exception on a failed validation attempt.

### createConnectionFactory

    public Object createConnectionFactory()
                                   throws javax.resource.ResourceException

  This method is invoked in the non-managed case. The connection factory instance gets initialized with a default connection manager provided by the ADK.

  Specified by:
    `createConnectionFactory` in interface `javax.resource.spi.ManagedConnectionFactory`
  Returns:
    a new instance of a connection factory for the resource adapter.
  Throws:
    `javax.resource.ResourceException` - - an exceptional condition occured while attempting to create a connection factory.

### createConnectionFactory

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

  Creates an EIS-specific connection factory. The connection factory gets associated with the connection manager passed in. The connection factory created in this method is responsible for generating the application-level connection handle.

  Specified by:
    `createConnectionFactory` in interface `javax.resource.spi.ManagedConnectionFactory`
  Parameters:
    `connectionManager` - - the connection manager is the link into the management services offered by an application server. This method logs and throws a `ResourceException` if the `ConnectionManager` parameter is null.
  Returns:
    a new instance of a connection factory for the resource adapter.
  Throws:
    `javax.resource.ResourceException` - - an exceptional condition occured while attempting to create a connection factory.

### createConnectionFactory

    protected abstract Object createConnectionFactory(javax.resource.spi.ConnectionManager connectionManager,
                                                      String strAdapterName,
                                                      String strAdapterDescription,
                                                      String strAdapterVersion,
                                                      String strAdapterVendorName)
                                               throws javax.resource.ResourceException

  Creates a new instance of a connection factory using the supplied parameters.

  Parameters:
    `connectionManager` - - the connection manager for the factory; the factory delegates to this object to link into quality of services provided by the application server.
    `strAdapterName` - - the name of the adapter; In CCI, a connection factory is responsible for supplying metadata about a resource adapter.
    `strAdapterDescription` - - a short description of the adapter's purpose in life.
    `strAdapterVersion` - - the current version of the running adapter.
    `strAdapterVendorName` - - the producer of the adapter.
  Throws:
    `javax.resource.ResourceException`
  See Also:
    `ConnectionFactoryImpl`, `LocalTransaction`

### equals

    public boolean equals(Object other)

  Specified by:
    `equals` in interface `javax.resource.spi.ManagedConnectionFactory`

### hashCode

    public int hashCode()

  Calculates an integer code for use in lookup from hash tables. Be sure to only include member variables which are directly set from the ra.xml and weblogic-ra.xml deployment descriptors. Don't use any internal state variable that can get initialized after the MCF is added to a hash table.

  Specified by:
    `hashCode` in interface `javax.resource.spi.ManagedConnectionFactory`

### hasSameBaseProperties

    protected boolean hasSameBaseProperties(AbstractManagedConnectionFactory otherMcf)

  Compares all the non-connection related properties provided by `com.bea.adapter.spi.AbstractManagedConnectionFactory`

### hasSameConnectionProperties

    protected boolean hasSameConnectionProperties(AbstractManagedConnectionFactory otherMcf)

  Adapter developers should override this method if they have connection properties other than the standard ones provided by this implementation.

### compareCharArrays

    protected boolean compareCharArrays(char[] achMyProperty,
                                        char[] achOtherProperty)

  Compares two property arrays for equality.

### comparePropertyValues

    protected boolean comparePropertyValues(Object myProperty,
                                            Object otherProperty)

  Compares two properties for equality.

### setLogWriter

    public void setLogWriter(PrintWriter out)
                      throws javax.resource.ResourceException

  Specified by:
    `setLogWriter` in interface `javax.resource.spi.ManagedConnectionFactory`
  Throws:
    `javax.resource.ResourceException`

### getLogWriter

    public PrintWriter getLogWriter()
                             throws javax.resource.ResourceException

  Specified by:
    `getLogWriter` in interface `javax.resource.spi.ManagedConnectionFactory`
  Throws:
    `javax.resource.ResourceException`

### toString

    public String toString()

### appendField

    protected void appendField(StringBuffer sb,
                               String strPropertyName,
                               Object objValue)

### getAdapterName

    public final String getAdapterName()

  Returns:
    adapter name; the adapter name is initialized with the value for adapter_name in the message bundle for this instance.

### setAdapterName

    public final void setAdapterName(String strAdapterName)
                              throws javax.resource.ResourceException

  Sets the adapter name; this overrides the setting provided by the message bundle for this instance if the adapter_name key is mapped to a value in the message bundle.

  Throws:
    `javax.resource.ResourceException`

### getAdapterDescription

    public final String getAdapterDescription()

  Returns:
    adapter description; the adapter description is initialized with the value for adapter_description in the message bundle for this instance.

### setAdapterDescription

    public final void setAdapterDescription(String strAdapterDescription)
                                     throws javax.resource.ResourceException

  Sets the adapter description; this overrides the setting provided by the message bundle for this instance if the adapter_description key is mapped to a value in the message bundle.

  Throws:
    `javax.resource.ResourceException`

### getAdapterVersion

    public final String getAdapterVersion()

  Returns:
    adapter version; the adapter version is initialized with the value for adapter_version in the message bundle for this instance.

### setAdapterVersion

    public final void setAdapterVersion(String strAdapterVersion)
                                 throws javax.resource.ResourceException

  Sets the adapter version; this overrides the setting provided by the message bundle for this instance if the adapter_version key is mapped to a value in the message bundle.

  Throws:
    `javax.resource.ResourceException`

### getAdapterVendor

    public final String getAdapterVendor()

  Returns:
    adapter vendor; the adapter vendor is initialized with the value for adapter_vendor in the message bundle for this instance.

### setAdapterVendor

    public final void setAdapterVendor(String strAdapterVendor)
                                throws javax.resource.ResourceException

  Sets the adapter vendor; this overrides the setting provided by the message bundle for this instance if the adapter_vendor key is mapped to a value in the message bundle.

  Throws:
    `javax.resource.ResourceException`

### matchManagedConnections

    public javax.resource.spi.ManagedConnection matchManagedConnections(Set connectionSet,
                                                                        Subject subject,
                                                                        javax.resource.spi.ConnectionRequestInfo info)
                                                                 throws javax.resource.ResourceException

  This method gets called by the ConnectionManager to try to find a valid connection in the pool it is managing. If this method returns null, then the ConnectionManager will allocate a new connection to the EIS via a call to createManagedConnection. This class uses the following approach to matching a connection: It iterates over the `connectionSet`, for each object in the set (until a match is found) it determines if it is an AbstractManagedConnection. If it is, then this is compared to the ManagedConnectionFactory for the AbstractManagedConnection from the set. If the factories are equal, then the compareCredentials method is invoked on the AbstractManagedConnection If this method returns true, then the instance is returned.

  Specified by:
    `matchManagedConnections` in interface `javax.resource.spi.ManagedConnectionFactory`
  Throws:
    `javax.resource.ResourceException`

### addVetoableChangeListener

    public void addVetoableChangeListener(VetoableChangeListener l)

  To support JavaBeans constrained properties

### removeVetoableChangeListener

    public void removeVetoableChangeListener(VetoableChangeListener l)

  To support JavaBeans constrained properties

### addPropertyChangeListener

    public void addPropertyChangeListener(PropertyChangeListener l)

  To support JavaBeans constrained properties

### removePropertyChangeListener

    public void removePropertyChangeListener(PropertyChangeListener l)

  To support JavaBeans constrained properties

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD