com.sun.enterprise.transaction.jts.recovery
Class RecoveryLockFile

java.lang.Object
  extended by com.sun.enterprise.transaction.jts.recovery.RecoveryLockFile
All Implemented Interfaces:
DelegatedTransactionRecoveryFence, TransactionRecoveryFence

public class RecoveryLockFile
extends java.lang.Object
implements TransactionRecoveryFence, DelegatedTransactionRecoveryFence

This class manages lock file required for delegated recovery.

Author:
mvatkina
See Also:
in the recovery lock file have the following format: PREFIX INSTANCE_NAME TIMESTAMP Where PREFIX can be one of: - "O" means OWNED by this instance, i.e. non-delegated recovery - "B" means recovered BY the specified instance - "F" means recovered FOR the specified instance TIMESTAMP is the time of the recovery operation

Method Summary
static DelegatedTransactionRecoveryFence getDelegatedTransactionRecoveryFence(GMSCallBack gmsCallBack)
           
 java.lang.String getInstanceRecoveredFor(java.lang.String path, long timestamp)
          Returns instance for which delegated recovery was done before the timestamp specified on the specified path or null if such instance does not exist
 boolean isFenceRaised(java.lang.String logDir, java.lang.String instance, long timestamp)
          Returns true if the specified instance on the specified path is being recovered after the specified timestamp
 void lowerFence()
          Lower the fence
 void lowerFence(java.lang.String logPath, java.lang.String instance)
          Lower the fence for the specified instance on the specified path
 void raiseFence()
          Raise the fence so that no other instance can start the recovery at the same time.
 void raiseFence(java.lang.String logPath, java.lang.String instance)
          Raise the fence for the specified instance on the specified path so that no other instance can start delegated recovery at the same time.
 void raiseFence(java.lang.String logPath, java.lang.String instance, long timestamp)
          
 void start()
          DataStructures are initialized first.
 void transferRecoveryTo(java.lang.String logDir, java.lang.String instance)
          If an instance was doing delegated recovery on the specified path, assign specified instance instead.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDelegatedTransactionRecoveryFence

public static DelegatedTransactionRecoveryFence getDelegatedTransactionRecoveryFence(GMSCallBack gmsCallBack)

start

public void start()
Description copied from interface: TransactionRecoveryFence
DataStructures are initialized first. Recovery of transaction starts immediatley after the initialization.

Specified by:
start in interface TransactionRecoveryFence

raiseFence

public void raiseFence()
Raise the fence so that no other instance can start the recovery at the same time.

Specified by:
raiseFence in interface TransactionRecoveryFence

lowerFence

public void lowerFence()
Lower the fence

Specified by:
lowerFence in interface TransactionRecoveryFence

isFenceRaised

public boolean isFenceRaised(java.lang.String logDir,
                             java.lang.String instance,
                             long timestamp)
Returns true if the specified instance on the specified path is being recovered after the specified timestamp

Specified by:
isFenceRaised in interface DelegatedTransactionRecoveryFence

raiseFence

public void raiseFence(java.lang.String logPath,
                       java.lang.String instance)
Raise the fence for the specified instance on the specified path so that no other instance can start delegated recovery at the same time.

Specified by:
raiseFence in interface DelegatedTransactionRecoveryFence

raiseFence

public void raiseFence(java.lang.String logPath,
                       java.lang.String instance,
                       long timestamp)


lowerFence

public void lowerFence(java.lang.String logPath,
                       java.lang.String instance)
Lower the fence for the specified instance on the specified path

Specified by:
lowerFence in interface DelegatedTransactionRecoveryFence

getInstanceRecoveredFor

public java.lang.String getInstanceRecoveredFor(java.lang.String path,
                                                long timestamp)
Returns instance for which delegated recovery was done before the timestamp specified on the specified path or null if such instance does not exist

Specified by:
getInstanceRecoveredFor in interface DelegatedTransactionRecoveryFence

transferRecoveryTo

public void transferRecoveryTo(java.lang.String logDir,
                               java.lang.String instance)
If an instance was doing delegated recovery on the specified path, assign specified instance instead.

Specified by:
transferRecoveryTo in interface DelegatedTransactionRecoveryFence


Copyright © 2012 GlassFish Community. All Rights Reserved.