org.objectweb.proactive.core.body.ft.util
Class GlobalFTServer

java.lang.Object
  extended byjava.rmi.server.RemoteObject
      extended byjava.rmi.server.RemoteServer
          extended byjava.rmi.server.UnicastRemoteObject
              extended byorg.objectweb.proactive.core.body.ft.util.GlobalFTServer
All Implemented Interfaces:
CheckpointServer, FaultDetector, LocationServer, RecoveryProcess, java.rmi.Remote, ResourceServer, java.io.Serializable

public class GlobalFTServer
extends java.rmi.server.UnicastRemoteObject
implements CheckpointServer, RecoveryProcess, LocationServer, FaultDetector, ResourceServer

A Generic fault-tolerance Server. This class implements all ft.util.* interfaces. This server is an RMI object.

Since:
ProActive 2.2
Author:
cdelbe
See Also:
Serialized Form

Field Summary
static int DEFAULT_FDETECT_SCAN_PERIOD
          Period of the failure detector sanning (ms)
static int DEFAULT_GC_PERIOD
          Period of the checkpoints garbage collection (ms)
static int DEFAULT_PORT
          Default server port
static java.lang.String DEFAULT_SERVER_NAME
          Default name of this server
protected static org.apache.log4j.Logger logger
           
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Fields inherited from interface org.objectweb.proactive.core.body.ft.util.recovery.RecoveryProcess
FAILED, RECOVERING, RUNNING
 
Fields inherited from interface org.objectweb.proactive.core.body.ft.util.faultdetection.FaultDetector
IS_DEAD, OK
 
Constructor Summary
GlobalFTServer(int fdPeriod)
          Create a new FTServer.
 
Method Summary
 void addFreeNode(Node n)
          Add a new node usable for recovery.
 void addInfoToCheckpoint(CheckpointInfo ci, UniqueID id, int sequenceNumber, int inc)
          Add informations to an already stored checkpoint
 void broadcastFTEvent(FTMessage fte)
          Broadcast the event fte to every activity registered in the Recovery process
 void failureDetected(UniqueID id)
          Notify the recovery process that the body passed in paramater is suspected to be failed.
 void forceDetection()
          Force a failure detection even if the failure detector thread is waiting.
 java.util.ArrayList getAllLocations()
          Return the list of locations of all registered bodies.
 Checkpoint getCheckpoint(UniqueID id, int index)
          Return a checkpoint of the object identified by id.
 Node getFreeNode()
          Return the next available node for recovery
 CheckpointInfo getInfoFromCheckpoint(UniqueID id, int sequenceNumber)
          Return informations on the given checkpoint
 Checkpoint getLastCheckpoint(UniqueID id)
          Return the latest checkpoint of the object identified by id
 UniqueID getOneID()
           
 java.lang.String getServerCodebase()
          Return the URL of the classServer linked to this checkpointServer.
 boolean isUnreachable(UniversalBody body)
          The fault detector test the reachability of the active object body by sending a heartbeat message to body.
 void register(UniqueID id)
          Register the calling OA.
 UniversalBody searchObject(UniqueID id, UniversalBody oldLocation, UniqueID caller)
          Return the current location of object id.
 void startFailureDetector(LocationServer ls, RecoveryProcess rp)
          Start the tread that periodically test the reachability of objects that are registred in the location server ls.
 void stopFailureDetector()
          Stop the the failure detector thread.
 int storeCheckpoint(Checkpoint c, int inc)
          Store a checkpoint in the checkpoint server.
 void suspendFailureDetector()
          Temporarily suspend the failure detector thread.
 void updateLocation(UniqueID id, UniversalBody newLocation)
          Set the new location of the active object identified by id.
 void updateState(UniqueID id, int state)
          Update the current state of the active object id.
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_PORT

public static final int DEFAULT_PORT
Default server port

See Also:
Constant Field Values

DEFAULT_FDETECT_SCAN_PERIOD

public static final int DEFAULT_FDETECT_SCAN_PERIOD
Period of the failure detector sanning (ms)

See Also:
Constant Field Values

DEFAULT_GC_PERIOD

public static final int DEFAULT_GC_PERIOD
Period of the checkpoints garbage collection (ms)

See Also:
Constant Field Values

DEFAULT_SERVER_NAME

public static final java.lang.String DEFAULT_SERVER_NAME
Default name of this server

See Also:
Constant Field Values

logger

protected static org.apache.log4j.Logger logger
Constructor Detail

GlobalFTServer

public GlobalFTServer(int fdPeriod)
               throws java.rmi.RemoteException
Create a new FTServer.

Parameters:
fdPeriod - the period of fault detection
Throws:
java.rmi.RemoteException
Method Detail

storeCheckpoint

public int storeCheckpoint(Checkpoint c,
                           int inc)
Description copied from interface: CheckpointServer
Store a checkpoint in the checkpoint server.

Specified by:
storeCheckpoint in interface CheckpointServer
Parameters:
c - the checkpoint to stored
inc - incarnation number of the caller
Returns:
the last global state of the system, i.e. the index of the latest completed image of the system.

getCheckpoint

public Checkpoint getCheckpoint(UniqueID id,
                                int index)
Description copied from interface: CheckpointServer
Return a checkpoint of the object identified by id.

Specified by:
getCheckpoint in interface CheckpointServer
Parameters:
id - the owner of the returned checkpoint
index - the index of the requiered checkpoint
Returns:
a checkpoint of the object identified by id

