Package jade.imtp.leap.nio
Class BEManagementService
- java.lang.Object
-
- jade.core.BaseService
-
- jade.imtp.leap.nio.BEManagementService
-
- All Implemented Interfaces:
Service
public class BEManagementService extends BaseService
This service handles BEContainer creation requests and manages IO operations for data exchanged between the created BEContainers and their FEContainers in an asynchronous way using java.nio
Having this functionality implemented as a service allows propagating (through the ServiceHelper) BackEnd related events (e.g. disconnections and reconnections) at the agent level.
This service accepts the following configuration parameters:
jade_imtp_leap_nio_BEManagementService_servers: list of of IOEventServer ids separated by ';'
Actually this service is a collection of IOEventServer objects. Each IOEventServer opens and manages a server socket, accepts BackEnd creation/connection requests and passes incoming data to BEDispatchers independently from the others. If the above parameter is not specified a single IOEventServer will be started and its ID will bejade_imtp_leap_nio_BEManagementService. All other parameters are related to a single IOEventServer and must be specified in the form
serverid_parametername
They are:-
serverid_local-host: Specifies the local network interface for the server socket managed by this server (defaults to localhost). -
serverid_local-port: Specifies the local port for the server socket managed by this server (defaults to 2099) -
serverid_protocol: Specifies the protocol used by this server in the form ofjade.imtp.leap.JICP.ProtocolManagerclass -
serverid_additional-services: Specifies additional services that have to be activated in each BackEnd Container started by the indicated server -
serverid_leap-property-file: Specifies the leap-property file to be used by this server. -
serverid_poolsize: Specifies the number of threads used by this server to manage IO events.
- Author:
- Giovanni Caire - TILAB
-
-
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 StringACCEPTstatic StringADDITIONAL_SERVICESstatic StringBUFFERINCREASEthis property can be used to set how many bytes will be used when nio buffer need to be increasedstatic StringINCOMING_CONNECTIONstatic StringNAMEstatic StringSERVERS-
Fields inherited from class jade.core.BaseService
ALL_DUMP_KEY, MAIN_SLICE, myFinder, 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 BEManagementService()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidboot(Profile p)This method is called by the JADE runtime just after this service has been installed.static intgetBufferIncreaseSize()ServiceHelpergetHelper(Agent a)Retrieve the helper of this ServiceStringgetName()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.voidshutdown()This is called by the JADE Runtime when this service is deinstalled.-
Methods inherited from class jade.core.BaseService
addAlias, broadcast, clearCachedSlice, createInvokator, dump, getAllSlices, getAMSBehaviour, getCommandFilter, getCommandSink, getFreshSlice, getHorizontalInterface, getIMTPManager, getLocalNode, getLocalSlice, getNumberOfSlices, getSlice, isLocal, lookupAlias, stringifySlice, submit
-
-
-
-
Field Detail
-
NAME
public static final String NAME
- See Also:
- Constant Field Values
-
ACCEPT
public static final String ACCEPT
- See Also:
- Constant Field Values
-
SERVERS
public static final String SERVERS
- See Also:
- Constant Field Values
-
ADDITIONAL_SERVICES
public static final String ADDITIONAL_SERVICES
- See Also:
- Constant Field Values
-
INCOMING_CONNECTION
public static final String INCOMING_CONNECTION
- See Also:
- Constant Field Values
-
BUFFERINCREASE
public static final String BUFFERINCREASE
this property can be used to set how many bytes will be used when nio buffer need to be increased- 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
-
getBufferIncreaseSize
public static final int getBufferIncreaseSize()
-
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 classBaseService- 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 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
This method is called by the JADE runtime just after this service has been installed. It activates the IO event servers specified in the Profile and the Ticker thread.- 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()
This is called by the JADE Runtime when this service is deinstalled. It stops the Ticker thread and all active IO event servers.- Specified by:
shutdownin interfaceService- Overrides:
shutdownin classBaseService
-
getHelper
public ServiceHelper getHelper(Agent a)
Retrieve the helper of this Service- 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.
- See Also:
AgentToolkit.getHelper(jade.core.Agent, java.lang.String),Agent.getHelper(java.lang.String)
-
-