org.crsh.command
Class Pipe<C,P>
java.lang.Object
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.
Constructor Summary |
Pipe()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
context
protected InvocationContext<P> context
-
.
Pipe
public Pipe()
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.