org.crsh.command
Class PipeCommandProxy<C,P>

java.lang.Object
  extended by org.crsh.command.PipeCommandProxy<C,P>
All Implemented Interfaces:
Closeable, Flushable, CommandInvoker<C,P>, Consumer<C>, Filter<C,P,CommandContext<P>>, Producer<P,CommandContext<P>>

 class PipeCommandProxy<C,P>
extends Object
implements CommandInvoker<C,P>


Field Summary
private  CommandInvoker<C,P> delegate
          .
private  CommandContext<P> innerContext
          .
private  Consumer<C> next
          .
 
Constructor Summary
PipeCommandProxy(CommandContext<P> innerContext, CommandInvoker<C,P> delegate, Consumer<C> next)
           
 
Method Summary
 void close()
          Close the producer.
(package private)  void fire()
           
 void flush()
           
 Class<C> getConsumedType()
          Returns the class of the element generic type.
 Class<P> getProducedType()
          Returns the class of the produced type.
 void open(CommandContext<P> consumer)
          Open the producer with the specified consumer.
 void provide(C element)
          Provide an element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

innerContext

private final CommandContext<P> innerContext
.


delegate

private final CommandInvoker<C,P> delegate
.


next

private final Consumer<C> next
.

Constructor Detail

PipeCommandProxy

PipeCommandProxy(CommandContext<P> innerContext,
                 CommandInvoker<C,P> delegate,
                 Consumer<C> next)
Method Detail

fire

void fire()

getProducedType

public Class<P> getProducedType()
Description copied from interface: Producer
Returns the class of the produced type.

Specified by:
getProducedType in interface Producer<P,CommandContext<P>>
Returns:
the produced type

getConsumedType

public Class<C> getConsumedType()
Description copied from interface: Consumer
Returns the class of the element generic type.

Specified by:
getConsumedType in interface Consumer<C>
Returns:
the consumed type

open

public void open(CommandContext<P> consumer)
Description copied from interface: Producer
Open the producer with the specified consumer.

Specified by:
open in interface Producer<P,CommandContext<P>>
Parameters:
consumer - the consumer

provide

public void provide(C element)
             throws ScriptException,
                    IOException
Description copied from interface: Consumer
Provide an element.

Specified by:
provide in interface Consumer<C>
Parameters:
element - the provided element
Throws:
ScriptException
IOException

flush

public void flush()
           throws ScriptException,
                  IOException
Specified by:
flush in interface Flushable
Throws:
ScriptException
IOException

close

public void close()
           throws ScriptException,
                  IOException
Description copied from interface: Producer
Close the producer.

Specified by:
close in interface Closeable
Specified by:
close in interface Producer<P,CommandContext<P>>
Throws:
ScriptException
IOException


Copyright © 2014 eXo Platform SAS. All Rights Reserved.