com.buglabs.osgi.shell.internal
Class ConsoleListener

java.lang.Object
  extended by java.lang.Thread
      extended by com.buglabs.osgi.shell.internal.ConsoleListener
All Implemented Interfaces:
IShellCommandProvider, IShellCommandExecutor, java.lang.Runnable, java.util.EventListener, LogListener

public class ConsoleListener
extends java.lang.Thread
implements IShellCommandProvider, IShellCommandExecutor, LogListener

Listens for user entry.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ConsoleListener(java.io.InputStream in, java.io.OutputStream out, java.io.OutputStream err, CommandParser parser, BundleContext context, LogService log, boolean listen)
           
 
Method Summary
 java.lang.String execute(java.lang.String message)
          Execute a command.
 java.util.List getCommands()
           
 void logged(LogEntry entry)
           
 void run()
           
 void unregisterServices()
          Unregister shell services.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConsoleListener

public ConsoleListener(java.io.InputStream in,
                       java.io.OutputStream out,
                       java.io.OutputStream err,
                       CommandParser parser,
                       BundleContext context,
                       LogService log,
                       boolean listen)
Method Detail

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

getCommands

public java.util.List getCommands()
Specified by:
getCommands in interface IShellCommandProvider
Returns:
A list of type ICommand objects.

execute

public java.lang.String execute(java.lang.String message)
                         throws java.lang.Exception
Description copied from interface: IShellCommandExecutor
Execute a command.

Specified by:
execute in interface IShellCommandExecutor
Parameters:
message - Command and parameters
Returns:
Output from command
Throws:
java.lang.Exception

unregisterServices

public void unregisterServices()
Unregister shell services.


logged

public void logged(LogEntry entry)
Specified by:
logged in interface LogListener