akka.io
Class PipelineFactory

java.lang.Object
  extended by akka.io.PipelineFactory

public class PipelineFactory
extends java.lang.Object

This class contains static factory methods which turn a pipeline context and a PipelineStage into readily usable pipelines.


Constructor Summary
PipelineFactory()
           
 
Method Summary
static
<Ctx extends PipelineContext,CmdAbove,CmdBelow,EvtAbove,EvtBelow>
PipelinePorts<CmdAbove,CmdBelow,EvtAbove,EvtBelow>
buildFunctionTriple(Ctx ctx, PipelineStage<Ctx,CmdAbove,CmdBelow,EvtAbove,EvtBelow> stage)
          Scala API: build the pipeline and return a pair of functions representing the command and event pipelines.
static
<Ctx extends PipelineContext,CmdAbove,CmdBelow,EvtAbove,EvtBelow>
PipelineInjector<CmdAbove,EvtBelow>
buildWithSink(Ctx ctx, PipelineStage<Ctx,CmdAbove,CmdBelow,EvtAbove,EvtBelow> stage, PipelineSink<CmdBelow,EvtAbove> callback)
          Java API: build the pipeline attaching the given callback object to its outputs.
static
<Ctx extends PipelineContext,CmdAbove,CmdBelow,EvtAbove,EvtBelow>
PipelineInjector<CmdAbove,EvtBelow>
buildWithSinkFunctions(Ctx ctx, PipelineStage<Ctx,CmdAbove,CmdBelow,EvtAbove,EvtBelow> stage, scala.Function1<scala.util.Try<CmdBelow>,scala.runtime.BoxedUnit> commandSink, scala.Function1<scala.util.Try<EvtAbove>,scala.runtime.BoxedUnit> eventSink)
          Scala API: build the pipeline attaching the given command and event sinks to its outputs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PipelineFactory

public PipelineFactory()
Method Detail

buildFunctionTriple

public static <Ctx extends PipelineContext,CmdAbove,CmdBelow,EvtAbove,EvtBelow> PipelinePorts<CmdAbove,CmdBelow,EvtAbove,EvtBelow> buildFunctionTriple(Ctx ctx,
                                                                                                                                                       PipelineStage<Ctx,CmdAbove,CmdBelow,EvtAbove,EvtBelow> stage)
Scala API: build the pipeline and return a pair of functions representing the command and event pipelines. Each function returns the commands and events resulting from running the pipeline on the given input, where the the sequence of events is the first element of the returned pair and the sequence of commands the second element.

Exceptions thrown by the pipeline stages will not be caught.

Parameters:
ctx - The context object for this pipeline
stage - The (composite) pipeline stage from whcih to build the pipeline
Returns:
a pair of command and event pipeline functions

buildWithSinkFunctions

public static <Ctx extends PipelineContext,CmdAbove,CmdBelow,EvtAbove,EvtBelow> PipelineInjector<CmdAbove,EvtBelow> buildWithSinkFunctions(Ctx ctx,
                                                                                                                                           PipelineStage<Ctx,CmdAbove,CmdBelow,EvtAbove,EvtBelow> stage,
                                                                                                                                           scala.Function1<scala.util.Try<CmdBelow>,scala.runtime.BoxedUnit> commandSink,
                                                                                                                                           scala.Function1<scala.util.Try<EvtAbove>,scala.runtime.BoxedUnit> eventSink)
Scala API: build the pipeline attaching the given command and event sinks to its outputs. Exceptions thrown within the pipeline stages will abort processing (i.e. will not be processed in following stages) but will be caught and passed as Failure into the respective sink.

Exceptions thrown while processing management commands are not caught.

Parameters:
ctx - The context object for this pipeline
stage - The (composite) pipeline stage from whcih to build the pipeline
commandSink - The function to invoke for commands or command failures
eventSink - The function to invoke for events or event failures
Returns:
a handle for injecting events or commands into the pipeline

buildWithSink

public static <Ctx extends PipelineContext,CmdAbove,CmdBelow,EvtAbove,EvtBelow> PipelineInjector<CmdAbove,EvtBelow> buildWithSink(Ctx ctx,
                                                                                                                                  PipelineStage<Ctx,CmdAbove,CmdBelow,EvtAbove,EvtBelow> stage,
                                                                                                                                  PipelineSink<CmdBelow,EvtAbove> callback)
Java API: build the pipeline attaching the given callback object to its outputs. Exceptions thrown within the pipeline stages will abort processing (i.e. will not be processed in following stages) but will be caught and passed as Failure into the respective sink.

Exceptions thrown while processing management commands are not caught.

Parameters:
ctx - The context object for this pipeline
stage - The (composite) pipeline stage from whcih to build the pipeline
callback - The PipelineSink to attach to the built pipeline
Returns:
a handle for injecting events or commands into the pipeline