org.csc.phynixx.connection.loggersystem
Class LoggerPerTransactionStrategy<C extends IPhynixxConnection & IXADataRecorderAware>

java.lang.Object
  extended by org.csc.phynixx.connection.PhynixxManagedConnectionListenerAdapter<C>
      extended by org.csc.phynixx.connection.loggersystem.LoggerPerTransactionStrategy<C>
All Implemented Interfaces:
IPhynixxConnectionProxyDecorator<C>, IPhynixxManagedConnectionListener<C>, IPhynixxLoggerSystemStrategy<C>

public class LoggerPerTransactionStrategy<C extends IPhynixxConnection & IXADataRecorderAware>
extends PhynixxManagedConnectionListenerAdapter<C>
implements IPhynixxLoggerSystemStrategy<C>, IPhynixxManagedConnectionListener<C>

this listener observes the lifecycle of a connection and associates a xaDataRecorder if necessary.


Constructor Summary
LoggerPerTransactionStrategy(IDataLoggerFactory loggerFactory)
          per thread a new Logger cpould be instanciated with aid of the loggerFacrory
 
Method Summary
 void addLoggerListener(IXARecorderResourceListener listener)
          the logger is added to all instanciated Loggers
 void close()
          closes the strategy including all resources
 void connectionCommitted(IManagedConnectionCommitEvent<C> event)
          NOOP
 void connectionFreed(IManagedConnectionEvent<C> event)
          Logger will be closed.
 void connectionRecovered(IManagedConnectionEvent<C> event)
          destroys the datalogger
 void connectionRecovering(IManagedConnectionEvent<C> event)
          connection enters state 'recovering'
 void connectionReleased(IManagedConnectionEvent<C> event)
          Logger isn't close.
 void connectionRequiresTransaction(IManagedConnectionEvent<C> event)
          NOOP
 void connectionRolledback(IManagedConnectionEvent<C> event)
          NOOP
 IPhynixxManagedConnection<C> decorate(IPhynixxManagedConnection<C> managedConnection)
          installs this strategy to the given connection
 List<IXADataRecorder> readIncompleteTransactions()
          recovers all incomplete dataRecorders org.csc.phynixx.loggersystem.logrecord.IXADataRecorder#isCompleted() and destroys all complete dataRecorders
 
Methods inherited from class org.csc.phynixx.connection.PhynixxManagedConnectionListenerAdapter
connectionCommitting, connectionErrorOccurred, connectionPrepared, connectionPreparing, connectionRequiresTransactionExecuted, connectionReset, connectionRollingBack
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.csc.phynixx.connection.IPhynixxManagedConnectionListener
connectionCommitting, connectionErrorOccurred, connectionPrepared, connectionPreparing, connectionRequiresTransactionExecuted, connectionReset, connectionRollingBack
 

Constructor Detail

LoggerPerTransactionStrategy

public LoggerPerTransactionStrategy(IDataLoggerFactory loggerFactory)
per thread a new Logger cpould be instanciated with aid of the loggerFacrory

Parameters:
loggerFactory -
Throws:
Exception
Method Detail

addLoggerListener

public void addLoggerListener(IXARecorderResourceListener listener)
the logger is added to all instanciated Loggers


close

public void close()
Description copied from interface: IPhynixxLoggerSystemStrategy
closes the strategy including all resources

Specified by:
close in interface IPhynixxLoggerSystemStrategy<C extends IPhynixxConnection & IXADataRecorderAware>

connectionRecovering

public void connectionRecovering(IManagedConnectionEvent<C> event)
Description copied from interface: IPhynixxManagedConnectionListener
connection enters state 'recovering'

Specified by:
connectionRecovering in interface IPhynixxManagedConnectionListener<C extends IPhynixxConnection & IXADataRecorderAware>
Overrides:
connectionRecovering in class PhynixxManagedConnectionListenerAdapter<C extends IPhynixxConnection & IXADataRecorderAware>

