org.sourceforge.bdbadapter.cci
Class ManagedConnectionFactoryImpl

java.lang.Object
  |
  +--org.sourceforge.bdbadapter.cci.ManagedConnectionFactoryImpl
All Implemented Interfaces:
javax.resource.spi.ManagedConnectionFactory, java.io.Serializable

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

Copyright (C) 2003 Joerg Winter This Resource Adapter is licensed by the GNU General Public License (GPL)

See Also:
Serialized Form

Field Summary
private  java.lang.Integer cachePieces
           
private  java.lang.Integer cacheSizeBytes
           
private  java.lang.Integer cacheSizeGigabytes
           
private  java.lang.String dbEnvPath
           
private  java.lang.String dbName
           
private  AdapterEnv env
           
private  java.lang.String logDirectory
           
private static org.sourceforge.jcalogger.SimpleLogger logger
          All log-output goes to this instance of SimpleLogger.
private  java.lang.String logSwitch
           
private  java.io.PrintWriter logWriter
          The log-writer set by the container.
private static boolean noLogging
           
private  java.lang.String propertyUrl
           
private static javax.resource.cci.ResourceAdapterMetaData resourceAdapterMetaData
           
 
Constructor Summary
ManagedConnectionFactoryImpl()
           
 
Method Summary
 java.lang.Object createConnectionFactory()
           
 java.lang.Object createConnectionFactory(javax.resource.spi.ConnectionManager cxManager)
           
 javax.resource.spi.ManagedConnection createManagedConnection(javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo info)
           
 boolean equals(java.lang.Object o)
           
 java.lang.Integer getCachePieces()
           
 java.lang.Integer getCacheSizeBytes()
           
 java.lang.Integer getCacheSizeGigabytes()
           
(package private)  java.lang.String getDatabasePath()
           
 java.lang.String getDbEnvPath()
           
 java.lang.String getDbName()
           
(package private)  AdapterEnv getEnv()
           
 java.lang.String getLogDirectory()
           
 java.lang.String getLogSwitch()
           
 java.io.PrintWriter getLogWriter()
           
 java.lang.String getPropertyUrl()
           
(package private)  javax.resource.cci.ResourceAdapterMetaData getResourceAdapterMetaData()
           
 int hashCode()
           
(package private) static void log(java.lang.String message, java.lang.String source)
          Helper method for log-output.
 javax.resource.spi.ManagedConnection matchManagedConnections(java.util.Set connectionSet, javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo info)
           
(package private)  void openEnvironment(java.lang.String dbEnvPath, int cacheSizeGigabytes, int cacheSizeBytes, int cachePieces)
           
(package private) static void printDbException(com.sleepycat.db.DbException e)
           
(package private) static void printException(java.lang.Exception e)
           
private  void readObject(java.io.ObjectInputStream in)
           
static void reset()
           
 void setCachePieces(java.lang.Integer cachePieces)
           
 void setCacheSizeBytes(java.lang.Integer cacheSizeBytes)
           
 void setCacheSizeGigabytes(java.lang.Integer cacheSizeGigabytes)
           
 void setDbEnvPath(java.lang.String dbEnvPath)
           
 void setDbName(java.lang.String dbName)
           
 void setLogDirectory(java.lang.String logDirectory)
           
 void setLogSwitch(java.lang.String logSwitch)
           
 void setLogWriter(java.io.PrintWriter out)
           
 void setPropertyUrl(java.lang.String propertyUrl)
           
private  void writeObject(java.io.ObjectOutputStream out)
           
 
Methods inherited from class java.lang.Object
, clone, finalize, getClass, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

logWriter

private java.io.PrintWriter logWriter
The log-writer set by the container. Currently not used, instead log-output goes to SimpleLogger.
See Also:
logger, JCA 1.0 specification and JavaDoc

resourceAdapterMetaData

private static transient javax.resource.cci.ResourceAdapterMetaData resourceAdapterMetaData
See Also:
1.0 specification and JavaDoc

logger

private static transient org.sourceforge.jcalogger.SimpleLogger logger
All log-output goes to this instance of SimpleLogger. Special logging-classes are used to have more control over what gets logged and to get a chronological view of events. The more standard log-output through a container supplied PrintWriter may be used in a future version.
See Also:
logWriter

env

private transient AdapterEnv env

propertyUrl

private java.lang.String propertyUrl

dbEnvPath

private java.lang.String dbEnvPath

cacheSizeGigabytes

private java.lang.Integer cacheSizeGigabytes

cacheSizeBytes

private java.lang.Integer cacheSizeBytes

cachePieces

private java.lang.Integer cachePieces

dbName

private java.lang.String dbName

logDirectory

private java.lang.String logDirectory

logSwitch

private java.lang.String logSwitch

noLogging

private static boolean noLogging
Constructor Detail

ManagedConnectionFactoryImpl

public ManagedConnectionFactoryImpl()
Method Detail

createConnectionFactory

public java.lang.Object createConnectionFactory(javax.resource.spi.ConnectionManager cxManager)
                                         throws javax.resource.ResourceException
Specified by:
createConnectionFactory in interface javax.resource.spi.ManagedConnectionFactory

createConnectionFactory

public java.lang.Object createConnectionFactory()
                                         throws javax.resource.ResourceException
Specified by:
createConnectionFactory in interface javax.resource.spi.ManagedConnectionFactory

createManagedConnection

public javax.resource.spi.ManagedConnection createManagedConnection(javax.security.auth.Subject subject,
                                                                    javax.resource.spi.ConnectionRequestInfo info)
                                                             throws javax.resource.ResourceException
Specified by:
createManagedConnection in interface javax.resource.spi.ManagedConnectionFactory

getDatabasePath

java.lang.String getDatabasePath()

matchManagedConnections

public javax.resource.spi.ManagedConnection matchManagedConnections(java.util.Set connectionSet,
                                                                    javax.security.auth.Subject subject,
                                                                    javax.resource.spi.ConnectionRequestInfo info)
                                                             throws javax.resource.ResourceException
Specified by:
matchManagedConnections in interface javax.resource.spi.ManagedConnectionFactory

setLogWriter

public void setLogWriter(java.io.PrintWriter out)
                  throws javax.resource.ResourceException
Specified by:
setLogWriter in interface javax.resource.spi.ManagedConnectionFactory

getLogWriter

public java.io.PrintWriter getLogWriter()
                                 throws javax.resource.ResourceException
Specified by:
getLogWriter in interface javax.resource.spi.ManagedConnectionFactory

getPropertyUrl

public java.lang.String getPropertyUrl()

setPropertyUrl

public void setPropertyUrl(java.lang.String propertyUrl)

getDbEnvPath

public java.lang.String getDbEnvPath()

setDbEnvPath

public void setDbEnvPath(java.lang.String dbEnvPath)

getCacheSizeGigabytes

public java.lang.Integer getCacheSizeGigabytes()

setCacheSizeGigabytes

public void setCacheSizeGigabytes(java.lang.Integer cacheSizeGigabytes)

getCacheSizeBytes

public java.lang.Integer getCacheSizeBytes()

setCacheSizeBytes

public void setCacheSizeBytes(java.lang.Integer cacheSizeBytes)

getCachePieces

public java.lang.Integer getCachePieces()

setCachePieces

public void setCachePieces(java.lang.Integer cachePieces)

getDbName

public java.lang.String getDbName()

setDbName

public void setDbName(java.lang.String dbName)

getLogDirectory

public java.lang.String getLogDirectory()

setLogDirectory

public void setLogDirectory(java.lang.String logDirectory)

getLogSwitch

public java.lang.String getLogSwitch()

setLogSwitch

public void setLogSwitch(java.lang.String logSwitch)

equals

public boolean equals(java.lang.Object o)
Specified by:
equals in interface javax.resource.spi.ManagedConnectionFactory
Overrides:
equals in class java.lang.Object

hashCode

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

getResourceAdapterMetaData

javax.resource.cci.ResourceAdapterMetaData getResourceAdapterMetaData()

getEnv

AdapterEnv getEnv()

openEnvironment

void openEnvironment(java.lang.String dbEnvPath,
                     int cacheSizeGigabytes,
                     int cacheSizeBytes,
                     int cachePieces)
               throws javax.resource.ResourceException

log

static void log(java.lang.String message,
                java.lang.String source)
Helper method for log-output.
Parameters:
message - The message to appear int the corresponding log output-file.
source - This string determines the name of the ouput-file.

printDbException

static void printDbException(com.sleepycat.db.DbException e)

printException

static void printException(java.lang.Exception e)

reset

public static void reset()

writeObject

private void writeObject(java.io.ObjectOutputStream out)
                  throws java.io.IOException

readObject

private void readObject(java.io.ObjectInputStream in)
                 throws java.io.IOException,
                        java.lang.ClassNotFoundException