Class MessageQueueAgent
- java.lang.Object
- 
- jadex.micro.examples.messagequeue.MessageQueueAgent
 
- 
- All Implemented Interfaces:
- IMessageQueueService
 
 public class MessageQueueAgent extends java.lang.Object implements IMessageQueueService This agent represents the central message queue. It offers a message queue service that is used by the clients.
- 
- 
Field SummaryFields Modifier and Type Field Description protected IInternalAccessagentThe agent.protected java.util.Map<java.lang.String,java.util.List<SubscriptionIntermediateFuture<Event>>>subscribersThe map of subscribers.
 - 
Constructor SummaryConstructors Constructor Description MessageQueueAgent()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidagentCreated()Called on agent creation.IFuture<java.lang.Void>publish(java.lang.String topic, Event event)Publish a new event to the queue.ISubscriptionIntermediateFuture<Event>subscribe(java.lang.String topic)Subscribe to a specific topic.
 
- 
- 
- 
Field Detail- 
agentprotected IInternalAccess agent The agent.
 - 
subscribersprotected java.util.Map<java.lang.String,java.util.List<SubscriptionIntermediateFuture<Event>>> subscribers The map of subscribers.
 
- 
 - 
Method Detail- 
agentCreatedpublic void agentCreated() Called on agent creation.
 - 
subscribepublic ISubscriptionIntermediateFuture<Event> subscribe(java.lang.String topic) Subscribe to a specific topic. New events that fit to the topic are forwarded to all subscribers as intermediate results. A subscribe can unsubscribe by terminating the future.- Specified by:
- subscribein interface- IMessageQueueService
- Parameters:
- topic- The topic.
- Returns:
- The events.
 
 - 
publishpublic IFuture<java.lang.Void> publish(java.lang.String topic, Event event) Publish a new event to the queue.- Specified by:
- publishin interface- IMessageQueueService
- Parameters:
- topic- The topic.
- event- The event to publish.
 
 
- 
 
-