com.ldodds.slug.framework
Class DelegatingConsumerImpl

java.lang.Object
  extended bycom.ldodds.slug.framework.config.ComponentImpl
      extended bycom.ldodds.slug.framework.DelegatingConsumerImpl
All Implemented Interfaces:
Component, Consumer, MemoryHolder

public class DelegatingConsumerImpl
extends ComponentImpl
implements Consumer

Implementation of the Consumer interface that supports delegating processing of work item results to a List of Consumers.

Useful when multiple actions should be taken when a particular work item is completed.

Author:
ldodds

Field Summary
 
Fields inherited from class com.ldodds.slug.framework.config.ComponentImpl
_configured
 
Constructor Summary
DelegatingConsumerImpl()
           
DelegatingConsumerImpl(java.util.List consumers)
           
 
Method Summary
 void addConsumer(Consumer consumer)
           
 void consume(Task workItem, java.lang.Object results)
           
 void setController(Controller controller)
           
 void setMemory(Memory memory)
           
 
Methods inherited from class com.ldodds.slug.framework.config.ComponentImpl
configure, doConfig, isConfigured
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ldodds.slug.framework.config.Component
configure, isConfigured
 

Constructor Detail

DelegatingConsumerImpl

public DelegatingConsumerImpl()

DelegatingConsumerImpl

public DelegatingConsumerImpl(java.util.List consumers)
Method Detail

consume

public void consume(Task workItem,
                    java.lang.Object results)
Specified by:
consume in interface Consumer

addConsumer

public void addConsumer(Consumer consumer)

setController

public void setController(Controller controller)
Specified by:
setController in interface Consumer

setMemory

public void setMemory(Memory memory)
Specified by:
setMemory in interface MemoryHolder