org.eclipse.jetty.osgi.equinoxtools.console
Class WebConsoleSession

java.lang.Object
  extended by org.eclipse.osgi.framework.console.ConsoleSession
      extended by org.eclipse.jetty.osgi.equinoxtools.console.WebConsoleSession
All Implemented Interfaces:
org.osgi.framework.ServiceFactory

public class WebConsoleSession
extends org.eclipse.osgi.framework.console.ConsoleSession

A simple console session for equinox.

Author:
hmalphettes

Constructor Summary
WebConsoleSession()
           
 
Method Summary
 void addOnFlushListener(WebConsoleWriterOutputStream.OnFlushListener flushListener)
           
 void clearOutput()
           
protected  void doClose()
           
 InputStream getInput()
           
 List<WebConsoleWriterOutputStream.OnFlushListener> getOnFlushListeners()
           
 OutputStream getOutput()
           
 StringWriter getOutputAsWriter()
          For the output we are using a string writer in fact.
 PrintStream getSource()
           
 void issueCommand(String cmd)
          Issue a command on the console.
 void processCommand(String cmd, boolean wait)
          Process command comming from a web UI
 boolean removeOnFlushListener(WebConsoleWriterOutputStream.OnFlushListener flushListener)
           
 
Methods inherited from class org.eclipse.osgi.framework.console.ConsoleSession
close, getService, ungetService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebConsoleSession

public WebConsoleSession()
Method Detail

doClose

protected void doClose()
Specified by:
doClose in class org.eclipse.osgi.framework.console.ConsoleSession

getInput

public InputStream getInput()
Specified by:
getInput in class org.eclipse.osgi.framework.console.ConsoleSession

getOutput

public OutputStream getOutput()
Specified by:
getOutput in class org.eclipse.osgi.framework.console.ConsoleSession

getOutputAsWriter

public StringWriter getOutputAsWriter()
For the output we are using a string writer in fact.

Returns:

getSource

public PrintStream getSource()
Returns:
The print stream where commands can be written.

issueCommand

public void issueCommand(String cmd)
Issue a command on the console.

Parameters:
cmd -

addOnFlushListener

public void addOnFlushListener(WebConsoleWriterOutputStream.OnFlushListener flushListener)
Parameters:
flushListener - Object that is called back when the outputstream is flushed.

removeOnFlushListener

public boolean removeOnFlushListener(WebConsoleWriterOutputStream.OnFlushListener flushListener)
Parameters:
flushListener - Object that is called back when the outputstream is flushed.

processCommand

public void processCommand(String cmd,
                           boolean wait)
Process command comming from a web UI

Parameters:
cmd -

clearOutput

public void clearOutput()

getOnFlushListeners

public List<WebConsoleWriterOutputStream.OnFlushListener> getOnFlushListeners()


Copyright © 1995-2011 Mort Bay Consulting. All Rights Reserved.