public class SAMService extends BaseService
Service.Slice
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
POLLING_PERIOD |
static int |
POLLING_PERIOD_DEFAULT |
static java.lang.String |
SAM_INFO_HANDLERS |
static java.lang.String |
SAM_INFO_HANDLERS_DEFAULT |
ALL_DUMP_KEY, MAIN_SLICE, myFinder, myLogger, THIS_SLICE
ADOPTED_NODE, DEAD_NODE, DEAD_PLATFORM_MANAGER, DEAD_REPLICA, DEAD_SLICE, NEW_NODE, NEW_REPLICA, NEW_SLICE, REATTACHED, RECONNECTED
Constructor and Description |
---|
SAMService() |
Modifier and Type | Method and Description |
---|---|
void |
boot(Profile p)
Performs the active initialization step of a kernel-level
service.
|
Filter |
getCommandFilter(boolean direction)
This should be properly implemented
by the services that have filters.
|
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.
|
static SAMHelper |
getSingletonHelper() |
void |
init(AgentContainer ac,
Profile p)
Performs the passive initialization step of the service.
|
void |
shutdown()
Performs the shutdown step of a kernel-level service.
|
addAlias, broadcast, clearCachedSlice, createInvokator, dump, getAllSlices, getAMSBehaviour, getCommandSink, getFreshSlice, getIMTPManager, getLocalNode, getNumberOfSlices, getOwnedCommands, getSlice, isLocal, lookupAlias, stringifySlice, submit
public static final java.lang.String POLLING_PERIOD
public static final int POLLING_PERIOD_DEFAULT
public static final java.lang.String SAM_INFO_HANDLERS
public static final java.lang.String SAM_INFO_HANDLERS_DEFAULT
public java.lang.String getName()
Service
ServiceFinder
public void init(AgentContainer ac, Profile p) throws ProfileException
Service
boot()
method.init
in interface Service
init
in class BaseService
ac
- The agent container this service is activated on.p
- The configuration profile for this service.ProfileException
- If the given profile is not valid.public void boot(Profile p) throws ServiceException
Service
boot
in interface Service
boot
in class BaseService
p
- The configuration profile for this service.ServiceException
- If a problem occurs during service
initialization.public void shutdown()
Service
shutdown
in interface Service
shutdown
in class BaseService
public Filter getCommandFilter(boolean direction)
BaseService
direction
parameter this method MUST always return the same object!getCommandFilter
in interface Service
getCommandFilter
in class BaseService
direction
- One of the two constants
Filter.INCOMING
and Filter.OUTGOING
,
distinguishing between the two filter chains managed by the
command processor.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.jade.core.CommandProcessor
public ServiceHelper getHelper(Agent a)
BaseService
getHelper
in interface Service
getHelper
in class BaseService
a
- The agent which the helper is requested for.AgentToolkit.getHelper(jade.core.Agent, java.lang.String)
,
Agent.getHelper(java.lang.String)
public static SAMHelper getSingletonHelper()
public java.lang.Class getHorizontalInterface()
BaseService
getHorizontalInterface
in interface Service
getHorizontalInterface
in class BaseService
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:
c.isInterface() == true
s.isAssignableFrom(c) == true
public Service.Slice getLocalSlice()
BaseService
getLocalSlice
in interface Service
getLocalSlice
in class BaseService
null
if no such slice exists.