org.mule.ra
Class MuleManagedConnectionFactory

java.lang.Object
  extended byorg.mule.ra.MuleManagedConnectionFactory
All Implemented Interfaces:
java.io.Serializable

public class MuleManagedConnectionFactory
extends java.lang.Object
implements java.io.Serializable

MuleManagedConnectionFactory TODO

Version:
$Revision: 1.2 $
Author:
Ross Mason
See Also:
Serialized Form

Field Summary
protected static Log logger
          logger used by this class
 
Constructor Summary
MuleManagedConnectionFactory()
           
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener lis)
          Associate PropertyChangeListener with the ManagedConnectionFactory, in order to notify about properties changes.
 java.lang.Object createConnectionFactory()
          Creates a Connection Factory instance.
 java.lang.Object createConnectionFactory(ConnectionManager cxManager)
          Creates a Connection Factory instance.
 ManagedConnection createManagedConnection(javax.security.auth.Subject subject, ConnectionRequestInfo cxRequestInfo)
          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.
 java.io.PrintWriter getLogWriter()
          Gets the log writer for this ManagedConnectionFactory instance.
 java.lang.String getPassword()
          Returns the value of the password property.
 java.lang.String getUsername()
          Returns the value of the userName property.
 ManagedConnection matchManagedConnections(java.util.Set connectionSet, javax.security.auth.Subject subject, ConnectionRequestInfo cxRequestInfo)
          Returns a matched managed connection from the candidate set of connections.
 void removePropertyChangeListener(java.beans.PropertyChangeListener lis)
          Delete association of PropertyChangeListener with the ManagedConnectionFactory.
 void setLogWriter(java.io.PrintWriter out)
          Sets the log writer for this ManagedConnectionFactory instance.
 void setPassword(java.lang.String password)
          Sets the value of the password property.
 void setUsername(java.lang.String username)
          Sets the value of the userName property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static transient Log logger
logger used by this class

Constructor Detail

MuleManagedConnectionFactory

public MuleManagedConnectionFactory()
Method Detail

createConnectionFactory

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

Parameters:
cxManager - ConnectionManager to be associated with created EIS connection factory instance
Returns:
EIS-specific Connection Factory instance
Throws:
javax.resource.ResourceException - if the attempt to create a connection factory fails
ResourceException

createConnectionFactory

public java.lang.Object createConnectionFactory()
                                         throws ResourceException
Creates a Connection Factory instance. The Connection Factory instance is initialized with a default ConnectionManager. In the non-managed scenario, the ConnectionManager is provided by the resource adapter.

Returns:
EIS-specific Connection Factory instance
Throws:
ResourceException - if the attempt to create a connection factory fails

createManagedConnection

public ManagedConnection createManagedConnection(javax.security.auth.Subject subject,
                                                 ConnectionRequestInfo cxRequestInfo)
                                          throws ResourceException
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.

Parameters:
subject - caller's security information
cxRequestInfo - additional resource adapter specific connection request information
Returns:
ManagedConnection instance
Throws:
ResourceException - if the attempt to create a connection fails

matchManagedConnections

public ManagedConnection matchManagedConnections(java.util.Set connectionSet,
                                                 javax.security.auth.Subject subject,
                                                 ConnectionRequestInfo cxRequestInfo)
                                          throws ResourceException
Returns a matched managed 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. A MC that has the requested store is returned as a match

Parameters:
connectionSet - candidate connection set
subject - caller's security information
cxRequestInfo - additional resource adapter specific connection request information
Returns:
ManagedConnection if resource adapter finds an acceptable match, otherwise null
Throws:
ResourceException - if the match fails

setLogWriter

public void setLogWriter(java.io.PrintWriter out)
                  throws ResourceException
Sets 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.

Parameters:
out - an output stream for error logging and tracing
Throws:
ResourceException - if the method fails

getLogWriter

public java.io.PrintWriter getLogWriter()
                                 throws ResourceException
Gets the log writer for this ManagedConnectionFactory instance.

Returns:
PrintWriter an output stream for error logging and tracing
Throws:
ResourceException - if the method fails

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener lis)
Associate PropertyChangeListener with the ManagedConnectionFactory, in order to notify about properties changes.

Parameters:
lis - the PropertyChangeListener to be associated with the ManagedConnectionFactory

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener lis)
Delete association of PropertyChangeListener with the ManagedConnectionFactory.

Parameters:
lis - the PropertyChangeListener to be removed

getUsername

public java.lang.String getUsername()
Returns the value of the userName property.

Returns:
the value of the userName property

setUsername

public void setUsername(java.lang.String username)
Sets the value of the userName property.

Parameters:
username - String containing the value to be assigned to userName

getPassword

public java.lang.String getPassword()
Returns the value of the password property.

Returns:
the value of the password property

setPassword

public void setPassword(java.lang.String password)
Sets the value of the password property.

Parameters:
password - String containing the value to be assigned to password


Copyright © 2003-2005 SymphonySoft Limited. All Rights Reserved.