Class InboundBridgeRecoveryManager

java.lang.Object
org.jboss.jbossts.txbridge.inbound.InboundBridgeRecoveryManager
All Implemented Interfaces:
RecoveryModule, XAResourceOrphanFilter, XTSATRecoveryModule

public class InboundBridgeRecoveryManager extends Object implements XTSATRecoveryModule, RecoveryModule, XAResourceOrphanFilter
Integrates with JBossAS MC lifecycle and JBossTS recovery manager to provide recovery services for inbound bridged transactions.
Author:
jonathan.halliday@redhat.com, 2009-02-10
  • Nested Class Summary

    Nested classes/interfaces inherited from interface com.arjuna.ats.jta.recovery.XAResourceOrphanFilter

    XAResourceOrphanFilter.Vote
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Used to identify inbound bridged Xids in either the RM log (when called by XARecoveryModule) or the JCA subordinate tx log (when called internally from this class) which have or have not got a remaining transaction that may still drive them to completion.
    deserialize(String id, ObjectInputStream objectInputStream)
    Called during recovery processing to allow an application to identify a participant id belonging to one of its participants and recreate the participant by deserializing it from the supplied object input stream.
    void
    participant recovery modules may need to perform special processing when the a recovery scan has completed.
    void
    Called by the RecoveryManager at start up, and then PERIODIC_RECOVERY_PERIOD seconds after the completion, for all RecoveryModules, of the second pass
    void
    Called by the RecoveryManager RECOVERY_BACKOFF_PERIOD seconds after the completion of the first pass
    recreate(String s, byte[] bytes)
    Unused recovery callback.
    void
    MC lifecycle callback, used to register components with the recovery manager.
    void
    MC lifecycle callback, used to unregister components from the recovery manager.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • InboundBridgeRecoveryManager

      public InboundBridgeRecoveryManager()
  • Method Details

    • start

      public void start()
      MC lifecycle callback, used to register components with the recovery manager.
    • stop

      public void stop()
      MC lifecycle callback, used to unregister components from the recovery manager.
    • deserialize

      public Durable2PCParticipant deserialize(String id, ObjectInputStream objectInputStream) throws Exception
      Called during recovery processing to allow an application to identify a participant id belonging to one of its participants and recreate the participant by deserializing it from the supplied object input stream. n.b. this is only appropriate in case the participant was originally saved using serialization.
      Specified by:
      deserialize in interface XTSATRecoveryModule
      Parameters:
      id - the id used when the participant was created
      objectInputStream - a stream from which the application should deserialize the participant if it recognises that the id belongs to the module's application
      Returns:
      the deserialized Participant object
      Throws:
      Exception - if an error occurs deserializing the durable participant
    • endScan

      public void endScan()
      participant recovery modules may need to perform special processing when the a recovery scan has completed. in particular it is only after the first recovery scan has completed they can identify whether locally prepared changes are accompanied by a recreated participant and roll back changes for those with no such participant.
      Specified by:
      endScan in interface XTSATRecoveryModule
    • recreate

      public Durable2PCParticipant recreate(String s, byte[] bytes) throws Exception
      Unused recovery callback. We use serialization instead, so this method will always throw an exception if called.
      Specified by:
      recreate in interface XTSATRecoveryModule
      Parameters:
      s - the id used when the participant was created
      bytes - a byte array returned form the original participant via a call to method getRecoveryState of interface PersistableATParticipant
      Returns:
      the recreated Durable2PCParticipant
      Throws:
      Exception - if an error occurs converting the recoveryState back to a durable participant
    • periodicWorkFirstPass

      public void periodicWorkFirstPass()
      Called by the RecoveryManager at start up, and then PERIODIC_RECOVERY_PERIOD seconds after the completion, for all RecoveryModules, of the second pass
      Specified by:
      periodicWorkFirstPass in interface RecoveryModule
    • periodicWorkSecondPass

      public void periodicWorkSecondPass()
      Called by the RecoveryManager RECOVERY_BACKOFF_PERIOD seconds after the completion of the first pass
      Specified by:
      periodicWorkSecondPass in interface RecoveryModule
    • checkXid

      public XAResourceOrphanFilter.Vote checkXid(Xid xid)
      Used to identify inbound bridged Xids in either the RM log (when called by XARecoveryModule) or the JCA subordinate tx log (when called internally from this class) which have or have not got a remaining transaction that may still drive them to completion.
      Specified by:
      checkXid in interface XAResourceOrphanFilter
      Parameters:
      xid - The in-doubt xid.
      Returns:
      a Vote on the handling of the xid (to roll it back or not).