com.mucommander.process
Class ProcessListenerList

java.lang.Object
  extended by com.mucommander.process.ProcessListenerList
All Implemented Interfaces:
ProcessListener

public class ProcessListenerList
extends java.lang.Object
implements ProcessListener

Convenience class used to have more than one listener on any given process.

Author:
Nicolas Rinaudo

Constructor Summary
ProcessListenerList()
          Creates a new process listener list.
 
Method Summary
 void add(ProcessListener listener)
          Adds the specified listener to the list of listeners.
 void processDied(int returnValue)
          Propagates the process died event to all registered listeners.
 void processOutput(byte[] buffer, int offset, int length)
          Propagates the process output event to all registered listeners.
 void processOutput(java.lang.String output)
          Propagates the process output event to all registered listeners.
 void remove(ProcessListener listener)
          Removes the specified listener from the list of listeners.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProcessListenerList

public ProcessListenerList()
Creates a new process listener list.

Method Detail

add

public void add(ProcessListener listener)
Adds the specified listener to the list of listeners.

Parameters:
listener - process listener to add.

remove

public void remove(ProcessListener listener)
Removes the specified listener from the list of listeners.

Parameters:
listener - process listener to remove.

processDied

public void processDied(int returnValue)
Propagates the process died event to all registered listeners.

Specified by:
processDied in interface ProcessListener
Parameters:
returnValue - the value returned by the process (return code).

processOutput

public void processOutput(byte[] buffer,
                          int offset,
                          int length)
Propagates the process output event to all registered listeners.

Specified by:
processOutput in interface ProcessListener
Parameters:
buffer - contains the process' output.
offset - offset in buffer at which the process' output starts.
length - length of the process' output in buffer.

processOutput

public void processOutput(java.lang.String output)
Propagates the process output event to all registered listeners.

Specified by:
processOutput in interface ProcessListener
Parameters:
output - contains the encoded process output.


This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard