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

java.lang.Object
  extended by org.crsh.command.Pipe<C,P>
Type Parameters:
C - the consumed generic type
P - the produced generic type
All Implemented Interfaces:
Consumer<C>, Filter<C,P,InvocationContext<P>>, Producer<P,InvocationContext<P>>

public abstract class Pipe<C,P>
extends Object
implements Filter<C,P,InvocationContext<P>>

A command pipe.


Field Summary
protected  InvocationContext<P> context
          .
 
Constructor Summary
Pipe()
           
 
Method Summary
 void close()
          Close pipe.
 void flush()
          Flush pipe.
 Class<C> getConsumedType()
          Returns the class of the element generic type.
 Class<P> getProducedType()
          Returns the class of the produced type.
 void open()
          Open pipe.
 void open(InvocationContext<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

context

protected InvocationContext<P> context
.

Constructor Detail

Pipe

public Pipe()
Method Detail

getProducedType

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

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

getConsumedType

public final 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(InvocationContext<P> consumer)
          throws Exception
Description copied from interface: Producer
Open the producer with the specified consumer.

Specified by:
open in interface Producer<P,InvocationContext<P>>
Parameters:
consumer - the consumer
Throws:
Exception - any exception

open

public void open()
          throws Exception
Open pipe.

Throws:
Exception

provide

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

Specified by:
provide in interface Consumer<C>
Parameters:
element - the provided element
Throws:
Exception - any exception

flush

public void flush()
           throws IOException
Flush pipe.

Specified by:
flush in interface Consumer<C>
Throws:
IOException - any io exception

close

public void close()
           throws Exception
Close pipe.

Specified by:
close in interface Producer<P,InvocationContext<P>>
Throws:
Exception - any exception


Copyright © 2015 eXo Platform SAS. All Rights Reserved.