console output writer?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

console output writer?

Karl Wettin
In my Java application I have:

  class App {
     void run() {
         while (...) {
           for (Listener listener : listeners) {
      List<Listener> listeners;

  class Listener {
     private Writer writer;

    Listener(Writer writer) {
       this.writer = writer;

    void report(String report) throws IOException {

I would like to telnet in and from from bsh:

   bsh % l = new Listener(console);
   bsh % app.listeners.add(l);

and now have evertying reported sent to my telnet console output. In  
order to make it stop I would have to

   bsh % app.listeners.remove(l);

How can I do this?

It is quite alright if it all get mixed up from listeners writing at  
the same time as I send commands, but if one can turn off echo and  
prompt, that would be great too.


This email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
Beanshell-users mailing list
[hidden email]