Package jade.core.faultRecovery
Class FaultRecoveryService
- java.lang.Object
-
- jade.core.BaseService
-
- jade.core.faultRecovery.FaultRecoveryService
-
- All Implemented Interfaces:
Service
public class FaultRecoveryService extends BaseService
The FaultRecovery service allows recovering a platform after a fault and a successive restart of the main container. On a Main container this service keeps track of platform nodes in a persistent storage. When the platform shuts down the persistent storage is cleared. At bootstrap time the service gets all nodes from the persistent storage (there are nodes only if the main container is restarting after a crash) and notifies them (if still alive) about the recovery. On peripheral containers, the node, when notified about a main recovery, re-adds itself to the recovered main (actually this is done by the ServiceManager) and issues a Service.REATTACHED incoming V-Command. The FaultRecovery service filter intercepts this command and re-adds all agents living in the container.- Author:
- Giovanni Caire - TILAB
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classFaultRecoveryService.NodeSerializerInner class NodeSerializer-
Nested classes/interfaces inherited from interface jade.core.Service
Service.Slice, Service.SliceProxy
-
-
Field Summary
Fields Modifier and Type Field Description static StringCLEAN_STORAGEstatic StringH_KILLNODEstatic StringNAMEstatic StringORPHAN_NODE_POLICYstatic StringORPHAN_NODE_POLICY_IGNOREstatic StringORPHAN_NODE_POLICY_KILLstatic StringORPHAN_NODE_POLICY_RECOVERstatic StringPERSISTENT_STORAGE_CLASSstatic StringPERSISTENT_STORAGE_CLASS_DEFAULT-
Fields inherited from class jade.core.BaseService
ALL_DUMP_KEY, MAIN_SLICE, myFinder, myLogger, THIS_SLICE
-
Fields inherited from interface jade.core.Service
ADOPTED_NODE, DEAD_NODE, DEAD_PLATFORM_MANAGER, DEAD_REPLICA, DEAD_SLICE, NEW_NODE, NEW_REPLICA, NEW_SLICE, REATTACHED, RECONNECTED
-
-
Constructor Summary
Constructors Constructor Description FaultRecoveryService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidboot(Profile p)Performs the active initialization step of a kernel-level service.FiltergetCommandFilter(boolean direction)This should be properly implemented by the services that have filters.ServiceHelpergetHelper(Agent a)This should be properly implemented by the services that have helpers.Service.SlicegetLocalSlice()This should be properly implemented by the services that have non-empty slices.StringgetName()Retrieve the name of this service, that can be used to look up its slices in the Service Finder.voidinit(AgentContainer ac, Profile p)Performs the passive initialization step of the service.voidshutdown()Performs the shutdown step of a kernel-level service.-
Methods inherited from class jade.core.BaseService
addAlias, broadcast, clearCachedSlice, createInvokator, dump, getAllSlices, getAMSBehaviour, getCommandSink, getFreshSlice, getHorizontalInterface, getIMTPManager, getLocalNode, getNumberOfSlices, getOwnedCommands, getSlice, isLocal, lookupAlias, stringifySlice, submit
-
-
-
-
Field Detail
-
NAME
public static final String NAME
- See Also:
- Constant Field Values
-
CLEAN_STORAGE
public static final String CLEAN_STORAGE
- See Also:
- Constant Field Values
-
PERSISTENT_STORAGE_CLASS
public static final String PERSISTENT_STORAGE_CLASS
- See Also:
- Constant Field Values
-
ORPHAN_NODE_POLICY
public static final String ORPHAN_NODE_POLICY
- See Also:
- Constant Field Values
-
PERSISTENT_STORAGE_CLASS_DEFAULT
public static final String PERSISTENT_STORAGE_CLASS_DEFAULT
- See Also:
- Constant Field Values
-
ORPHAN_NODE_POLICY_RECOVER
public static final String ORPHAN_NODE_POLICY_RECOVER
- See Also:
- Constant Field Values
-
ORPHAN_NODE_POLICY_KILL
public static final String ORPHAN_NODE_POLICY_KILL
- See Also:
- Constant Field Values
-
ORPHAN_NODE_POLICY_IGNORE
public static final String ORPHAN_NODE_POLICY_IGNORE
- See Also:
- Constant Field Values
-
H_KILLNODE
public static final String H_KILLNODE
- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public void init(AgentContainer ac, Profile p) throws ProfileException
Description copied from interface:ServicePerforms the passive initialization step of the service. This method is called before activating the service. Its role should be simply the one of a constructor, setting up the internal data as needed. Service implementations should not use the Service Manager and Service Finder facilities from within this method. A distributed initialization protocol, if needed, should be exectuted within theboot()method.- Specified by:
initin interfaceService- Overrides:
initin classBaseService- Parameters:
ac- The agent container this service is activated on.p- The configuration profile for this service.- Throws:
ProfileException- If the given profile is not valid.
-
boot
public void boot(Profile p) throws ServiceException
Description copied from interface:ServicePerforms the active initialization step of a kernel-level service. When JADE kernel calls this method, the service has already been already associated with its container and registered with the Service Manager.- Specified by:
bootin interfaceService- Overrides:
bootin classBaseService- Parameters:
p- The configuration profile for this service.- Throws:
ServiceException- If a problem occurs during service initialization.
-
shutdown
public void shutdown()
Description copied from interface:ServicePerforms the shutdown step of a kernel-level service. The JADE kernel calls this method just before uninstalling this service- Specified by:
shutdownin interfaceService- Overrides:
shutdownin classBaseService
-
getName
public String getName()
Description copied from interface:ServiceRetrieve the name of this service, that can be used to look up its slices in the Service Finder.- Returns:
- The name of this service.
- See Also:
ServiceFinder
-
getCommandFilter
public Filter getCommandFilter(boolean direction)
Description copied from class:BaseServiceThis should be properly implemented by the services that have filters. Note that when called multiple times with the same value of thedirectionparameter this method MUST always return the same object!- Specified by:
getCommandFilterin interfaceService- Overrides:
getCommandFilterin classBaseService- Parameters:
direction- One of the two constantsFilter.INCOMINGandFilter.OUTGOING, distinguishing between the two filter chains managed by the command processor.- Returns:
- A
Filterobject, used by this service to intercept and process kernel-level commands. If the service does not wish to install a command filter for one or both directions, it can just returnnullwhen appropriate. - See Also:
CommandProcessor
-
getLocalSlice
public Service.Slice getLocalSlice()
Description copied from class:BaseServiceThis should be properly implemented by the services that have non-empty slices.- Specified by:
getLocalSlicein interfaceService- Overrides:
getLocalSlicein classBaseService- Returns:
- The slice of this service that resides on the local
platform node, or
nullif no such slice exists.
-
getHelper
public ServiceHelper getHelper(Agent a) throws ServiceException
Description copied from class:BaseServiceThis should be properly implemented by the services that have helpers.- Specified by:
getHelperin interfaceService- Overrides:
getHelperin classBaseService- Parameters:
a- The agent which the helper is requested for.- Returns:
- The ServiceHelper to be used by the agent.
- Throws:
ServiceException- See Also:
AgentToolkit.getHelper(jade.core.Agent, java.lang.String),Agent.getHelper(java.lang.String)
-
-