com.infoengine.connector
Class IeManagedConnectionFactory

java.lang.Object
  extended by com.infoengine.connector.IeManagedConnectionFactory
All Implemented Interfaces:
java.io.Serializable, javax.resource.spi.ManagedConnectionFactory

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

this object typically interacts with an application server for creating ConnectionFactories and ManagedConnections and to match ManagedConnections for connection requests with pooled ManagedConnections.

See Also:
Serialized Form

Constructor Summary
IeManagedConnectionFactory()
           
 
Method Summary
 java.lang.Object createConnectionFactory()
          create a default ConnectionFactory for us in a "non managed" environment.
 java.lang.Object createConnectionFactory(javax.resource.spi.ConnectionManager cxManager)
          create a ConnectionFactory with a specific ConnectionManager.
 javax.resource.spi.ManagedConnection createManagedConnection(javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo cxRequestInfo)
          create a new managed connection
 boolean equals(java.lang.Object other)
          compare this ManagedConnectionFactory to another for equality
 java.lang.String getConnectionImplementation()
          get the connection implementation this ManagedConnectionFactory uses when creating ConnectionFactories
 java.lang.String getConnectionProperties()
          get the connection implementation this ManagedConnectionFactory uses when creating ConnectionFactories
 java.lang.String getLogLevel()
          get the log level
 java.io.PrintWriter getLogWriter()
          get the PrintWriter instance this ManagedConnectionFactory is using
 int hashCode()
          generate this objects hashCode.
 void loadConnectionProperties(java.io.InputStream is)
          load connection properties from an input stream
 javax.resource.spi.ManagedConnection matchManagedConnections(java.util.Set connectionSet, javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo cxRequestInfo)
          given a set of ManagedConnections return one that matches the subject and connection request info criteria.
 void setConnectionImplementation(java.lang.String impl)
          set the connection implementation this ManagedConnectionFactory is to use when producing ConnectionFactories.
 void setConnectionProperties(java.lang.String props)
          set the connection implementation this ManagedConnectionFactory is to use when producing ConnectionFactories.
 void setConnectionProperty(java.lang.String name, java.lang.String value)
          set a single connection property
 void setLogLevel(java.lang.String level)
          set the log level.
 void setLogWriter(java.io.PrintWriter out)
          set the PrintWriter this ManagedConnectionFactory should use to log info
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IeManagedConnectionFactory

public IeManagedConnectionFactory()
Method Detail

createConnectionFactory

public java.lang.Object createConnectionFactory()
                                         throws javax.resource.ResourceException
create a default ConnectionFactory for us in a "non managed" environment.

Specified by:
createConnectionFactory in interface javax.resource.spi.ManagedConnectionFactory
Returns:
Object (IeConnectionFactory)
Throws:
javax.resource.ResourceException

createConnectionFactory

public java.lang.Object createConnectionFactory(javax.resource.spi.ConnectionManager cxManager)
                                         throws javax.resource.ResourceException
create a ConnectionFactory with a specific ConnectionManager. used in a "managed" environment. the ConnectionManager here is implemented by the application server vendor.

Specified by:
createConnectionFactory in interface javax.resource.spi.ManagedConnectionFactory
Parameters:
cxManager - a connection manager
Returns:
Object (IeConnectionFactory)
Throws:
javax.resource.ResourceException - if something bad happens

createManagedConnection

public javax.resource.spi.ManagedConnection createManagedConnection(javax.security.auth.Subject subject,
                                                                    javax.resource.spi.ConnectionRequestInfo cxRequestInfo)
                                                             throws javax.resource.ResourceException
create a new managed connection

Specified by:
createManagedConnection in interface javax.resource.spi.ManagedConnectionFactory
Parameters:
subject - security credentials supplied in a "container managed sign on" scenario.
cxRequestInfo - connection request info supplied by appication
Returns:
ManagedConnection
Throws:
javax.resource.ResourceException - if something bad happens

equals

public boolean equals(java.lang.Object other)
compare this ManagedConnectionFactory to another for equality

Specified by:
equals in interface javax.resource.spi.ManagedConnectionFactory
Overrides:
equals in class java.lang.Object
Returns:
other object to compare to

getLogWriter

public java.io.PrintWriter getLogWriter()
                                 throws javax.resource.ResourceException
get the PrintWriter instance this ManagedConnectionFactory is using

Specified by:
getLogWriter in interface javax.resource.spi.ManagedConnectionFactory
Returns:
PrintWriter
Throws:
javax.resource.ResourceException - (not really)

hashCode

public int hashCode()
generate this objects hashCode. based on connection request info.

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

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
given a set of ManagedConnections return one that matches the subject and connection request info criteria. This method is called by a ConnectionManager to find a free connection to fulfill a connection request. Objects in connectionSet must be instances of IeManagedConnection.

Specified by:
matchManagedConnections in interface javax.resource.spi.ManagedConnectionFactory
Parameters:
connectionSet - set of ManagedConnections
subject - security credentials in connection request
cxRequestInfo - connection request info in connection request
Returns:
ManagedConnection or null if no suitable connection found
Throws:
javax.resource.ResourceException - (not really)

setLogWriter

public void setLogWriter(java.io.PrintWriter out)
                  throws javax.resource.ResourceException
set the PrintWriter this ManagedConnectionFactory should use to log info

Specified by:
setLogWriter in interface javax.resource.spi.ManagedConnectionFactory
Parameters:
out - the PrintWriter
Throws:
javax.resource.ResourceException - (not really)

setConnectionImplementation

public void setConnectionImplementation(java.lang.String impl)
                                 throws java.beans.PropertyVetoException
set the connection implementation this ManagedConnectionFactory is to use when producing ConnectionFactories. The app server may call this method to populate this deploy time property.

Parameters:
impl - the connection implementation
Throws:
java.beans.PropertyVetoException - if someone doesn't like the new value

getConnectionImplementation

public java.lang.String getConnectionImplementation()
get the connection implementation this ManagedConnectionFactory uses when creating ConnectionFactories

Returns:
String

loadConnectionProperties

public void loadConnectionProperties(java.io.InputStream is)
                              throws java.io.IOException
load connection properties from an input stream

Parameters:
is - the property input stream
Throws:
java.io.IOException

setConnectionProperty

public void setConnectionProperty(java.lang.String name,
                                  java.lang.String value)
set a single connection property

Parameters:
name - the property name
value - the property value

setConnectionProperties

public void setConnectionProperties(java.lang.String props)
                             throws java.beans.PropertyVetoException
set the connection implementation this ManagedConnectionFactory is to use when producing ConnectionFactories. The app server may call this method to populate this deploy time property.

Parameters:
impl - the connection implementation
Throws:
java.beans.PropertyVetoException - if someone doesn't like the new value

getConnectionProperties

public java.lang.String getConnectionProperties()
get the connection implementation this ManagedConnectionFactory uses when creating ConnectionFactories

Returns:
String

setLogLevel

public void setLogLevel(java.lang.String level)
                 throws java.beans.PropertyVetoException
set the log level. the app server calls this method to set the deploy time property.

Parameters:
level - string representation of an integer
Throws:
java.beans.PropertyVetoException - if someone doesn't like the new value

getLogLevel

public java.lang.String getLogLevel()
get the log level

Returns:
String