org.keridwen.core.messaging.internal
Class SequenceScheme<U,V>

java.lang.Object
  extended by org.keridwen.core.messaging.internal.SequenceScheme<U,V>
Type Parameters:
U - type of the value returned by the last Command of the list.
V - type of the message the first Command of the list can handle.
All Implemented Interfaces:
Scheme<U,V>

public class SequenceScheme<U,V>
extends Object
implements Scheme<U,V>

A sequential scheme is a scheme that executes a series of Command sequentially (i.e. in the same thread).


Constructor Summary
SequenceScheme()
          Default constructor.
 
Method Summary
 U execute(V message)
          Executes the given list of Commands with the given Event.
 List<Command<U,V>> getCommandsList()
          Gets the list of Commands managed by the scheme.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SequenceScheme

public SequenceScheme()
Default constructor.

Method Detail

execute

public final U execute(V message)
                throws CommandException
Description copied from interface: Scheme
Executes the given list of Commands with the given Event.

Specified by:
execute in interface Scheme<U,V>
Parameters:
message - the message to handle
Returns:
the value returned by the last command in the list
Throws:
CommandException

getCommandsList

public final List<Command<U,V>> getCommandsList()
Description copied from interface: Scheme
Gets the list of Commands managed by the scheme.

Specified by:
getCommandsList in interface Scheme<U,V>
Returns:
the commands list


Copyright © 2010-2013 Artenum. All Rights Reserved.