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>, Pipe<C>, Producer<P>, ProducerConsumer<C,P>

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


Field Summary
private  CommandInvoker<C,P> delegate
          .
private  ProducerContext<P> innerContext
          .
private  Pipe<C> next
          .
 
Constructor Summary
PipeCommandProxy(ProducerContext<P> innerContext, CommandInvoker<C,P> delegate, Pipe<C> next)
           
 
Method Summary
 void close()
          Close the producer.
(package private)  void fire()
           
 void flush()
           
 Class<C> getConsumedType()
          Returns the class of the consumed type.
 Class<P> getProducedType()
          Returns the class of the produced type.
 void open(ProducerContext<P> context)
          Open the producer with the specified context.
 void provide(C element)
          Provide an element.
 void setPiped(boolean piped)
          Set the pipe status.
 void setSession(CommandContext session)
          Associate the command invoker with a session, the association should be done before the command is invoked.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

innerContext

private final ProducerContext<P> innerContext
.


delegate

private final CommandInvoker<C,P> delegate
.


next

private final Pipe<C> next
.

Constructor Detail

PipeCommandProxy

PipeCommandProxy(ProducerContext<P> innerContext,
                 CommandInvoker<C,P> delegate,
                 Pipe<C> next)
Method Detail

fire

void fire()

setSession

public void setSession(CommandContext session)
Description copied from interface: CommandInvoker
Associate the command invoker with a session, the association should be done before the command is invoked.

Specified by:
setSession in interface CommandInvoker<C,P>
Parameters:
session - the session

getProducedType

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

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

getConsumedType

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

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

setPiped

public void setPiped(boolean piped)
Description copied from interface: Producer
Set the pipe status.

Specified by:
setPiped in interface Producer<P>
Parameters:
piped - the piped status

open

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

Specified by:
open in interface Producer<P>
Parameters:
context - the context

provide

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

Specified by:
provide in interface Pipe<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
Description copied from interface: Producer
Close the producer.

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


Copyright © 2013 eXo Platform SAS. All Rights Reserved.