org.drools.jsr94.jca.spi
Class RuleConnectionFactory

java.lang.Object
  |
  +--javax.rules.RuleServiceProvider
        |
        +--org.drools.jsr94.rules.RuleServiceProviderImpl
              |
              +--org.drools.jsr94.jca.spi.RuleConnectionFactory
All Implemented Interfaces:
javax.resource.cci.ConnectionFactory, javax.naming.Referenceable, javax.resource.Referenceable, java.io.Serializable

public class RuleConnectionFactory
extends RuleServiceProviderImpl
implements javax.resource.cci.ConnectionFactory, java.io.Serializable, javax.resource.Referenceable

ConnectionFactory provides an interface for getting connection to an EIS instance. An implementation of ConnectionFactory interface is provided by a resource adapter.

Application code looks up a ConnectionFactory instance from JNDI namespace and uses it to get EIS connections.

An implementation class for ConnectionFactory is required to implement java.io.Serializable and javax.resource.Referenceableinterfaces to support JNDI registration.

Author:
thomas diesler
See Also:
Serialized Form

Constructor Summary
RuleConnectionFactory(javax.resource.spi.ManagedConnectionFactory mcf, javax.resource.spi.ConnectionManager cm)
           
 
Method Summary
 javax.resource.cci.Connection getConnection()
          ConnectionFactory provides an interface for getting connection to an EIS instance.
 javax.resource.cci.Connection getConnection(javax.resource.cci.ConnectionSpec connectionSpec)
          Gets a connection to an EIS instance.
 javax.resource.cci.ResourceAdapterMetaData getMetaData()
          Gets metadata for the Resource Adapter.
 javax.resource.cci.RecordFactory getRecordFactory()
          Gets a RecordFactory instance.
 javax.naming.Reference getReference()
          Retrieves the Reference of this object.
 void setReference(javax.naming.Reference reference)
          Sets the Reference instance.
 
Methods inherited from class org.drools.jsr94.rules.RuleServiceProviderImpl
getRuleAdministrator, getRuleRuntime
 
Methods inherited from class javax.rules.RuleServiceProvider
createInstance, setClassLoader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RuleConnectionFactory

public RuleConnectionFactory(javax.resource.spi.ManagedConnectionFactory mcf,
                             javax.resource.spi.ConnectionManager cm)
                      throws javax.resource.ResourceException
Method Detail

getConnection

public javax.resource.cci.Connection getConnection()
                                            throws javax.resource.ResourceException
ConnectionFactory provides an interface for getting connection to an EIS instance. An implementation of ConnectionFactory interface is provided by a resource adapter.

Application code looks up a ConnectionFactory instance from JNDI namespace and uses it to get EIS connections.

An implementation class for ConnectionFactory is required to implement java.io.Serializable and javax.resource.Referenceableinterfaces to support JNDI registration.

Specified by:
getConnection in interface javax.resource.cci.ConnectionFactory

getConnection

public javax.resource.cci.Connection getConnection(javax.resource.cci.ConnectionSpec connectionSpec)
                                            throws javax.resource.ResourceException
Gets a connection to an EIS instance. A component should use the getConnection variant with javax.resource.cci.ConnectionSpec parameter, if it needs to pass any resource adapter specific security information and connection parameters. the component- managed sign-on case, an application component passes security information (example: username, password) through the ConnectionSpec instance.

It is important to note that the properties passed through the getConnection method should be client-specific (example: username, password, language) and not related to the configuration of a target EIS instance (example: port number, server name). The ManagedConnectionFactory instance is configured with complete set of properties required for the creation of a connection to an EIS instance.

Specified by:
getConnection in interface javax.resource.cci.ConnectionFactory

getRecordFactory

public javax.resource.cci.RecordFactory getRecordFactory()
                                                  throws javax.resource.ResourceException
Gets a RecordFactory instance. The RecordFactory is used for the creation of generic Record instances.
Specified by:
getRecordFactory in interface javax.resource.cci.ConnectionFactory

getMetaData

public javax.resource.cci.ResourceAdapterMetaData getMetaData()
                                                       throws javax.resource.ResourceException
Gets metadata for the Resource Adapter. Note that the metadata information is about the ResourceAdapter and not the EIS instance. An invocation of this method does not require that an active connection to an EIS instance should have been established.
Specified by:
getMetaData in interface javax.resource.cci.ConnectionFactory

setReference

public void setReference(javax.naming.Reference reference)
Sets the Reference instance. This method is called by the deployment code to set the Reference that can be later returned by the getReference method (as defined in the javax.naming.Referenceable interface).
Specified by:
setReference in interface javax.resource.Referenceable

getReference

public javax.naming.Reference getReference()
                                    throws javax.naming.NamingException
Retrieves the Reference of this object.
Specified by:
getReference in interface javax.naming.Referenceable


Copyright © 2001-2003 The Werken Company. All Rights Reserved.