com.buglabs.osgi.shell
Class ConsoleListener

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

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

Listens for user entry.

Author:
kgilmer

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, org.osgi.framework.BundleContext context, org.osgi.service.log.LogService log)
           
 
Method Summary
 java.lang.String execute(java.lang.String message)
          Execute a command.
 java.util.List getCommands()
           
 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,
                       org.osgi.framework.BundleContext context,
                       org.osgi.service.log.LogService log)
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

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.