Package jade.core
Class FEService
- java.lang.Object
-
- jade.core.FEService
-
- Direct Known Subclasses:
TopicManagementFEService
public abstract class FEService extends Object
JADE kernel services providing a service-helper and wishing this helper to be available in the split execution mode too, need to provide a FEService class. When starting a split container theservicesoption works exactly as when starting a normal container, but the indicated classes must be concrete implementations of theFEServiceabstract class.
It should be noticed that a Front-End service is only intended to provide access to the service helper and not to actually implement full service functionality- Author:
- Giovanni Caire - Telecom Italia
-
-
Constructor Summary
Constructors Constructor Description FEService()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description StringgetBEServiceClassName()In many cases for the Front-End service to work properly it is necessary that the real service (or possibly a modified version of it) is active in the Back-End.abstract ServiceHelpergetHelper(Agent a)Subclasses must implement this method to return the helper for accessing this service.abstract StringgetName()Subclasses must implement this method to return the name of this service.protected Objectinvoke(String actor, String methodName, Object[] methodParams)Subclasses can use this method to forward a front-end side invocation of a service helper method to the back-end.
-
-
-
Method Detail
-
getName
public abstract String getName()
Subclasses must implement this method to return the name of this service. Such name must be specified by an agent in thegetHelper()method when retrieving the helper for this service.- Returns:
- The name of this service
-
getBEServiceClassName
public String getBEServiceClassName()
In many cases for the Front-End service to work properly it is necessary that the real service (or possibly a modified version of it) is active in the Back-End. In such cases subclasses may redefine this method to return the fully qualified name of the class implementing the back-end side counterpart of this service.- Returns:
- The fully qualified name of the class implementing the back-end side counterpart of this service
-
getHelper
public abstract ServiceHelper getHelper(Agent a)
Subclasses must implement this method to return the helper for accessing this service.- Parameters:
a- The agent which the helper is requested for.- Returns:
- The ServiceHelper to be used by the agent.
-
invoke
protected Object invoke(String actor, String methodName, Object[] methodParams) throws NotFoundException, ServiceException, IMTPException
Subclasses can use this method to forward a front-end side invocation of a service helper method to the back-end. Said A the agent invoking the method, the effect is that the same method will be invoked, with the passed parameters, on the service helper object associated to the agent image representing A in the back-end. In case the back-end side service helper method requires parameters different than those passed in the methodParams argument, a suitable "BackEnd Codec" class must be provided to perform the necessary conversions. Such class must implement theBECodecinterface and must be called "BECodec" - Parameters:
actor- The name of the agent invoking the service helper methodmethodName- The name of the invoked methodmethodParams- The parameters to be passed to the back-end- Returns:
- The result of the back-end side service helper method invocation possibly encoded by the BackEnd Codec (if any)
- Throws:
NotFoundException- If the invoking agent is not found in the back-endServiceException- If an error occurs at the service levelIMTPException- If a communication error occurs
-
-