Package jade.core.nodeMonitoring
Class UDPNodeMonitoringService
- java.lang.Object
-
- jade.core.BaseService
-
- jade.core.nodeMonitoring.NodeMonitoringService
-
- jade.core.nodeMonitoring.UDPNodeMonitoringService
-
- All Implemented Interfaces:
Service
public class UDPNodeMonitoringService extends NodeMonitoringService
UDP based implementation of the NodeMonitoringService.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jade.core.Service
Service.Slice, Service.SliceProxy
-
-
Field Summary
Fields Modifier and Type Field Description static StringACCEPT_LOCAL_HOST_ONLYThis constant is the name of the property whose value contains a boolean indication that specifies whether or not UDP pings must be accepted on the indicated local-host only (default = false).static intDEFAULT_PING_DELAYDefault time between two outgoing pingsstatic intDEFAULT_PING_DELAY_LIMITDefault maximum time the server waits for a pingstatic intDEFAULT_PORTDefault port on which the server is waiting for ping messagesstatic intDEFAULT_UNREACHABLE_LIMITDefault maximum time a node can stay unreachablestatic StringHOSTThis constant is the name of the property whose value contains the hostname where the Main Container is listening for UDP pings.static StringMAX_TRACED_UNKNOWN_PINGSThis constant is the name of the property whose value contains an integer representing the maximum number of UDP ping packets received from an un-monitored node that are traced.static StringNAMEThe name of this servicestatic StringNETWORK_CHECKERThis constants is the name of the property whose value contains the fully qualified class name of a concrete implementation of theNetworkCheckerinterface.static StringORPHAN_NODEVertical command issued on the Main Container when a given number of ping packets are received from an unknown nodestatic StringORPHAN_NODE_PINGS_CNTThis constant is the name of the property whose value contains an integer representing the number of UDP ping packets that must be received from an un-monitored node before considering it an orphan node and issuing an Orphan-Node Vertical command.
The default for this property is 10.
This property is only meaningful on a main container.static StringPING_DELAYThis constant is the name of the property whose value contains an integer representing the time interval (in milliseconds) in which a peripheral container sends UDP ping messages to the Main Container.
This property is only meaningful on a peripheral container.static StringPING_DELAY_LIMITThis constant is the name of the property whose value contains an integer representing the maximum time (in milliseconds) the main container waits for a ping message before considering the peripheral container unreachable.
This property is only meaningful on a main container.static StringPORTThis constant is the name of the property whose value contains an integer representing the port number where the Main Container is listening for UDP pings.static StringUNREACHABLE_LIMITThis constant is the name of the property whose value contains an integer representing the maximum time a node can stay unreachable after it gets removed from the platform.
This property is only meaningful on a main container.-
Fields inherited from class jade.core.nodeMonitoring.NodeMonitoringService
NODE_REACHABLE, NODE_UNREACHABLE
-
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 UDPNodeMonitoringService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FiltergetCommandFilter(boolean direction)This should be properly implemented by the services that have filters.NodeFailureMonitorgetFailureMonitor()ClassgetHorizontalInterface()This should be properly implemented by the services that have non-empty slices.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.String[]getOwnedCommands()This should be properly implemented by the services that owns vertival commands.voidinit(AgentContainer ac, Profile p)Performs the passive initialization step of the service.protected voidsetClientsPingDelay(int delay)voidshutdown()Performs the shutdown step of a kernel-level service.-
Methods inherited from class jade.core.BaseService
addAlias, boot, broadcast, clearCachedSlice, createInvokator, dump, getAllSlices, getAMSBehaviour, getCommandSink, getFreshSlice, getHelper, getIMTPManager, getLocalNode, getNumberOfSlices, getSlice, isLocal, lookupAlias, stringifySlice, submit
-
-
-
-
Field Detail
-
NAME
public static final String NAME
The name of this service- See Also:
- Constant Field Values
-
HOST
public static final String HOST
This constant is the name of the property whose value contains the hostname where the Main Container is listening for UDP pings. If not specified the value of the Profile.LOCAL_HOST option is used. If this is null too the default network name is used.- See Also:
- Constant Field Values
-
ACCEPT_LOCAL_HOST_ONLY
public static final String ACCEPT_LOCAL_HOST_ONLY
This constant is the name of the property whose value contains a boolean indication that specifies whether or not UDP pings must be accepted on the indicated local-host only (default = false).- See Also:
- Constant Field Values
-
PORT
public static final String PORT
This constant is the name of the property whose value contains an integer representing the port number where the Main Container is listening for UDP pings.- See Also:
- Constant Field Values
-
PING_DELAY
public static final String PING_DELAY
This constant is the name of the property whose value contains an integer representing the time interval (in milliseconds) in which a peripheral container sends UDP ping messages to the Main Container.
This property is only meaningful on a peripheral container.- See Also:
- Constant Field Values
-
PING_DELAY_LIMIT
public static final String PING_DELAY_LIMIT
This constant is the name of the property whose value contains an integer representing the maximum time (in milliseconds) the main container waits for a ping message before considering the peripheral container unreachable.
This property is only meaningful on a main container.- See Also:
- Constant Field Values
-
UNREACHABLE_LIMIT
public static final String UNREACHABLE_LIMIT
This constant is the name of the property whose value contains an integer representing the maximum time a node can stay unreachable after it gets removed from the platform.
This property is only meaningful on a main container.- See Also:
- Constant Field Values
-
ORPHAN_NODE_PINGS_CNT
public static final String ORPHAN_NODE_PINGS_CNT
This constant is the name of the property whose value contains an integer representing the number of UDP ping packets that must be received from an un-monitored node before considering it an orphan node and issuing an Orphan-Node Vertical command.
The default for this property is 10.
This property is only meaningful on a main container.- See Also:
- Constant Field Values
-
MAX_TRACED_UNKNOWN_PINGS
public static final String MAX_TRACED_UNKNOWN_PINGS
This constant is the name of the property whose value contains an integer representing the maximum number of UDP ping packets received from an un-monitored node that are traced. Successive packets from the same un-monitored node will be completely ignored The default for this property is 100.
This property is only meaningful on a main container.- See Also:
- Constant Field Values
-
NETWORK_CHECKER
public static final String NETWORK_CHECKER
This constants is the name of the property whose value contains the fully qualified class name of a concrete implementation of theNetworkCheckerinterface. If this property is set, before considering dead a monitored node that remains unreachable for more than theunreachable-limit, the specifiedNetworkCheckeris activated to check if the lack of UDP ping packets depends on a network disconnection. If this is the case the node is kept in theUNREACHABLEstate and is not removed.
This property is only meaningful on a main container.- See Also:
NetworkChecker, Constant Field Values
-
DEFAULT_PORT
public static final int DEFAULT_PORT
Default port on which the server is waiting for ping messages- See Also:
- Constant Field Values
-
DEFAULT_PING_DELAY
public static final int DEFAULT_PING_DELAY
Default time between two outgoing pings- See Also:
- Constant Field Values
-
DEFAULT_PING_DELAY_LIMIT
public static final int DEFAULT_PING_DELAY_LIMIT
Default maximum time the server waits for a ping- See Also:
- Constant Field Values
-
DEFAULT_UNREACHABLE_LIMIT
public static final int DEFAULT_UNREACHABLE_LIMIT
Default maximum time a node can stay unreachable- See Also:
- Constant Field Values
-
ORPHAN_NODE
public static final String ORPHAN_NODE
Vertical command issued on the Main Container when a given number of ping packets are received from an unknown node- See Also:
- Constant Field Values
-
-
Method Detail
-
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
-
getOwnedCommands
public String[] getOwnedCommands()
Description copied from class:BaseServiceThis should be properly implemented by the services that owns vertival commands.- Specified by:
getOwnedCommandsin interfaceService- Overrides:
getOwnedCommandsin classNodeMonitoringService- Returns:
- An array containing the names of all the vertical
commands this service wants to own. If this service has no such
commands (it acts purely as a command filter), it can return an
empty array, or
nullas well. - See Also:
jade.core.Service#getCommandSink()
-
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 classNodeMonitoringService- 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.
-
getFailureMonitor
public NodeFailureMonitor getFailureMonitor()
- Specified by:
getFailureMonitorin classNodeMonitoringService
-
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
-
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
-
getHorizontalInterface
public Class getHorizontalInterface()
Description copied from class:BaseServiceThis should be properly implemented by the services that have non-empty slices.- Specified by:
getHorizontalInterfacein interfaceService- Overrides:
getHorizontalInterfacein classBaseService- Returns:
- A
Classobject, representing the interface that is implemented by the slices of this service. Letsbe theClassobject corresponding to theService.Sliceinterface, and letcbe the returnedClassobject. Then, the two following conditions must hold:c.isInterface() == trues.isAssignableFrom(c) == true
-
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.
-
setClientsPingDelay
protected void setClientsPingDelay(int delay)
-
-