cz.vutbr.fit.healing
Class Healing

java.lang.Object
  extended by cz.vutbr.fit.healing.Healing
Direct Known Subclasses:
HealingNewMutex, HealingOTWait, HealingOTYield, HealingPriority, HealingSemaphore, HealingThreads, HealingYield, HealingYieldPriority, HealingYieldThreads

public abstract class Healing
extends java.lang.Object

Abstract class defines the interface for healing methods implemented in Healing* classes. It also provides a way to set used healing method by getHealingMethod and can distuingish between normal access to the variable and enter/leave the critical section (also called atomic section) according to the information received from the Atomicity object.

Author:
zdenek
See Also:
Atomicity

Constructor Summary
Healing()
           
 
Method Summary
protected abstract  void afterNormalAccess(RDVariable rdv, RDThread rdt)
          Called after normal access to the variable.
protected abstract  void beforeNormalAccess(RDVariable rdv, RDThread rdt)
          Called before normal access to the variable.
 void endHealing(java.lang.String programLocation, RDVariable rdv, RDThread rdt)
          End healing if needed by chosen healing method.
protected abstract  void enterCriticSection(RDVariable rdv, RDThread rdt)
          Called before enter the critical section which should be atomic.
static void finalHealing()
          finalization of the method - empty by default
static Healing getHealingMethod()
          Returns a new object representing concrete healing method which will be used for healing (quarding atomicity sections).
static void initHealing()
          initialization of the method - empty by default
 boolean isHealedVariable(RDVariable rdv)
          Returns true if the given variable is healed by this thread.
protected abstract  void leaveCriticSection(RDVariable rdv, RDThread rdt)
          Called after exit the critical section which should be atomic.
 void startHealing(java.lang.String programLocation, RDVariable rdv, RDThread rdt, Atomicity atom)
          Start healing operation if needed according to chosen healing method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Healing

public Healing()
Method Detail

isHealedVariable

public boolean isHealedVariable(RDVariable rdv)
Returns true if the given variable is healed by this thread.

Returns:
Is healed

getHealingMethod

public static Healing getHealingMethod()
Returns a new object representing concrete healing method which will be used for healing (quarding atomicity sections).

Returns:
Healing object

initHealing

public static void initHealing()
initialization of the method - empty by default


finalHealing

public static void finalHealing()
finalization of the method - empty by default


startHealing

public void startHealing(java.lang.String programLocation,
                         RDVariable rdv,
                         RDThread rdt,
                         Atomicity atom)
Start healing operation if needed according to chosen healing method. Use Atomicity information to distinguish between normal access and enter of the critical section.

Parameters:
programLocation - Program location
rdv - Variable information
rdt - Thread information
atom - Atomicity information - not null if start of atomic section

endHealing

public void endHealing(java.lang.String programLocation,
                       RDVariable rdv,
                       RDThread rdt)
End healing if needed by chosen healing method. Use Atomicity information to distuingish between normal access and enter of the critical section.

Parameters:
programLocation - Program location
rdv - Variable information
rdt - Thread information

enterCriticSection

protected abstract void enterCriticSection(RDVariable rdv,
                                           RDThread rdt)
Called before enter the critical section which should be atomic.

Parameters:
rdv - Variable information

leaveCriticSection

protected abstract void leaveCriticSection(RDVariable rdv,
                                           RDThread rdt)
Called after exit the critical section which should be atomic.

Parameters:
rdv - Variable information

beforeNormalAccess

protected abstract void beforeNormalAccess(RDVariable rdv,
                                           RDThread rdt)
Called before normal access to the variable.

Parameters:
rdv - Variable information

afterNormalAccess

protected abstract void afterNormalAccess(RDVariable rdv,
                                          RDThread rdt)
Called after normal access to the variable.

Parameters:
rdv - Variable information