org.objectweb.proactive.core.body.ft.protocols
Class FTManager

java.lang.Object
  extended byorg.objectweb.proactive.core.body.ft.protocols.FTManager
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
FTManagerCIC, FTManagerPMLRB, HalfFTManagerCIC, HalfFTManagerPMLRB

public abstract class FTManager
extends java.lang.Object
implements java.io.Serializable

Define all hook methods for the management of fault-tolerance.

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

Field Summary
protected  java.lang.String additionalCodebase
           
static int DEFAULT_TTC_VALUE
          This is the default value in ms of the checkpoint interval time
static java.lang.String HALF_BODY_EXCEPTION_MESSAGE
          Error message when calling uncallable method on a halfbody
static int IMMEDIATE_SERVICE
          Value returned by an object if the recieved message is served as an immediate service (@see xxx)
protected  LocationServer location
           
protected static org.apache.log4j.Logger logger
           
static int NON_FT
          This value is sent by an active object that is not fault tolerant
static int ORPHAN_REPLY
          Value returned by an object if the received message is orphan
protected  AbstractBody owner
           
protected  UniqueID ownerID
           
protected  RecoveryProcess recovery
           
protected  CheckpointServer storage
           
static long TIME_TO_RESEND
          Time to wait between a send and a resend in ms
protected  int ttc
           
 
Constructor Summary
FTManager()
           
 
Method Summary
abstract  int beforeRestartAfterRecovery(CheckpointInfo ci, int inc)
          This method is called before restarting an object which has been recovered from a checkpoint.
 UniversalBody communicationFailed(UniqueID suspect, UniversalBody suspectLocation, java.lang.Exception e)
          Common behavior when a communication with another active object failed.
static int getProtoSelector(java.lang.String protoName)
          Return the selector value for a given protocol.
abstract  java.lang.Object handleFTMessage(FTMessage fte)
          This method is called when a non fonctionnal fault-tolerance message is received
 java.lang.Object handleHBEvent(Heartbeat fte)
          Heartbeat message.
 int init(AbstractBody owner)
          Initialize the FTManager.
 boolean isACheckpoint()
          Return true if the owner is a checkpoint, i.e. during checkpointing, and on recovery when the owner is deserialized.
abstract  int onDeliverReply(Reply reply)
          This method is called after the future is updated by the reply.
abstract  int onDeliverRequest(Request request)
          This method is called when a request is stored in the requestqueue
abstract  int onReceiveReply(Reply reply)
          This method is called when a reply is received.
abstract  int onReceiveRequest(Request request)
          This method is called when a request is received.
abstract  int onSendReplyAfter(Reply reply, int rdvValue, UniversalBody destination)
          This method is called after the sending of a reply
abstract  int onSendReplyBefore(Reply reply)
          This method is called before the sending of a reply
abstract  int onSendRequestAfter(Request request, int rdvValue, UniversalBody destination)
          This method is called after the sending of a request
abstract  int onSendRequestBefore(Request request)
          This method is called before the sending of a request
abstract  int onServeRequestAfter(Request request)
          This method is called after the service of a request
abstract  int onServeRequestBefore(Request request)
          This method is called before the service of a request
 int sendReply(Reply r, UniversalBody destination)
          Fault-tolerant sending: this send notices fault tolerance servers if the destination is unreachable and resent the message until destination is reachable.
 int sendRequest(Request r, UniversalBody destination)
          Fault-tolerant sending: this send notices fault tolerance servers if the destination is unreachable and resent the message until destination is reachable.
 void setCheckpointTag(boolean tag)
          Set the current state of the owner as a checkpoint.
 void termination()
          Unregister this activity from the fault-tolerance mechanism.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static org.apache.log4j.Logger logger

NON_FT

public static final int NON_FT
This value is sent by an active object that is not fault tolerant

See Also:
Constant Field Values

DEFAULT_TTC_VALUE

public static final int DEFAULT_TTC_VALUE
This is the default value in ms of the checkpoint interval time

See Also:
Constant Field Values

IMMEDIATE_SERVICE

public static final int IMMEDIATE_SERVICE
Value returned by an object if the recieved message is served as an immediate service (@see xxx)

See Also:
Constant Field Values

ORPHAN_REPLY

public static final int ORPHAN_REPLY
Value returned by an object if the received message is orphan

See Also:
Constant Field Values

TIME_TO_RESEND

public static final long TIME_TO_RESEND
Time to wait between a send and a resend in ms

See Also:
Constant Field Values

HALF_BODY_EXCEPTION_MESSAGE

public static final java.lang.String HALF_BODY_EXCEPTION_MESSAGE
Error message when calling uncallable method on a halfbody

See Also:
Constant Field Values

owner

protected AbstractBody owner

ownerID

protected UniqueID ownerID

storage

protected CheckpointServer storage

location

protected LocationServer location

recovery

protected RecoveryProcess recovery

additionalCodebase

protected java.lang.String additionalCodebase

ttc

protected int ttc
Constructor Detail

FTManager

public FTManager()
Method Detail

getProtoSelector

