guarana.framework.message
Class Exchange

java.lang.Object
  extended by guarana.framework.message.Exchange

public class Exchange
extends Object

Holds inbound and outbound messages of a task. This object is passed as a parameter in the Task.doWork() method.

Since:
Guaranį SDK 1.2.0
Author:
Rafael Z. Frantz

Field Summary
 LinkedList<Message<?>>[] input
          The input of the task.
 LinkedList<Message<?>>[] output
          The output of the task.
 
Constructor Summary
Exchange(int numberOfInputs, int numberOfOutputs)
          Constructs a new exchange with a given number of input and output.
 
Method Summary
 boolean hasAnyOutboundMessages()
          Checks if this exchange has any output messages to be written to the output gateways of the task.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

input

public LinkedList<Message<?>>[] input
The input of the task. To get and remove a message from the first input use: input[0].poll().


output

public LinkedList<Message<?>>[] output
The output of the task. To add a message to the first output use: output[0].add(Message).

Constructor Detail

Exchange

public Exchange(int numberOfInputs,
                int numberOfOutputs)
Constructs a new exchange with a given number of input and output.

Parameters:
numberOfInputs - The number of input.
numberOfOutputs - The number of output.
Method Detail

hasAnyOutboundMessages

public boolean hasAnyOutboundMessages()
Checks if this exchange has any output messages to be written to the output gateways of the task.

Returns:
True if there is any output message; otherwise, False.


Guaranį DSL Home