getLastCheckpoint

public Checkpoint getLastCheckpoint(UniqueID id)
Description copied from interface: CheckpointServer
Return the latest checkpoint of the object identified by id

Specified by:
getLastCheckpoint in interface CheckpointServer
Parameters:
id - the owner of the returned checkpoint
Returns:
the latest checkpoint of the object identified by id

getInfoFromCheckpoint

public CheckpointInfo getInfoFromCheckpoint(UniqueID id,
                                            int sequenceNumber)
Description copied from interface: CheckpointServer
Return informations on the given checkpoint

Specified by:
getInfoFromCheckpoint in interface CheckpointServer
Parameters:
id - owner of the considered checkpoint
sequenceNumber - index of the considered checkpoint
Returns:
informations on the given checkpoint

addInfoToCheckpoint

public void addInfoToCheckpoint(CheckpointInfo ci,
                                UniqueID id,
                                int sequenceNumber,
                                int inc)
                         throws java.rmi.RemoteException
Description copied from interface: CheckpointServer
Add informations to an already stored checkpoint

Specified by:
addInfoToCheckpoint in interface CheckpointServer
Parameters:
ci - informations that have to be added
id - owner of the considered checkpoint
sequenceNumber - index of the considered checkpoint
inc - incarnation number of the caller
Throws:
java.rmi.RemoteException

getServerCodebase

public java.lang.String getServerCodebase()
Description copied from interface: CheckpointServer
Return the URL of the classServer linked to this checkpointServer. This classServer is used by recovering active objects

Specified by:
getServerCodebase in interface CheckpointServer
Returns:
the URL of the classServer linked to this checkpointServer

searchObject

public UniversalBody searchObject(UniqueID id,
                                  UniversalBody oldLocation,
                                  UniqueID caller)
                           throws java.rmi.RemoteException
Description copied from interface: LocationServer
Return the current location of object id.

Specified by:
searchObject in interface LocationServer
Parameters:
id - Unique id of the searched object
oldLocation - last known location of the searched object
Returns:
the new location of the searched object
Throws:
java.rmi.RemoteException

getAllLocations

public java.util.ArrayList getAllLocations()
Description copied from interface: LocationServer
Return the list of locations of all registered bodies.

Specified by:
getAllLocations in interface LocationServer
Returns:
the list of locations of all registered bodies.

updateLocation

public void updateLocation(UniqueID id,
                           UniversalBody newLocation)
                    throws java.rmi.RemoteException
Description copied from interface: LocationServer
Set the new location of the active object identified by id. Call register in the recovery process.

Specified by:
updateLocation in interface LocationServer
Parameters:
id - id of the caller
newLocation - new location of the caller
Throws:
java.rmi.RemoteException

addFreeNode

public void addFreeNode(Node n)
Description copied from interface: ResourceServer
Add a new node usable for recovery.

Specified by:
addFreeNode in interface ResourceServer
Parameters:
n - the node to add

getFreeNode

public Node getFreeNode()
Description copied from interface: ResourceServer
Return the next available node for recovery

Specified by:
getFreeNode in interface ResourceServer
Returns:
an available node

register

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

Specified by:
register in interface RecoveryProcess
Parameters:
id - the registered body id

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 OA
Throws:
java.rmi.RemoteException

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 OA to update
state - state of the active object
Throws:
java.rmi.RemoteException

broadcastFTEvent

public void broadcastFTEvent(FTMessage fte)
                      throws java.rmi.RemoteException
Description copied from interface: RecoveryProcess
Broadcast the event fte to every activity registered in the Recovery process

Specified by:
broadcastFTEvent in interface RecoveryProcess
Parameters:
fte - the event to broadcast
Throws:
java.rmi.RemoteException

isUnreachable

public boolean isUnreachable(UniversalBody body)
                      throws java.rmi.RemoteException
Description copied from interface: FaultDetector
The fault detector test the reachability of the active object body by sending a heartbeat message to body.

Specified by:
isUnreachable in interface FaultDetector
Parameters:
body - the tested active object
Returns:
true if body is unreachable, false otherwise
Throws:
java.rmi.RemoteException

startFailureDetector

public void startFailureDetector(LocationServer ls,
                                 RecoveryProcess rp)
                          throws java.rmi.RemoteException
Description copied from interface: FaultDetector
Start the tread that periodically test the reachability of objects that are registred in the location server ls. If a failure is detected, the recovery process must be noticed.

Specified by:
startFailureDetector in interface FaultDetector
Parameters:
ls - the location server that localizes objects to test
rp - the recovery process to notice if a failure is detected
Throws:
java.rmi.RemoteException

suspendFailureDetector

public void suspendFailureDetector()
                            throws java.rmi.RemoteException
Description copied from interface: FaultDetector
Temporarily suspend the failure detector thread.

Specified by:
suspendFailureDetector in interface FaultDetector
Throws:
java.rmi.RemoteException

stopFailureDetector

public void stopFailureDetector()
                         throws java.rmi.RemoteException
Description copied from interface: FaultDetector
Stop the the failure detector thread.

Specified by:
stopFailureDetector in interface FaultDetector
Throws:
java.rmi.RemoteException

forceDetection

public void forceDetection()
Description copied from interface: FaultDetector
Force a failure detection even if the failure detector thread is waiting.

Specified by:
forceDetection in interface FaultDetector

getOneID

public UniqueID getOneID()


Copyright ? April 2005 INRIA All Rights Reserved.