|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectguarana.util.observer.smart.SmartObservable
guarana.framework.task.Slot
public class Slot
An in memory buffer used to decouple and transfer messages between tasks.
Graphical notation:
Constructor Summary | |
---|---|
Slot()
Constructs a new slot. |
|
Slot(String name)
Constructs a new slot with a given name. |
Method Summary | |
---|---|
void |
addMessage(Message<?> message)
Adds a message to this slot. |
int |
countMessages()
Returns the number of messages currently stored in this slot. |
Gateway |
getInputGateway()
Returns the related input gateway which will consume messages from this slot. |
String |
getName()
Returns the name of this source. |
Message<?> |
getNextMessage()
Retrieves and removes a message from this slot. |
Gateway |
getOutputGateway()
Returns the related output gateway which will produce messages to this slot. |
void |
setInputGateway(Gateway inputGateway)
Sets the related input gateway which will consume messages from this slot. |
void |
setName(String name)
Sets the name of this source. |
void |
setOutputGateway(Gateway outputGateway)
Sets the related output gateway which will produce messages to this slot. |
Methods inherited from class guarana.util.observer.smart.SmartObservable |
---|
addSmartObserver, containsSmartObserver, containsSmartObserver, countSmartObservers, deleteSmartObserver, deleteSmartObservers, hasChanged, notifySmartObservers, notifySmartObservers |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Slot()
public Slot(String name)
name
- The name of this slot.Method Detail |
---|
public void addMessage(Message<?> message) throws InvalidParameterException
message
- The message to be added.
InvalidParameterException
- if the message parameter is null
.public Message<?> getNextMessage()
null
if there is no message.public int countMessages()
public void setName(String name)
setName
in interface ISource
name
- The name of this source.public String getName()
getName
in interface ISource
public Gateway getInputGateway()
public void setInputGateway(Gateway inputGateway)
inputGateway
- The related input gatewaypublic Gateway getOutputGateway()
public void setOutputGateway(Gateway outputGateway)
outputGateway
- The related output gateway.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |