public abstract class AbstractPipe<C,P,CONS extends CommandContext<? super P>> extends Object implements Consumer<C>, Producer<P,CONS>, CommandContext<C>
| Modifier and Type | Field and Description |
|---|---|
protected CONS |
consumer
.
|
protected boolean |
piped
.
|
| Constructor and Description |
|---|
AbstractPipe(boolean piped) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the producer.
|
void |
flush() |
Map<String,Object> |
getAttributes()
Returns the current attributes.
|
int |
getHeight()
Returns the screen height in chars.
|
String |
getProperty(String propertyName)
Returns a generic property, usually this property is resolved by the
shell client.
|
Map<String,Object> |
getSession()
Returns the current session.
|
int |
getWidth()
Returns the screen width in chars.
|
boolean |
isPiped() |
void |
open(CONS consumer)
Open the producer with the specified consumer.
|
String |
readLine(String msg,
boolean echo)
Display a message and read a line on the console, this method call can be blocking until the user provides
a value.
|
boolean |
releaseAlternateBuffer()
Release control of the alternate buffer.
|
boolean |
takeAlternateBuffer()
Take control of the alternate buffer.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetProducedTypegetConsumedType, providewriteprotected final boolean piped
protected CONS extends CommandContext<? super P> consumer
public AbstractPipe(boolean piped)
public boolean isPiped()
isPiped in interface CommandContext<C>public boolean takeAlternateBuffer() throws IOException
InteractionContextFlushable.flush() method
is invoked.takeAlternateBuffer in interface InteractionContextIOExceptionpublic boolean releaseAlternateBuffer() throws IOException
InteractionContextFlushable.flush() method
is invoked.releaseAlternateBuffer in interface InteractionContextIOExceptionpublic String getProperty(String propertyName)
InteractionContextgetProperty in interface InteractionContextpropertyName - the property namepublic String readLine(String msg, boolean echo) throws IOException, InterruptedException
InteractionContextreadLine in interface InteractionContextmsg - the message to display before reading a lineecho - wether or not the line read should be echoed when typingIOException - any io exceptionInterruptedException - the thread was interrupted while waiting for the user valuepublic Map<String,Object> getSession()
RuntimeContextgetSession in interface RuntimeContextpublic Map<String,Object> getAttributes()
RuntimeContextgetAttributes in interface RuntimeContextpublic int getWidth()
ScreenContextgetWidth in interface ScreenContextpublic int getHeight()
ScreenContextgetHeight in interface ScreenContextpublic void open(CONS consumer)
Producerpublic void flush() throws IOException
flush in interface FlushableIOExceptionpublic void close() throws IOException
Producerclose in interface Closeableclose in interface AutoCloseableclose in interface Producer<P,CONS extends CommandContext<? super P>>IOException - any io exceptionCopyright © 2014 eXo Platform SAS. All Rights Reserved.