|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjadex.commons.service.BasicService
jadex.standalone.service.MessageService
public class MessageService
The Message service serves several message-oriented purposes: a) sending and delivering messages by using transports b) management of transports (add/remove) The message service performs sending and delivering messages by separate actions that are individually executed on the execution service, i.e. they are delivered synchronous or asynchronous depending on the execution service mode.
| Nested Class Summary | |
|---|---|
protected class |
MessageService.DeliverMessage
Deliver message(s) executable. |
protected class |
MessageService.SendManager
Send message(s) executable. |
| Field Summary | |
|---|---|
protected IClockService |
clockservice
The cashed clock service. |
protected IComponentManagementService |
cms
The cashed clock service. |
protected static IContentCodec[] |
DEFCODECS
The default codecs. |
protected MessageService.DeliverMessage |
delivermsg
The deliver message action executed by platform executor. |
protected List |
listeners
The listeners. |
protected String |
LOCAL
No addresses constant. |
protected Logger |
logger
The logger. |
protected LRU |
managers
The target managers. |
protected Map |
messagetypes
The message types. |
protected IServiceProvider |
provider
The provider. |
protected List |
transports
The transports. |
| Fields inherited from class jadex.commons.service.BasicService |
|---|
idcnt, properties, shutdowned, sid, started, startfutures |
| Fields inherited from interface jadex.commons.service.IService |
|---|
EMPTY_SERVICES |
| Constructor Summary | |
|---|---|
MessageService(IServiceProvider provider,
ITransport[] transports,
MessageType[] messagetypes)
Constructor for Outbox. |
|
| Method Summary | |
|---|---|
void |
addMessageListener(IMessageListener listener)
Add a message listener. |
void |
addTransport(ITransport transport)
Adds a transport for this outbox. |
void |
changeTransportPosition(boolean up,
ITransport transport)
Moves a transport up or down. |
Map |
createReply(Map msg,
MessageType mt)
Create a reply to this message event. |
void |
deliverMessage(Map message,
String msgtype,
IComponentIdentifier[] receivers)
Deliver a message to the intended components. |
protected void |
doSendMessage(Map msg,
MessageType type,
IExternalAccess comp,
ClassLoader cl,
Map msgcopy,
Future ret)
Extracted method to be callable from listener. |
String[] |
getAddresses()
Get the adresses of a component. |
String[] |
getAddressSchemes()
Get addresses of all transports. |
static IContentCodec[] |
getContentCodecs(Map props)
Get a matching content codec. |
MessageType |
getMessageType(String type)
Get the message type. |
MessageService.SendManager |
getSendManager(IComponentIdentifier cid)
Get a send target manager for addresses. |
ITransport[] |
getTransports()
Get the transports. |
protected void |
internalDeliverMessage(Map msg,
String type,
IComponentIdentifier[] receivers)
Deliver a message to the receivers. |
void |
removeMessageListener(IMessageListener listener)
Remove a message listener. |
void |
removeTransport(ITransport transport)
Remove a transport for the outbox. |
IFuture |
sendMessage(Map msg,
MessageType type,
IComponentIdentifier sender,
ClassLoader cl)
Send a message. |
IFuture |
shutdownService()
Called when the platform shuts down. |
IFuture |
startService()
Start the service. |
| Methods inherited from class jadex.commons.service.BasicService |
|---|
createServiceIdentifier, generateServiceName, getPropertyMap, getServiceIdentifier, isValid, setPropertyMap, signalStarted |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface jadex.commons.service.IService |
|---|
getPropertyMap, getServiceIdentifier, signalStarted |
| Field Detail |
|---|
protected static IContentCodec[] DEFCODECS
protected String LOCAL
protected IServiceProvider provider
protected List transports
protected Map messagetypes
protected MessageService.DeliverMessage delivermsg
protected Logger logger
protected List listeners
protected IClockService clockservice
protected IComponentManagementService cms
protected LRU managers
| Constructor Detail |
|---|
public MessageService(IServiceProvider provider,
ITransport[] transports,
MessageType[] messagetypes)
platform - | Method Detail |
|---|
public IFuture sendMessage(Map msg,
MessageType type,
IComponentIdentifier sender,
ClassLoader cl)
sendMessage in interface IMessageServicemessage - The native message.
protected void doSendMessage(Map msg,
MessageType type,
IExternalAccess comp,
ClassLoader cl,
Map msgcopy,
Future ret)
public static IContentCodec[] getContentCodecs(Map props)
props - The properties.
public void deliverMessage(Map message,
String msgtype,
IComponentIdentifier[] receivers)
deliverMessage in interface IMessageServicemessage - The native message.
(Synchronized because can be called from concurrently executing transports)
public Map createReply(Map msg,
MessageType mt)
createReply in interface IMessageServicemsgeventtype - The message event type.
public void addTransport(ITransport transport)
transport - The transport.public void removeTransport(ITransport transport)
transport - The transport.
public void changeTransportPosition(boolean up,
ITransport transport)
up - Move up?transport - The transport to move.public String[] getAddresses()
getAddresses in interface IMessageServicepublic String[] getAddressSchemes()
getAddressSchemes in interface IMessageServicepublic ITransport[] getTransports()
public MessageService.SendManager getSendManager(IComponentIdentifier cid)
public IFuture startService()
startService in interface IInternalServicestartService in class BasicServicepublic IFuture shutdownService()
shutdownService in interface IInternalServiceshutdownService in class BasicServicepublic MessageType getMessageType(String type)
getMessageType in interface IMessageServicetype - The type name.
public void addMessageListener(IMessageListener listener)
addMessageListener in interface IMessageServicelistener - The change listener.public void removeMessageListener(IMessageListener listener)
removeMessageListener in interface IMessageServicelistener - The change listener.
protected void internalDeliverMessage(Map msg,
String type,
IComponentIdentifier[] receivers)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||