org.objectweb.perseus.fos.lib

Class FosTxContextFactory

Implemented Interfaces:
FosAttributeControler, FosLoggerFactory, FosManager

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

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

Fields inherited from interface org.objectweb.perseus.fos.api.FosLoggerFactory

CONNECTION, DEBUG, MANAGEDCONNECTION, TXCONTEXT, XARESOURCE

Fields inherited from interface org.objectweb.perseus.fos.api.FosManager

SPECVERSION

Method Summary

FosTransaction
createTxContext()
Creates a new TxContext for managing transactional I/Os with Data Object Files.
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.
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(String dbdir)
Changes the FOS root directory.
void
setMonologFactory(MonologFactory mf)
void
start()
Starts a FosTxContextFactory.
void
stop()
Stops a FosTxContextFactory.

Method Details

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


getDbDir

public String getDbDir()
Gives access to the FOS root directory (named dbDir).
Specified by:
getDbDir 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.


getXidForRecovery

public 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.


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


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.


setDbDir

public void setDbDir(String dbdir)
Changes the FOS root directory.
Specified by:
setDbDir in interface FosAttributeControler


setMonologFactory

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


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


stop

public void stop()
            throws FosException
Stops a FosTxContextFactory.
Specified by:
stop in interface FosManager


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