org.gcube.common.ghn.service.handlers
Class Pipeline<H extends ApplicationHandler<H>>

java.lang.Object
  extended by org.gcube.common.ghn.service.handlers.Pipeline<H>
Type Parameters:
H - the type of the handlers

public class Pipeline<H extends ApplicationHandler<H>>
extends Object

An ordered list ApplicationHandlers that handle related ApplicationEvents.

Author:
Fabio Simeoni

Constructor Summary
Pipeline(List<H> handlers)
          Creates an instance with a given list of handlers.
 
Method Summary
 void forward(ApplicationEvent<H> event)
          Forwards an event through the pipeline.
 List<H> handlers()
          Returns the handlers in this pipeline.
 Pipeline<H> reverse()
          Returns a pipeline with the same handlers as this pipeline, only in reverse order.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Pipeline

public Pipeline(List<H> handlers)
Creates an instance with a given list of handlers.

Modification to the input list do not affect the pipeline.

Parameters:
handlers - the handlers
Method Detail

handlers

public List<H> handlers()
Returns the handlers in this pipeline.

Modification to the input list do not affect the pipeline.

Returns:
the handlers

forward

public void forward(ApplicationEvent<H> event)
Forwards an event through the pipeline.

Parameters:
event - the event

reverse

public Pipeline<H> reverse()
Returns a pipeline with the same handlers as this pipeline, only in reverse order.

Returns:
the reversed pipeline


Copyright © 2013. All Rights Reserved.