org.jppf.jca.spi
Class JPPFManagedConnectionFactory

java.lang.Object
  extended by org.jppf.jca.util.JPPFAccessorImpl
      extended by org.jppf.jca.spi.JPPFManagedConnectionFactory
All Implemented Interfaces:
Serializable, ManagedConnectionFactory, ResourceAdapterAssociation, JPPFAccessor

public class JPPFManagedConnectionFactory
extends JPPFAccessorImpl
implements ManagedConnectionFactory, ResourceAdapterAssociation

Implementation of the ManagedConnectionFactory interface.

Author:
Laurent Cohen
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jppf.jca.util.JPPFAccessorImpl
jppfClient, logWriter
 
Constructor Summary
JPPFManagedConnectionFactory()
          Default constructor.
 
Method Summary
 Object createConnectionFactory()
          Create a jca connection factory.
 Object createConnectionFactory(ConnectionManager manager)
          Create a jca connection factory using a specified connection manager.
 ManagedConnection createManagedConnection(Subject subject, ConnectionRequestInfo cri)
          Create a managed conneciton.
 boolean equals(Object obj)
          Determine whether 2 objects are equal.
 JPPFJcaClient getJppfClient()
          Get the JPPF client used to submit tasks.
 ResourceAdapter getResourceAdapter()
          Get the handle to the resource adapter.
 int hashCode()
          Get this managed conncetion factory's hashcode.
 ManagedConnection matchManagedConnections(Set set, Subject subject, ConnectionRequestInfo cri)
          Returns a matched connection from the candidate set of connections.
 void setResourceAdapter(ResourceAdapter resourceAdapter)
          Set the handle to the resource adapter.
 
Methods inherited from class org.jppf.jca.util.JPPFAccessorImpl
getLogWriter, setJppfClient, setLogWriter
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.resource.spi.ManagedConnectionFactory
getLogWriter, setLogWriter
 

Constructor Detail

JPPFManagedConnectionFactory

public JPPFManagedConnectionFactory()
Default constructor.

Method Detail

createConnectionFactory

public Object createConnectionFactory()
                               throws ResourceException
Create a jca connection factory. This method is called by the application server.

Specified by:
createConnectionFactory in interface ManagedConnectionFactory
Returns:
a JPPFConnectionFactory instance.
Throws:
ResourceException - if the connection factory could not be created.
See Also:
ManagedConnectionFactory.createConnectionFactory()

createConnectionFactory

public Object createConnectionFactory(ConnectionManager manager)
                               throws ResourceException
Create a jca connection factory using a specified connection manager.

Specified by:
createConnectionFactory in interface ManagedConnectionFactory
Parameters:
manager - the connection manager to use.
Returns:
a JPPFConnectionFactory instance.
Throws:
ResourceException - if the connection factory could not be created.
See Also:
ManagedConnectionFactory.createConnectionFactory(javax.resource.spi.ConnectionManager)

createManagedConnection

public ManagedConnection createManagedConnection(Subject subject,
                                                 ConnectionRequestInfo cri)
                                          throws ResourceException
Create a managed conneciton.

Specified by:
createManagedConnection in interface ManagedConnectionFactory
Parameters:
subject - not used.
cri - not used.
Returns:
a JPPFManagedConnection instance.
Throws:
ResourceException - if the managed connection could not be created.
See Also:
ManagedConnectionFactory.createManagedConnection(javax.security.auth.Subject, javax.resource.spi.ConnectionRequestInfo)

matchManagedConnections

public ManagedConnection matchManagedConnections(Set set,
                                                 Subject subject,
                                                 ConnectionRequestInfo cri)
                                          throws ResourceException
Returns a matched connection from the candidate set of connections.

Specified by:
matchManagedConnections in interface ManagedConnectionFactory
Parameters:
set - not used
subject - not used
cri - not used
Returns:
a JPPFManagedConnection instance, or null if none is available.
Throws:
ResourceException - always.
See Also:
ManagedConnectionFactory.matchManagedConnections(java.util.Set, javax.security.auth.Subject, javax.resource.spi.ConnectionRequestInfo)

getResourceAdapter

public ResourceAdapter getResourceAdapter()
Get the handle to the resource adapter.

Specified by:
getResourceAdapter in interface ResourceAdapterAssociation
Returns:
a ResourceAdapter.
See Also:
ResourceAdapterAssociation.getResourceAdapter()

setResourceAdapter

public void setResourceAdapter(ResourceAdapter resourceAdapter)
                        throws ResourceException
Set the handle to the resource adapter.

Specified by:
setResourceAdapter in interface ResourceAdapterAssociation
Parameters:
resourceAdapter - a ResourceAdapter.
Throws:
ResourceException - if the resource adapter could not be set.
See Also:
ResourceAdapterAssociation.setResourceAdapter(javax.resource.spi.ResourceAdapter)

equals

public boolean equals(Object obj)
Determine whether 2 objects are equal.

Specified by:
equals in interface ManagedConnectionFactory
Overrides:
equals in class Object
Parameters:
obj - the other object to compare to.
Returns:
true if the objects are equal, false otherwise.
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Get this managed conncetion factory's hashcode.

Specified by:
hashCode in interface ManagedConnectionFactory
Overrides:
hashCode in class Object
Returns:
the hashcode as an int.
See Also:
Object.hashCode()

getJppfClient

public JPPFJcaClient getJppfClient()
Get the JPPF client used to submit tasks.

Specified by:
getJppfClient in interface JPPFAccessor
Overrides:
getJppfClient in class JPPFAccessorImpl
Returns:
a JPPFJcaClient instance.


Copyright © 2005-2010 JPPF Team.