public static int getProtoSelector(java.lang.String protoName)
Return the selector value for a given protocol.

Parameters:
protoName - the name of the protocol (cic or pml).
Returns:
the selector value for a given protocol.

init

public int init(AbstractBody owner)
         throws ProActiveException
Initialize the FTManager. This method establihes all needed connections with the servers. The owner object is registred in the location server (@see xxx).

Parameters:
owner - The object linked to this FTManager
Returns:
still not used
Throws:
ProActiveException - A problem occurs during the connection with the servers

termination

public void termination()
                 throws ProActiveException
Unregister this activity from the fault-tolerance mechanism. This method must be called when an active object ends its activity normally.

Throws:
ProActiveException

isACheckpoint

public boolean isACheckpoint()
Return true if the owner is a checkpoint, i.e. during checkpointing, and on recovery when the owner is deserialized.

Returns:
true if the owner is a checkpoint, i.e. during checkpointing, and on recovery when the owner is deserialized, false ohterwise

setCheckpointTag

public void setCheckpointTag(boolean tag)
Set the current state of the owner as a checkpoint. Called during checkpoiting.

Parameters:
tag - true during checkpointing, false otherwise

communicationFailed

public UniversalBody communicationFailed(UniqueID suspect,
                                         UniversalBody suspectLocation,
                                         java.lang.Exception e)
Common behavior when a communication with another active object failed. The location server is contacted.

Parameters:
suspect - the uniqueID of the callee
suspectLocation - the supposed location of the callee
e - the exception raised during the communication
Returns:
the actual location of the callee

sendReply

public int sendReply(Reply r,
                     UniversalBody destination)
Fault-tolerant sending: this send notices fault tolerance servers if the destination is unreachable and resent the message until destination is reachable.

Parameters:
r - the reply to send
destination - the destination of the reply
Returns:
the value returned by the sending

sendRequest

public int sendRequest(Request r,
                       UniversalBody destination)
                throws RenegotiateSessionException
Fault-tolerant sending: this send notices fault tolerance servers if the destination is unreachable and resent the message until destination is reachable.

Parameters:
r - the request to send
destination - the destination of the request
Returns:
the value returned by the sending
Throws:
RenegotiateSessionException

handleHBEvent

public java.lang.Object handleHBEvent(Heartbeat fte)
Heartbeat message. Send state value to the fault detector.

Parameters:
fte - heartbeat message.
Returns:
FaultDetector.OK if active object is alive, FaultDetector.IS_DEAD otherwise.

onReceiveReply

public abstract int onReceiveReply(Reply reply)
This method is called when a reply is received.

Parameters:
reply - the received reply

onReceiveRequest

public abstract int onReceiveRequest(Request request)
This method is called when a request is received.

Parameters:
request - the received request

onDeliverReply

public abstract int onDeliverReply(Reply reply)
This method is called after the future is updated by the reply.

Parameters:
reply - the reply that updates a future

onDeliverRequest

public abstract int onDeliverRequest(Request request)
This method is called when a request is stored in the requestqueue

Parameters:
request - the stored request

onSendReplyBefore

public abstract int onSendReplyBefore(Reply reply)
This method is called before the sending of a reply

Parameters:
reply - the reply that will be sent

onSendReplyAfter

public abstract int onSendReplyAfter(Reply reply,
                                     int rdvValue,
                                     UniversalBody destination)
This method is called after the sending of a reply

Parameters:
reply - the sent reply
rdvValue - the value returned by the sending
destination - the destination body of reply
Returns:
depends on fault-tolerance protocol

onSendRequestBefore

public abstract int onSendRequestBefore(Request request)
This method is called before the sending of a request

Parameters:
request - the request that will be sent
Returns:
depends on fault-tolerance protocol

onSendRequestAfter

public abstract int onSendRequestAfter(Request request,
                                       int rdvValue,
                                       UniversalBody destination)
                                throws RenegotiateSessionException
This method is called after the sending of a request

Parameters:
request - the sent request
rdvValue - the value returned by the sending
destination - the destination body of request
Returns:
depends on fault-tolerance protocol
Throws:
RenegotiateSessionException

onServeRequestBefore

public abstract int onServeRequestBefore(Request request)
This method is called before the service of a request

Parameters:
request - the request that is served
Returns:
depends on fault-tolerance protocol

onServeRequestAfter

public abstract int onServeRequestAfter(Request request)
This method is called after the service of a request

Parameters:
request - the request that has been served
Returns:
depends on fault-tolerance protocol

beforeRestartAfterRecovery

public abstract int beforeRestartAfterRecovery(CheckpointInfo ci,
                                               int inc)
This method is called before restarting an object which has been recovered from a checkpoint.

Parameters:
ci - infos of the checkpoint used for recovery
inc - incarantion number of this recovery
Returns:
depends on fault-tolerance protocol

handleFTMessage

public abstract java.lang.Object handleFTMessage(FTMessage fte)
This method is called when a non fonctionnal fault-tolerance message is received

Parameters:
fte - the received message
Returns:
depend on the message meaning


Copyright 2001-2005 INRIA All Rights Reserved.