jade.core.event
Class NotificationService

java.lang.Object
  extended by jade.core.BaseService
      extended by jade.core.event.NotificationService
All Implemented Interfaces:
Service

public class NotificationService
extends BaseService

The JADE service to manage the event notification subsystem installed on the platform.

Author:
Giovanni Rimassa - FRAMeTech s.r.l.

Nested Class Summary
 
Nested classes/interfaces inherited from interface jade.core.Service
Service.Slice, Service.SliceProxy
 
Field Summary
static java.lang.String NAME
          The name of this service.
 
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
NotificationService()
           
 
Method Summary
 Filter getCommandFilter(boolean direction)
          This should be properly implemented by the services that have filters.
 Sink getCommandSink(boolean side)
          This should be properly implemented by the services that have sinks.
 ServiceHelper getHelper(Agent a)
          This should be properly implemented by the services that have helpers.
 java.lang.Class getHorizontalInterface()
          This should be properly implemented by the services that have non-empty slices.
 Service.Slice getLocalSlice()
          This should be properly implemented by the services that have non-empty slices.
 java.lang.String getName()
          Retrieve the name of this service, that can be used to look up its slices in the Service Finder.
 java.lang.String[] getOwnedCommands()
          This should be properly implemented by the services that owns vertival commands.
 void init(AgentContainer ac, Profile p)
          Performs the passive initialization step of the service.
 
Methods inherited from class jade.core.BaseService
addAlias, boot, broadcast, clearCachedSlice, createInvokator, dump, getAllSlices, getAMSBehaviour, getFreshSlice, getIMTPManager, getLocalNode, getNumberOfSlices, getSlice, isLocal, lookupAlias, shutdown, stringifySlice, submit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final java.lang.String NAME
The name of this service.

See Also:
Constant Field Values
Constructor Detail

NotificationService

public NotificationService()
Method Detail

init

public void init(AgentContainer ac,
                 Profile p)
          throws ProfileException
Description copied from interface: Service
Performs 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 the boot() method.

Specified by:
init in interface Service
Overrides:
init in class BaseService
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.

getName

public java.lang.String getName()
Description copied from interface: Service
Retrieve 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

getHorizontalInterface

public java.lang.Class getHorizontalInterface()
Description copied from class: BaseService
This should be properly implemented by the services that have non-empty slices.

Specified by:
getHorizontalInterface in interface Service
Overrides:
getHorizontalInterface in class BaseService
Returns:
A Class object, representing the interface that is implemented by the slices of this service. Let s be the Class object corresponding to the Service.Slice interface, and let c be the returned Class object. Then, the two following conditions must hold:
  1. c.isInterface() == true
  2. s.isAssignableFrom(c) == true

getLocalSlice

public Service.Slice getLocalSlice()
Description copied from class: BaseService
This should be properly implemented by the services that have non-empty slices.

Specified by:
getLocalSlice in interface Service
Overrides:
getLocalSlice in class BaseService
Returns:
The slice of this service that resides on the local platform node, or null if no such slice exists.

getCommandFilter

public Filter getCommandFilter(boolean direction)
Description copied from class: BaseService
This should be properly implemented by the services that have filters. Note that when called multiple times with the same value of the direction parameter this method MUST always return the same object!

Specified by:
getCommandFilter in interface Service
Overrides:
getCommandFilter in class BaseService
Parameters:
direction - One of the two constants Filter.INCOMING and Filter.OUTGOING, distinguishing between the two filter chains managed by the command processor.
Returns:
A Filter object, 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 return null when appropriate.
See Also:
CommandProcessor

getCommandSink

public Sink getCommandSink(boolean side)
Description copied from class: BaseService
This should be properly implemented by the services that have sinks.

Specified by:
getCommandSink in interface Service
Overrides:
getCommandSink in class BaseService
Parameters:
side - One of the two constants Sink.COMMAND_SOURCE or Sink.COMMAND_TARGET, to state whether this sink will handle locally issued commands or commands incoming from remote nodes.
Returns:
Concrete services must return their own implementation of the Sink interface, that will be invoked by the kernel in order to consume any incoming vertical command owned by this service. If the service does not wish to install a command sink, it can just return null.
See Also:
Service.getOwnedCommands()

getHelper

public ServiceHelper getHelper(Agent a)
                        throws ServiceException
Description copied from class: BaseService
This should be properly implemented by the services that have helpers.

Specified by:
getHelper in interface Service
Overrides:
getHelper in class BaseService
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)

getOwnedCommands

public java.lang.String[] getOwnedCommands()
Description copied from class: BaseService
This should be properly implemented by the services that owns vertival commands.

Specified by:
getOwnedCommands in interface Service
Overrides:
getOwnedCommands in class BaseService
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 null as well.
See Also:
jade.core.Service#getCommandSink()