org.mule.module.jca
Class MuleManagedConnectionFactory

java.lang.Object
  extended by org.mule.module.jca.MuleManagedConnectionFactory
All Implemented Interfaces:
java.io.Serializable, javax.resource.spi.ManagedConnectionFactory

public class MuleManagedConnectionFactory
extends java.lang.Object
implements javax.resource.spi.ManagedConnectionFactory

MuleManagedConnectionFactory TODO

See Also:
Serialized Form

Field Summary
protected  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(javax.resource.spi.ConnectionManager cxManager)
          Creates a Connection Factory instance.
 javax.resource.spi.ManagedConnection createManagedConnection(javax.security.auth.Subject subject, javax.resource.spi.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.
 boolean equals(java.lang.Object obj)
           
 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.
 int hashCode()
           
 javax.resource.spi.ManagedConnection matchManagedConnections(java.util.Set connectionSet, javax.security.auth.Subject subject, javax.resource.spi.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, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected transient Log logger
logger used by this class

Constructor Detail

MuleManagedConnectionFactory

public MuleManagedConnectionFactory()
Method Detail

hashCode

public int hashCode()
Specified by:
hashCode in interface javax.resource.spi.ManagedConnectionFactory
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Specified by:
equals in interface javax.resource.spi.ManagedConnectionFactory
Overrides:
equals in class java.lang.Object

createConnectionFactory

public java.lang.Object createConnectionFactory(javax.resource.spi.ConnectionManager cxManager)
                                         throws javax.resource.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.

Specified by:
createConnectionFactory in interface javax.resource.spi.ManagedConnectionFactory
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

createConnectionFactory

public java.lang.Object createConnectionFactory()
                                         throws javax.resource.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.

Specified by:
createConnectionFactory in interface javax.resource.spi.ManagedConnectionFactory
Returns:
EIS-specific Connection Factory instance
Throws:
javax.resource.ResourceException - if the attempt to create a connection factory fails

createManagedConnection

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

Specified by:
createManagedConnection in interface javax.resource.spi.ManagedConnectionFactory
Parameters:
subject - caller's security information
cxRequestInfo - additional resource adapter specific connection request information
Returns:
ManagedConnection instance
Throws:
javax.resource.ResourceException - if the attempt to create a connection fails

matchManagedConnections

public javax.resource.spi.ManagedConnection matchManagedConnections(java.util.Set connectionSet,
                                                                    javax.security.auth.Subject subject,
                                                                    javax.resource.spi.ConnectionRequestInfo cxRequestInfo)
                                                             throws javax.resource.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

Specified by:
matchManagedConnections in interface javax.resource.spi.ManagedConnectionFactory
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:
javax.resource.ResourceException - if the match fails

setLogWriter

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

Specified by:
setLogWriter in interface javax.resource.spi.ManagedConnectionFactory
Parameters:
out - an output stream for error logging and tracing
Throws:
javax.resource.ResourceException - if the method fails

getLogWriter

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

Specified by:
getLogWriter in interface javax.resource.spi.ManagedConnectionFactory
Returns:
PrintWriter an output stream for error logging and tracing
Throws:
javax.resource.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-2010 MuleSoft, Inc.. All Rights Reserved.