connectionReleased

public void connectionReleased(IManagedConnectionEvent<C> event)
Logger isn't close. If a dataRecorder is found in this phase this indicates an abnormal program flow.,

Therefore the dataRecorder isn't close and keep it's content to possibly recover

Specified by:
connectionReleased in interface IPhynixxManagedConnectionListener<C extends IPhynixxConnection & IXADataRecorderAware>
Overrides:
connectionReleased in class PhynixxManagedConnectionListenerAdapter<C extends IPhynixxConnection & IXADataRecorderAware>
Parameters:
event - current connection

connectionFreed

public void connectionFreed(IManagedConnectionEvent<C> event)
Logger will be closed. If a dataRecorder has remaining transactional data an abnormal prgram flow is detected an the data of the logger is not destroy but kept to further recovery

Specified by:
connectionFreed in interface IPhynixxManagedConnectionListener<C extends IPhynixxConnection & IXADataRecorderAware>
Overrides:
connectionFreed in class PhynixxManagedConnectionListenerAdapter<C extends IPhynixxConnection & IXADataRecorderAware>
Parameters:
event - current connection

connectionRecovered

public void connectionRecovered(IManagedConnectionEvent<C> event)
destroys the datalogger

Specified by:
connectionRecovered in interface IPhynixxManagedConnectionListener<C extends IPhynixxConnection & IXADataRecorderAware>
Overrides:
connectionRecovered in class PhynixxManagedConnectionListenerAdapter<C extends IPhynixxConnection & IXADataRecorderAware>

connectionRolledback

public void connectionRolledback(IManagedConnectionEvent<C> event)
Description copied from class: PhynixxManagedConnectionListenerAdapter
NOOP

Specified by:
connectionRolledback in interface IPhynixxManagedConnectionListener<C extends IPhynixxConnection & IXADataRecorderAware>
Overrides:
connectionRolledback in class PhynixxManagedConnectionListenerAdapter<C extends IPhynixxConnection & IXADataRecorderAware>

connectionCommitted

public void connectionCommitted(IManagedConnectionCommitEvent<C> event)
Description copied from class: PhynixxManagedConnectionListenerAdapter
NOOP

Specified by:
connectionCommitted in interface IPhynixxManagedConnectionListener<C extends IPhynixxConnection & IXADataRecorderAware>
Overrides:
connectionCommitted in class PhynixxManagedConnectionListenerAdapter<C extends IPhynixxConnection & IXADataRecorderAware>

connectionRequiresTransaction

public void connectionRequiresTransaction(IManagedConnectionEvent<C> event)
Description copied from class: PhynixxManagedConnectionListenerAdapter
NOOP

Specified by:
connectionRequiresTransaction in interface IPhynixxManagedConnectionListener<C extends IPhynixxConnection & IXADataRecorderAware>
Overrides:
connectionRequiresTransaction in class PhynixxManagedConnectionListenerAdapter<C extends IPhynixxConnection & IXADataRecorderAware>
Parameters:
event - current connection

readIncompleteTransactions

public List<IXADataRecorder> readIncompleteTransactions()
recovers all incomplete dataRecorders org.csc.phynixx.loggersystem.logrecord.IXADataRecorder#isCompleted() and destroys all complete dataRecorders

Specified by:
readIncompleteTransactions in interface IPhynixxLoggerSystemStrategy<C extends IPhynixxConnection & IXADataRecorderAware>
Returns:
incomplete dataRecorders

decorate

public IPhynixxManagedConnection<C> decorate(IPhynixxManagedConnection<C> managedConnection)
Description copied from interface: IPhynixxConnectionProxyDecorator
installs this strategy to the given connection

Specified by:
decorate in interface IPhynixxConnectionProxyDecorator<C extends IPhynixxConnection & IXADataRecorderAware>
Returns:
decorated Proxy


Copyright © 2015. All rights reserved.