javax.datamining.resource
Interface ConnectionFactory

All Superinterfaces:
Factory

public interface ConnectionFactory
extends Factory

A ConnectionFactory provides an interface for getting a connection to a DME instance.

Application code looks up a ConnectionFactory instance from a JNDI namespace and uses it to get DME connections. An implementation class for ConnectionFactory is required to implement java.io.Serializable and javax.resource.Referenceable interfaces to support JNDI registration. @comment getConnection(): getConnection(ConnectionSpec) must be able to produce a valid connection. If not null, the connection must be a valid one and proceed to use the connection. getConnection(Connection): A null connection can be returned even if a non-null connection is provided. If not null, the connection must be a valid one and proceed to use the connection. getConnection(ConnectionSpec): A null connection can be returned even if a non-null connection is provided. If not null, the connection must be a valid one and proceed to use the connection.

Author:
JSR-73 Java Data Mining Expert Group
See Also:
Factory

Method Summary
 Connection getConnection()
          Gets a connection to a DME instance.
 Connection getConnection(javax.resource.cci.Connection connection)
          Creates and returns a Connection from the specified JCX connection.
 Connection getConnection(ConnectionSpec spec)
          Gets a connection to a DME instance.
 ConnectionSpec getConnectionSpec()
          Creates a connection specification to be passed into getConnection(ConnectionSpec).
 boolean supportsCapability(ConnectionCapability capability)
          Returns true if the specified capability is supported by the implementation.
 

Method Detail

getConnection

public Connection getConnection()
                         throws JDMException
Gets a connection to a DME instance. This getConnection variant should be used when a JDM client wants the container to manage DME sign-on.

Returns:
Connection
Throws:
JDMException

getConnection

public Connection getConnection(javax.resource.cci.Connection connection)
                         throws JDMException
Creates and returns a Connection from the specified JCX connection. (The parameter type is javax.resource.cci.Connection.)

Parameters:
connection -
Returns:
Connection
Throws:
JDMException

getConnection

public Connection getConnection(ConnectionSpec spec)
                         throws JDMException
Gets a connection to a DME instance. A JDM client needs to pass security information such as user name and 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).

Parameters:
spec - The specification of the connection to be created.
Returns:
Connection
Throws:
JDMException

getConnectionSpec

public ConnectionSpec getConnectionSpec()
Creates a connection specification to be passed into getConnection(ConnectionSpec).

Returns:
ConnectionSpec

supportsCapability

public boolean supportsCapability(ConnectionCapability capability)
                           throws JDMException
Returns true if the specified capability is supported by the implementation. Returns false otherwise.

Parameters:
capability -
Returns:
boolean
Throws:
JDMException