Package jade.core.messaging
Class MomMessagingService
- java.lang.Object
-
- jade.core.BaseService
-
- jade.core.messaging.MessagingService
-
- jade.core.messaging.MomMessagingService
-
- All Implemented Interfaces:
jade.core.messaging.MessageManager.Channel,Service
public abstract class MomMessagingService extends MessagingService
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jade.core.messaging.MessagingService
MessagingService.UnknownACLEncodingException
-
Nested classes/interfaces inherited from interface jade.core.Service
Service.Slice, Service.SliceProxy
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanactiveprotected StringmyLocationstatic StringSEPARATOR-
Fields inherited from class jade.core.messaging.MessagingService
ATTACH_PLATFORM_INFO, CACHE_SIZE, CACHE_SIZE_DEFAULT, cachedSlices, DELIVERY_TIME_MEASUREMENT_RATE, DELIVERY_TIME_MEASUREMENT_RATE_DEFAULT, ENABLE_MESSAGE_MANAGER_METRICS, ENABLE_POSTED_MESSAGE_COUNT, MAX_DELIVERY_RETRY_ATTEMPTS, MAX_DELIVERY_RETRY_ATTEMPTS_DEFAULT, maxDeliveryRetryAttempts, MTP_IDENTIFIER, myContainer, myProfile, NAME, PLATFORM_IDENTIFIER
-
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 MomMessagingService()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidboot(Profile myProfile)Performs the active initialization step of a kernel-level service: Activates the ACL codecs and MTPs as specified in the givenProfileinstance.protected voiddeliverInLocalPlatfrom(GenericMessage msg, AID receiverID)protected StringextractSource(String deliveryID)protected StringgenerateDeliveryID(AID senderID, GenericMessage msg, AID receiverID)SinkgetCommandSink(boolean side)Access the command sink this service uses to handle its own vertical commands.protected voidhandleDeliveryResult(String deliveryID, Throwable t)protected voidhandleMessageFromMom(String deliveryID, AID senderID, GenericMessage msg, AID receiverID, String senderLocation)protected voidhandleReceiptFromMom(String deliveryID, Throwable t)protected voidinitMom()protected abstract voidsendMessageViaMom(String deliveryID, AID senderID, GenericMessage msg, AID receiverID, String receiverLocation)protected abstract voidsendReceiptViaMom(String deliveryID, String messageSenderLocation, Throwable failure)voidshutdown()Performs the shutdown step of a kernel-level service.protected voidshutdownMom()-
Methods inherited from class jade.core.messaging.MessagingService
checkTracing, clearCachedSlice, deadAlias, deliverNow, dump, getAgentLocation, getCommandFilter, getFreshSlice, getHelper, getHorizontalInterface, getLocalSlice, getMessageManagerGlobalInfo, getMessageManagerQueueStatus, getMessageManagerThreadPool, getMessageManagerThreadPoolStatus, getName, getOwnedCommands, init, newAlias, notifyFailureToSender, removeGlobalAliases
-
Methods inherited from class jade.core.BaseService
addAlias, broadcast, createInvokator, getAllSlices, getAMSBehaviour, getIMTPManager, getLocalNode, getNumberOfSlices, getSlice, isLocal, lookupAlias, stringifySlice, submit
-
-
-
-
Field Detail
-
SEPARATOR
public static final String SEPARATOR
- See Also:
- Constant Field Values
-
myLocation
protected String myLocation
-
active
protected boolean active
-
-
Method Detail
-
boot
public void boot(Profile myProfile) throws ServiceException
Description copied from class:MessagingServicePerforms the active initialization step of a kernel-level service: Activates the ACL codecs and MTPs as specified in the givenProfileinstance.- Specified by:
bootin interfaceService- Overrides:
bootin classMessagingService- Parameters:
myProfile- TheProfileinstance containing the list of ACL codecs and MTPs to activate on this node.- Throws:
ServiceException- If a problem occurs during service initialization.
-
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 classMessagingService
-
getCommandSink
public Sink getCommandSink(boolean side)
Description copied from class:MessagingServiceAccess the command sink this service uses to handle its own vertical commands.- Specified by:
getCommandSinkin interfaceService- Overrides:
getCommandSinkin classMessagingService- Parameters:
side- One of the two constantsSink.COMMAND_SOURCEorSink.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
Sinkinterface, 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 returnnull. - See Also:
Service.getOwnedCommands()
-
initMom
protected void initMom()
-
shutdownMom
protected void shutdownMom()
-
generateDeliveryID
protected String generateDeliveryID(AID senderID, GenericMessage msg, AID receiverID)
-
deliverInLocalPlatfrom
protected void deliverInLocalPlatfrom(GenericMessage msg, AID receiverID) throws IMTPException, ServiceException, NotFoundException, JADESecurityException
- Overrides:
deliverInLocalPlatfromin classMessagingService- Throws:
IMTPExceptionServiceExceptionNotFoundExceptionJADESecurityException
-
sendMessageViaMom
protected abstract void sendMessageViaMom(String deliveryID, AID senderID, GenericMessage msg, AID receiverID, String receiverLocation) throws IMTPException
- Throws:
IMTPException
-
sendReceiptViaMom
protected abstract void sendReceiptViaMom(String deliveryID, String messageSenderLocation, Throwable failure)
-
handleMessageFromMom
protected void handleMessageFromMom(String deliveryID, AID senderID, GenericMessage msg, AID receiverID, String senderLocation)
-
-