org.objectweb.speedo.jca
Class JdoManagedConnectionFactory

java.lang.Object
  extended byorg.objectweb.speedo.jca.JdoManagedConnectionFactory
All Implemented Interfaces:
JdoAttributeController, javax.resource.spi.ManagedConnectionFactory, java.io.Serializable

public class JdoManagedConnectionFactory
extends java.lang.Object
implements javax.resource.spi.ManagedConnectionFactory, JdoAttributeController

Author:
P. Dechamboux
See Also:
Serialized Form

Field Summary
protected  JdoConnectionFactory connectionFactory
          It is assumed that only one ConnectionFactory is actually created by a ManagedConnectionFactory.
protected  ProxyManagerFactory pmf
          The factory for managing JDO transaction contexts.
protected  boolean started
           
protected  javax.transaction.TransactionManager tm
           
 
Constructor Summary
JdoManagedConnectionFactory()
           
 
Method Summary
 java.lang.Object createConnection()
          Delegates the creation of a Connection to the ConnectionFactory.
 java.lang.Object createConnectionFactory()
          Creates a JdoConnectionFactory; yields the existing one if any.
 java.lang.Object createConnectionFactory(javax.resource.spi.ConnectionManager cm)
          Creates a JdoConnectionFactory; yields the existing one if any.
 javax.resource.spi.ManagedConnection createManagedConnection(javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo info)
          Creates a new JdoManagedConnection.
protected  void finalize()
           
 java.io.PrintWriter getLogWriter()
          Retrieves the printwriter used for the logging.
 java.lang.String getPropertyFile()
          Gives access to the name of the property file for initializing the underlying JDO implementation.
 java.lang.String getTransactionManagerJNDIName()
          Gives access to the JNDI name of the transaction manager (javax.transaction.TransactionManager).
 javax.resource.spi.ManagedConnection matchManagedConnections(java.util.Set set, javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo info)
          No matching rules supported.
 void setLogWriter(java.io.PrintWriter writer)
          If he given PrintWrtier is a Loggable implementation then the inner logger and the inner loggerFactory are used.
 void setPropertyFile(java.lang.String pf)
          Assigns to this JDO connector the name of the property file for initializing the underlying JDO implementation.
 void setTransactionManager(javax.transaction.TransactionManager tm)
           
 void setTransactionManagerJNDIName(java.lang.String jndiname)
          Assigns the JNDI name of the transaction manager (javax.transaction.TransactionManager).
 void start()
          Starts this JdoManagedConnectionFactory.
 void stop()
          Stops this JdoManagedConnectionFactory.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.resource.spi.ManagedConnectionFactory
equals, hashCode
 

Field Detail

connectionFactory

protected JdoConnectionFactory connectionFactory
It is assumed that only one ConnectionFactory is actually created by a ManagedConnectionFactory.


pmf

protected ProxyManagerFactory pmf
The factory for managing JDO transaction contexts.


started

protected boolean started

tm

protected javax.transaction.TransactionManager tm
Constructor Detail

JdoManagedConnectionFactory

public JdoManagedConnectionFactory()
Method Detail

start

public void start()
           throws javax.resource.ResourceException
Starts this JdoManagedConnectionFactory.

Throws:
javax.resource.ResourceException

finalize

protected void finalize()
                 throws java.lang.Throwable
Throws:
java.lang.Throwable

stop

public void stop()
          throws javax.resource.ResourceException
Stops this JdoManagedConnectionFactory.

Throws:
javax.resource.ResourceException

createConnection

public java.lang.Object createConnection()
                                  throws javax.resource.ResourceException
Delegates the creation of a Connection to the ConnectionFactory.

Throws:
javax.resource.ResourceException

getPropertyFile

public java.lang.String getPropertyFile()
Gives access to the name of the property file for initializing the underlying JDO implementation.

Specified by:
getPropertyFile in interface JdoAttributeController
Returns:
The name of the property file.

setPropertyFile

public void setPropertyFile(java.lang.String pf)
Assigns to this JDO connector the name of the property file for initializing the underlying JDO implementation.

Specified by:
setPropertyFile in interface JdoAttributeController
Parameters:
pf - The name of the property file.

getTransactionManagerJNDIName

public java.lang.String getTransactionManagerJNDIName()
Description copied from interface: JdoAttributeController
Gives access to the JNDI name of the transaction manager (javax.transaction.TransactionManager).

Specified by:
getTransactionManagerJNDIName in interface JdoAttributeController
Returns:
the JNDI name of the transaction manager

setTransactionManagerJNDIName

public void setTransactionManagerJNDIName(java.lang.String jndiname)
                                   throws javax.resource.ResourceException
Description copied from interface: JdoAttributeController
Assigns the JNDI name of the transaction manager (javax.transaction.TransactionManager).

Specified by:
setTransactionManagerJNDIName in interface JdoAttributeController
Parameters:
jndiname - is the JNDI name of the transaction manager
Throws:
javax.resource.ResourceException

setTransactionManager

public void setTransactionManager(javax.transaction.TransactionManager tm)

createConnectionFactory

public java.lang.Object createConnectionFactory(javax.resource.spi.ConnectionManager cm)
                                         throws javax.resource.ResourceException
Creates a JdoConnectionFactory; yields the existing one if any.

Specified by:
createConnectionFactory in interface javax.resource.spi.ManagedConnectionFactory
Parameters:
cm - The ConnectionManager to be used by the created ConnectionFactory (may be null).
Throws:
javax.resource.ResourceException

createConnectionFactory

public java.lang.Object createConnectionFactory()
                                         throws javax.resource.ResourceException
Creates a JdoConnectionFactory; yields the existing one if any.

Specified by:
createConnectionFactory in interface javax.resource.spi.ManagedConnectionFactory
Throws:
javax.resource.ResourceException

createManagedConnection

public javax.resource.spi.ManagedConnection createManagedConnection(javax.security.auth.Subject subject,
                                                                    javax.resource.spi.ConnectionRequestInfo info)
                                                             throws javax.resource.ResourceException
Creates a new JdoManagedConnection.

Specified by:
createManagedConnection in interface javax.resource.spi.ManagedConnectionFactory
Throws:
javax.resource.ResourceException

matchManagedConnections

public javax.resource.spi.ManagedConnection matchManagedConnections(java.util.Set set,
                                                                    javax.security.auth.Subject subject,
                                                                    javax.resource.spi.ConnectionRequestInfo info)
                                                             throws javax.resource.ResourceException
No matching rules supported. Always yields the first element of the set if any.

Specified by:
matchManagedConnections in interface javax.resource.spi.ManagedConnectionFactory
Throws:
javax.resource.ResourceException

setLogWriter

public void setLogWriter(java.io.PrintWriter writer)
                  throws javax.resource.ResourceException
If he given PrintWrtier is a Loggable implementation then the inner logger and the inner loggerFactory are used. Otherwise the a basic Logger implementation is used over the specified PrintWriter.

Specified by:
setLogWriter in interface javax.resource.spi.ManagedConnectionFactory
Throws:
javax.resource.ResourceException

getLogWriter

public java.io.PrintWriter getLogWriter()
                                 throws javax.resource.ResourceException
Retrieves the printwriter used for the logging.

Specified by:
getLogWriter in interface javax.resource.spi.ManagedConnectionFactory
Throws:
javax.resource.ResourceException