org.objectweb.proactive.core.body.ft.servers.recovery
Class RecoveryProcessImpl

java.lang.Object
  extended byorg.objectweb.proactive.core.body.ft.servers.recovery.RecoveryProcessImpl
All Implemented Interfaces:
RecoveryProcess, java.rmi.Remote
Direct Known Subclasses:
RecoveryProcessCIC, RecoveryProcessPMLRB

public abstract class RecoveryProcessImpl
extends java.lang.Object
implements RecoveryProcess

Since:
2.2
Author:
cdelbe

Field Summary
protected  java.util.Hashtable bodies
           
protected static org.apache.log4j.Logger logger
           
static int MAX_ACTIVE_QUEUES
          Maximum number of active queues
protected  FTServer server
           
 
Fields inherited from interface org.objectweb.proactive.core.body.ft.servers.recovery.RecoveryProcess
FAILED, RECOVERING, RUNNING
 
Constructor Summary
RecoveryProcessImpl(FTServer server)
           
 
Method Summary
 void failureDetected(UniqueID id)
          Notify the recovery process that the body passed in paramater is suspected to be failed.
 int getSystemSize()
          Return the size of the system, i.e. the number of registred bodies.
 void initialize()
          Reinit the state of the recovery process.
protected abstract  void recover(UniqueID failed)
          This method define the recovery behavior.
 void register(UniqueID id)
          Register the calling AO.
 void submitJob(ActiveQueueJob job)
          Submit an ActiveQueueJob to the active queue of the recovery process.
 JobBarrier submitJobWithBarrier(ActiveQueueJob job)
          Submit an ActiveQueueJob to the active queue of the recovery process.
 void unregister(UniqueID id)
          Unregister the AO identified by id.
 void updateState(UniqueID id, int state)
          Update the current state of the active object id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_ACTIVE_QUEUES

public static final int MAX_ACTIVE_QUEUES
Maximum number of active queues

See Also:
Constant Field Values

logger

protected static org.apache.log4j.Logger logger

server

protected FTServer server

bodies

protected java.util.Hashtable bodies
Constructor Detail

RecoveryProcessImpl

public RecoveryProcessImpl(FTServer server)
Method Detail

recover

protected abstract void recover(UniqueID failed)
This method define the recovery behavior.

Parameters:
failed -

register

public void register(UniqueID id)
              throws java.rmi.RemoteException
Description copied from interface: RecoveryProcess
Register the calling AO. Each AO is registred on creation by newActive. Default state is RUNNING.

Specified by:
register in interface RecoveryProcess
Parameters:
id - the registered body id
Throws:
java.rmi.RemoteException
See Also:
RecoveryProcess.register(org.objectweb.proactive.core.UniqueID)

unregister

public void unregister(UniqueID id)
                throws java.rmi.RemoteException
Description copied from interface: RecoveryProcess
Unregister the AO identified by id.

Specified by:
unregister in interface RecoveryProcess
Parameters:
id - the unregistered body id
Throws:
java.rmi.RemoteException
See Also:
RecoveryProcess.unregister(org.objectweb.proactive.core.UniqueID)

failureDetected

public void failureDetected(UniqueID id)
                     throws java.rmi.RemoteException
Description copied from interface: RecoveryProcess
Notify the recovery process that the body passed in paramater is suspected to be failed.

Specified by:
failureDetected in interface RecoveryProcess
Parameters:
id - the id of the suspected AO
Throws:
java.rmi.RemoteException
See Also:
RecoveryProcess.failureDetected(org.objectweb.proactive.core.UniqueID)

updateState

public void updateState(UniqueID id,
                        int state)
                 throws java.rmi.RemoteException
Description copied from interface: RecoveryProcess
Update the current state of the active object id. Its state can be failed, recovering or running.

Specified by:
updateState in interface RecoveryProcess
Parameters:
id - id of the AO to update
state - state of the active object
Throws:
java.rmi.RemoteException
See Also:
RecoveryProcess.updateState(org.objectweb.proactive.core.UniqueID, int)

submitJob

public void submitJob(ActiveQueueJob job)
Submit an ActiveQueueJob to the active queue of the recovery process.

Specified by:
submitJob in interface RecoveryProcess
Parameters:
job - the job to submit.

submitJobWithBarrier

public JobBarrier submitJobWithBarrier(ActiveQueueJob job)
Submit an ActiveQueueJob to the active queue of the recovery process. A job barrier is returned. Waiting on this barrier is blocking until the job is finished.

Specified by:
submitJobWithBarrier in interface RecoveryProcess
Parameters:
job - the job to submit.
Returns:
the corresponding barrier.

getSystemSize

public int getSystemSize()
                  throws java.rmi.RemoteException
Description copied from interface: RecoveryProcess
Return the size of the system, i.e. the number of registred bodies.

Specified by:
getSystemSize in interface RecoveryProcess
Returns:
the number of registred bodies
Throws:
java.rmi.RemoteException
See Also:
RecoveryProcess.getSystemSize()

initialize

public void initialize()
                throws java.rmi.RemoteException
Description copied from interface: RecoveryProcess
Reinit the state of the recovery process.

Specified by:
initialize in interface RecoveryProcess
Throws:
java.rmi.RemoteException
See Also:
RecoveryProcess.initialize()


Copyright 2001-2005 INRIA All Rights Reserved.