outputStrategy
Class OutputStrategyController

java.lang.Object
  extended by outputStrategy.OutputStrategyController
All Implemented Interfaces:
OutputStrategyInterface

public class OutputStrategyController
extends java.lang.Object
implements OutputStrategyInterface

Controller class of component OutputStrategy.

Collects messages until an output criterion is fulfilled (certain number of messages collected or timeout reached).

Messages are added by component MessageProcessor. When the output criterion is fulfilled, the collected messages are bypassed to the InputOutputHandler (component), which sends them to their destination.

Author:
Karl-Peter Fuchs

Constructor Summary
OutputStrategyController()
          Generates a new OutputStrategy component, which collects messages until an output criterion is fulfilled (certain number of messages collected or timeout reached).
 
Method Summary
 void addReply(Reply reply)
          Can be used to add a Reply, that shall be put out according to the underlying output strategy.
 void addRequest(Request request)
          Can be used to add a Request, that shall be put out according to the underlying output strategy.
 void initialize(InputOutputHandlerController inputOutputHandler)
          Initialization method for this component.
 void setBatchSize(int newSize)
          Number of messages the upcoming batch will contain (according to the OutputStrategy component on this mix' predecessor).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OutputStrategyController

public OutputStrategyController()
Generates a new OutputStrategy component, which collects messages until an output criterion is fulfilled (certain number of messages collected or timeout reached).

Messages are added by component MessageProcessor. When the output criterion is fulfilled, the collected messages are bypassed to the InputOutputHandler (component), which sends them to their destination.

Can handle Requests and Replies in parallel.

Component can't be used before calling initialize(InputOutputHandlerController).

See Also:
initialize(InputOutputHandlerController)
Method Detail

initialize

public void initialize(InputOutputHandlerController inputOutputHandler)
Initialization method for this component. Makes this component ready for accepting messages.

Parameters:
inputOutputHandler - Reference on component InputOutputHandler (used to send messages after output).

addRequest

public void addRequest(Request request)
Can be used to add a Request, that shall be put out according to the underlying output strategy.

Return immediately (asynchronous behavior), internal output decision is deferred.

Specified by:
addRequest in interface OutputStrategyInterface
Parameters:
request - Request, that shall be put out according to the underlying output strategy.

addReply

public void addReply(Reply reply)
Can be used to add a Reply, that shall be put out according to the underlying output strategy.

Returns immediately (asynchronous behavior), internal output decision is deferred.

Specified by:
addReply in interface OutputStrategyInterface
Parameters:
reply - Reply, that shall be put out according to the underlying output strategy.

setBatchSize

public void setBatchSize(int newSize)
Number of messages the upcoming batch will contain (according to the OutputStrategy component on this mix' predecessor).

Used for batch synchronization.

See Also:
BatchSizeMessage