org.crsh.term.processor
Class Processor

java.lang.Object
  extended by org.crsh.term.processor.Processor
All Implemented Interfaces:
Runnable

public final class Processor
extends Object
implements Runnable

Author:
Julien Viet

Field Summary
(package private)  Runnable CLOSE
          .
(package private)  ProcessContext current
          .
private  List<Closeable> listeners
          .
(package private)  Object lock
          .
(package private)  org.slf4j.Logger log
          .
(package private) static Runnable NOOP
          .
(package private)  LinkedList<TermEvent> queue
          .
private  Runnable READ_TERM
          .
private  boolean reading
           
(package private)  Shell shell
          .
(package private)  Status status
          .
(package private)  Term term
          .
private  Object termLock
          .
(package private)  boolean waitingEvent
          A flag useful for unit testing to know when the thread is reading.
(package private)  Runnable WRITE_PROMPT
          .
 
Constructor Summary
Processor(Term term, Shell shell)
           
 
Method Summary
 void addListener(Closeable listener)
           
(package private)  void close()
           
private  void complete(CharSequence prefix)
           
 boolean isWaitingEvent()
           
(package private)  boolean iterate()
           
(package private)  ProcessContext peekProcess()
           
(package private)  void readTerm()
           
 void run()
           
(package private)  void write(String text)
           
(package private)  void writePrompt()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NOOP

static final Runnable NOOP
.


WRITE_PROMPT

final Runnable WRITE_PROMPT
.


CLOSE

final Runnable CLOSE
.


READ_TERM

private final Runnable READ_TERM
.


log

final org.slf4j.Logger log
.


term

final Term term
.


shell

final Shell shell
.


queue

final LinkedList<TermEvent> queue
.


lock

final Object lock
.


current

ProcessContext current
.


status

Status status
.


waitingEvent

volatile boolean waitingEvent
A flag useful for unit testing to know when the thread is reading.


listeners

private final List<Closeable> listeners
.


termLock

private final Object termLock
.


reading

private boolean reading
Constructor Detail

Processor

public Processor(Term term,
                 Shell shell)
Method Detail

isWaitingEvent

public boolean isWaitingEvent()

run

public void run()
Specified by:
run in interface Runnable

iterate

boolean iterate()
          throws InterruptedException,
                 IOException
Throws:
InterruptedException
IOException

peekProcess

ProcessContext peekProcess()

readTerm

void readTerm()

close

void close()

addListener

public void addListener(Closeable listener)

write

void write(String text)

writePrompt

void writePrompt()

complete

private void complete(CharSequence prefix)


Copyright © 2012 eXo Platform SAS. All Rights Reserved.