|
WebLogic Integration | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.bea.adapter.spi.AbstractManagedConnectionFactory
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:
ResourceBundle
using the base message bundle
property.
Field Summary | |
protected char[] |
m_achPassword
Standard connection parameters; treated as optional |
protected java.beans.PropertyChangeSupport |
m_changes
|
protected java.lang.String |
m_strAdapterDescription
Basic adapter metadata; these come from a resource bundle |
protected java.lang.String |
m_strAdapterName
Basic adapter metadata; these come from a resource bundle |
protected java.lang.String |
m_strAdapterVendorName
Basic adapter metadata; these come from a resource bundle |
protected java.lang.String |
m_strAdapterVersion
Basic adapter metadata; these come from a resource bundle |
protected java.lang.String |
m_strAdditionalLogContext
This value associates "this" with an application component in the runtime environment. |
protected java.lang.String |
m_strConnectionURL
Standard connection parameters; treated as optional |
protected java.lang.String |
m_strCountryCode
Associates a country code for determining the locale for logging |
protected java.lang.String |
m_strLanguageCode
Associates a language code for determining the locale for logging |
protected java.lang.String |
m_strLogConfigFile
This value provides the name of the log configuration file |
protected java.lang.String |
m_strLogLevel
Log level - warning by default |
protected java.lang.String |
m_strMessageBundleBase
Base name for message bundle |
protected java.lang.String |
m_strPortNumber
Standard connection parameters; treated as optional |
protected java.lang.String |
m_strRootLogContext
Allows for the categorization of log messages for this adapter. |
protected java.lang.String |
m_strServerName
Standard connection parameters; treated as optional |
protected java.lang.String |
m_strUserName
Standard connection parameters; treated as optional |
protected java.beans.VetoableChangeSupport |
m_vetos
|
Constructor Summary | |
AbstractManagedConnectionFactory()
Constructs a managed connection factory instance. |
Method Summary | |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener l)
To support JavaBeans constrained properties |
void |
addVetoableChangeListener(java.beans.VetoableChangeListener l)
To support JavaBeans constrained properties |
protected void |
appendField(java.lang.StringBuffer sb,
java.lang.String strPropertyName,
java.lang.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(java.lang.Object myProperty,
java.lang.Object otherProperty)
Compares two properties for equality. |
java.lang.Object |
createConnectionFactory()
This method is invoked in the non-managed case. |
java.lang.Object |
createConnectionFactory(javax.resource.spi.ConnectionManager connectionManager)
Creates an EIS-specific connection factory. |
protected abstract java.lang.Object |
createConnectionFactory(javax.resource.spi.ConnectionManager connectionManager,
java.lang.String strAdapterName,
java.lang.String strAdapterDescription,
java.lang.String strAdapterVersion,
java.lang.String strAdapterVendorName)
Creates a new instance of a connection factory using the supplied parameters. |
boolean |
equals(java.lang.Object other)
|
java.lang.String |
getAdapterDescription()
|
java.lang.String |
getAdapterName()
|
java.lang.String |
getAdapterVendor()
|
java.lang.String |
getAdapterVersion()
|
java.lang.String |
getAdditionalLogContext()
|
java.lang.String |
getConnectionURL()
Retrieves the ConnectionURL; a "standard" connection property as suggested by the J2EE Connector Architecture |
java.lang.String |
getCountryCode()
|
java.lang.String |
getLanguageCode()
|
java.lang.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. |
java.lang.String |
getLogLevel()
|
java.io.PrintWriter |
getLogWriter()
|
java.lang.String |
getMessageBundleBase()
|
java.lang.String |
getPassword()
Retrieves the Password; a "standard" connection property as suggested by the J2EE Connector Architecture |
javax.resource.spi.security.PasswordCredential |
getPasswordCredential(javax.security.auth.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 java.lang.String |
getPasswordFromRequestInfo(javax.resource.spi.ConnectionRequestInfo info)
Retrieves the password from the supplied connection request info object. |
java.lang.String |
getPortNumber()
Retrieves the PortNumber; a "standard" connection property as suggested by the J2EE Connector Architecture |
java.lang.String |
getRootLogContext()
|
java.lang.String |
getServerName()
Retrieves the ServerName; a "standard" connection property as suggested by the J2EE Connector Architecture. |
java.lang.String |
getUserName()
Retrieves the UserName; a "standard" connection property as suggested by the J2EE Connector Architecture |
protected java.lang.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(java.util.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(java.util.Set connectionSet,
javax.security.auth.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(java.beans.PropertyChangeListener l)
To support JavaBeans constrained properties |
void |
removeVetoableChangeListener(java.beans.VetoableChangeListener l)
To support JavaBeans constrained properties |
void |
setAdapterDescription(java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.lang.String strAdditionalLogContext)
Sets additional context information for identifying logging configuration. |
void |
setConnectionURL(java.lang.String strConnectionURL)
Sets the ConnectionURL for connecting to the underlying EIS. |
void |
setCountryCode(java.lang.String strCountryCode)
Sets the country code for enabling I18N log and exception messages from instances of this class. |
void |
setLanguageCode(java.lang.String strLanguageCode)
Sets the language code for enabling I18N log and exception messages from instances of this class. |
void |
setLogConfigFile(java.lang.String strLogConfigFile)
Sets the name for the log configuration file used by this instance. |
void |
setLogLevel(java.lang.String strLogLevel)
Sets the log priority level for 'this' instance. |
void |
setLogWriter(java.io.PrintWriter out)
|
void |
setMessageBundleBase(java.lang.String strMessageBundleBase)
Sets the base name for the message bundle used by this instance. |
void |
setPassword(java.lang.String strPassword)
Sets the Password for connecting to the underlying EIS. |
void |
setPortNumber(java.lang.String strPortNumber)
Sets the PortNumber for connecting to the underlying EIS. |
void |
setRootLogContext(java.lang.String strRootLogContext)
Sets the root log context for this factory. |
void |
setServerName(java.lang.String strServerName)
Sets the ServerName for connecting to the underlying EIS. |
void |
setUserName(java.lang.String strUserName)
Sets the UserName for connecting to the underlying EIS. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone,
finalize,
getClass,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected java.beans.VetoableChangeSupport m_vetos
protected java.beans.PropertyChangeSupport m_changes
protected java.lang.String m_strRootLogContext
protected java.lang.String m_strAdditionalLogContext
protected java.lang.String m_strLogConfigFile
protected java.lang.String m_strLogLevel
protected java.lang.String m_strMessageBundleBase
protected java.lang.String m_strLanguageCode
protected java.lang.String m_strCountryCode
protected java.lang.String m_strAdapterName
protected java.lang.String m_strAdapterDescription
protected java.lang.String m_strAdapterVersion
protected java.lang.String m_strAdapterVendorName
protected java.lang.String m_strUserName
protected char[] m_achPassword
protected java.lang.String m_strServerName
protected java.lang.String m_strPortNumber
protected java.lang.String m_strConnectionURL
Constructor Detail |
public AbstractManagedConnectionFactory() throws javax.resource.ResourceException
Method Detail |
protected void assertValidLicense() throws javax.resource.ResourceException
ManagedConnectionFactory
object. Adapter
developers should override the checkLicense
method to perform
the adapter specific license check.
protected void assertValidState() throws javax.resource.ResourceException
protected boolean isValidState() throws javax.resource.ResourceException
javax.resource.spi.ConnectionFactory
instances
or javax.resource.spi.ManagedConnection
instances.
protected boolean checkState()
protected void initializeLogResources() throws javax.resource.ResourceException
protected ILogger getLogger() throws java.lang.IllegalStateException
protected LogContext getLogContext() throws java.lang.IllegalStateException
public void setLogLevel(java.lang.String strLogLevel) throws javax.resource.ResourceException
public java.lang.String getLogLevel()
public void setRootLogContext(java.lang.String strRootLogContext) throws javax.resource.ResourceException
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.public java.lang.String getRootLogContext()
public void setAdditionalLogContext(java.lang.String strAdditionalLogContext) throws javax.resource.ResourceException
strAdditionalLogContext
- - a value that provides additional context
information for this instance.public java.lang.String getAdditionalLogContext()
public void setUserName(java.lang.String strUserName) throws javax.resource.ResourceException
strUserName
- - a valid UserName for the underlying EIS.public java.lang.String getUserName()
public void setPassword(java.lang.String strPassword) throws javax.resource.ResourceException
strPassword
- - a valid Password for the underlying EIS.public java.lang.String getPassword()
public void setServerName(java.lang.String strServerName) throws javax.resource.ResourceException
strServerName
- - a valid ServerName for the underlying EIS.public java.lang.String getServerName()
public void setPortNumber(java.lang.String strPortNumber) throws javax.resource.ResourceException
strPortNumber
- - a valid PortNumber for the underlying EIS.public java.lang.String getPortNumber()
public void setConnectionURL(java.lang.String strConnectionURL) throws javax.resource.ResourceException
strConnectionURL
- - a valid ConnectionURL for the underlying EIS.public java.lang.String getConnectionURL()
public void setLanguageCode(java.lang.String strLanguageCode) throws javax.resource.ResourceException
strLanguageCode
- - lowercase two-letter ISO-639 code.public java.lang.String getLanguageCode()
public void setCountryCode(java.lang.String strCountryCode) throws javax.resource.ResourceException
strCountryCode
- - uppercase two-letter ISO-3166 codepublic java.lang.String getCountryCode()
public void setMessageBundleBase(java.lang.String strMessageBundleBase) throws javax.resource.ResourceException
strMessageBundleBase
- - a valid message bundle base name.public java.lang.String getMessageBundleBase()
public void setLogConfigFile(java.lang.String strLogConfigFile) throws javax.resource.ResourceException
strLogConfigFile
- - a valid message bundle base name.public java.lang.String getLogConfigFile()
protected void logInfo()
protected void initAdapterMetaData(java.util.ResourceBundle resourceBundle)
resourceBundle
- - provides internationalized and localized versions
of adapter metadata.logger
- - an object used to log information about the metadata
retrieval process. Currently, if a MissingResourceException
is generated, a WARNING is logged.protected java.lang.String getUserNameFromRequestInfo(javax.resource.spi.ConnectionRequestInfo info)
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.
protected java.lang.String getPasswordFromRequestInfo(javax.resource.spi.ConnectionRequestInfo info)
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.
public javax.resource.spi.security.PasswordCredential getPasswordCredential(javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo info) throws javax.resource.ResourceException
protected ValidationResult checkLicense()
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.public java.lang.Object createConnectionFactory() throws javax.resource.ResourceException
public java.lang.Object createConnectionFactory(javax.resource.spi.ConnectionManager connectionManager) throws javax.resource.ResourceException
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.protected abstract java.lang.Object createConnectionFactory(javax.resource.spi.ConnectionManager connectionManager, java.lang.String strAdapterName, java.lang.String strAdapterDescription, java.lang.String strAdapterVersion, java.lang.String strAdapterVendorName) throws javax.resource.ResourceException
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.strVendorName
- - the producer of the adapter.public boolean equals(java.lang.Object other)
public int hashCode()
protected boolean hasSameBaseProperties(AbstractManagedConnectionFactory otherMcf)
com.bea.adapter.spi.AbstractManagedConnectionFactory
protected boolean hasSameConnectionProperties(AbstractManagedConnectionFactory otherMcf)
protected boolean compareCharArrays(char[] achMyProperty, char[] achOtherProperty)
protected boolean comparePropertyValues(java.lang.Object myProperty, java.lang.Object otherProperty)
public void setLogWriter(java.io.PrintWriter out) throws javax.resource.ResourceException
public java.io.PrintWriter getLogWriter() throws javax.resource.ResourceException
public java.lang.String toString()
protected void appendField(java.lang.StringBuffer sb, java.lang.String strPropertyName, java.lang.Object objValue)
public final java.lang.String getAdapterName()
public final void setAdapterName(java.lang.String strAdapterName) throws javax.resource.ResourceException
public final java.lang.String getAdapterDescription()
public final void setAdapterDescription(java.lang.String strAdapterDescription) throws javax.resource.ResourceException
public final java.lang.String getAdapterVersion()
public final void setAdapterVersion(java.lang.String strAdapterVersion) throws javax.resource.ResourceException
public final java.lang.String getAdapterVendor()
public final void setAdapterVendor(java.lang.String strAdapterVendor) throws javax.resource.ResourceException
public javax.resource.spi.ManagedConnection matchManagedConnections(java.util.Set connectionSet, javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo info) throws javax.resource.ResourceException
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.
public void addVetoableChangeListener(java.beans.VetoableChangeListener l)
public void removeVetoableChangeListener(java.beans.VetoableChangeListener l)
public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
|
WebLogic Integration | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |