org.objectweb.perseus.fos.lib
Class FosTxContextFactory

java.lang.Object
  extended byorg.objectweb.perseus.fos.lib.FosTxContextFactory
All Implemented Interfaces:
FosAttributeControler, FosLoggerFactory, FosManager

public class FosTxContextFactory
extends java.lang.Object
implements FosManager, FosLoggerFactory

Author:
S. Chassande-Barrioz, P. D�chamboux

Field Summary
 
Fields inherited from interface org.objectweb.perseus.fos.api.FosManager
SPECVERSION
 
Fields inherited from interface org.objectweb.perseus.fos.api.FosLoggerFactory
CONNECTION, DEBUG, MANAGEDCONNECTION, TXCONTEXT, XARESOURCE
 
Constructor Summary
FosTxContextFactory()
           
 
Method Summary
 FosTransaction createTxContext()
          Creates a new TxContext for managing transactional I/Os with Data Object Files.
 java.lang.String getDbDir()
          Gives access to the FOS root directory (named dbDir).
 Logger getLogger(byte entity, boolean factory)
          Gives access to the logger associated to a given kind of entities managed by this FOS adapter, which are further classified into factories or non-factories.
 javax.transaction.xa.Xid[] getXidForRecovery()
          Gets all the Xid of distributed transaction that need to be recovered by a DTP monitor.
 void initialize()
          Initializes the root directory for storing files representing data objects.
 void releaseTxContext(FosTransaction txc)
          Releases a FosTxContext.
 void setDbDir(java.lang.String dbdir)
          Changes the FOS root directory.
 void setMonologFactory(MonologFactory mf)
           
 void start()
          Starts a FosTxContextFactory.
 void stop()
          Stops a FosTxContextFactory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FosTxContextFactory

public FosTxContextFactory()
Method Detail

start

public void start()
           throws FosException
Starts a FosTxContextFactory. It either initializes the FOS repository if it is the first start. In other cases, it verifies the consistency of the repository and it manages a cold recovery if the FOS had not cleanly stop.

Specified by:
start in interface FosManager
Throws:
FosException

stop

public void stop()
          throws FosException
Stops a FosTxContextFactory.

Specified by:
stop in interface FosManager
Throws:
FosException

initialize

public void initialize()
                throws FosException
Initializes the root directory for storing files representing data objects. It removes all existing data files and creates all data for managing transactions.

Specified by:
initialize in interface FosManager
Throws:
FosException

getXidForRecovery

public javax.transaction.xa.Xid[] getXidForRecovery()
Gets all the Xid of distributed transaction that need to be recovered by a DTP monitor.

Specified by:
getXidForRecovery in interface FosManager
Returns:
The array of Xid of transactions that need to be recovered.

createTxContext

public FosTransaction createTxContext()
                               throws FosException
Creates a new TxContext for managing transactional I/Os with Data Object Files.

Specified by:
createTxContext in interface FosManager
Throws:
FosException

releaseTxContext

public void releaseTxContext(FosTransaction txc)
                      throws FosException
Releases a FosTxContext. Useful if adding a context pool.

Specified by:
releaseTxContext in interface FosManager
Parameters:
txc - The FosTxContext to be released.
Throws:
FosException

getDbDir

public java.lang.String getDbDir()
Gives access to the FOS root directory (named dbDir).

Specified by:
getDbDir in interface FosAttributeControler

setDbDir

public void setDbDir(java.lang.String dbdir)
Changes the FOS root directory.

Specified by:
setDbDir in interface FosAttributeControler

getLogger

public Logger getLogger(byte entity,
                        boolean factory)
Gives access to the logger associated to a given kind of entities managed by this FOS adapter, which are further classified into factories or non-factories.

Specified by:
getLogger in interface FosLoggerFactory
Parameters:
entity - The kind of entity (see CONNECTION, MANAGEDCONNECTION, XARESOURCE and TXCONTEXT constants defined above).
factory - Specifies if the concerned entity is a factory.
Returns:
The relevant logger.

setMonologFactory

public void setMonologFactory(MonologFactory mf)
Specified by:
setMonologFactory in interface FosLoggerFactory


Copyright © 2000-2002 France Telecom S.A., INRIA, IMAG-LSR All Rights Reserved.