stella.rmi
Class RmiSystemOutListener

java.lang.Object
  extended by stella.rmi.RmiSystemOutListener
All Implemented Interfaces:
Remote, EventListener, RmiDataListener, RmiEventListener, RmiListener

public class RmiSystemOutListener
extends Object
implements RmiDataListener

A very easy implementation of a RmiDataListener that can run on a different host than the data source. Any error event this listener receives is stripped from its machine sense and the remaining human-readable part of the error event is piped to System.err.

Note that any RMI process requires on the server side that the rmi-registry is up and running.

See Also:
DataEvent, RmiDataListener

Field Summary
private static int EXPORTPORT
          The port where we want to export.
 
Constructor Summary
RmiSystemOutListener()
          Constructs a new system out listener that listens to a remote process.
 
Method Summary
 void disconnect(RmiCaster name)
          Disconnects the listener.
 InetAddress getIP()
          Gets the local host IP-address.
 String getListenerName()
          Returns the name of this stream.
 boolean isConnected()
          Returns true.
static void main(String[] arg)
          Test purpose only.
 void rebind(RmiCaster name, long timeout)
          Rebinds the listener.
 void rmiDataAvailable(DataEvent de)
          Processes the data event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXPORTPORT

private static final int EXPORTPORT
The port where we want to export.

See Also:
Constant Field Values
Constructor Detail

RmiSystemOutListener

public RmiSystemOutListener()
                     throws RemoteException
Constructs a new system out listener that listens to a remote process.

Throws:
RemoteException
Method Detail

rmiDataAvailable

public void rmiDataAvailable(DataEvent de)
                      throws RemoteException
Processes the data event. Takes the string-version of the DataEvent and outputs it through System.out.

Specified by:
rmiDataAvailable in interface RmiDataListener
Parameters:
de - The data event describing the data occured.
Throws:
RemoteException

getIP

public InetAddress getIP()
                  throws RemoteException
Gets the local host IP-address.

Throws:
RemoteException

isConnected

public boolean isConnected()
                    throws RemoteException
Returns true.

Specified by:
isConnected in interface RmiListener
Throws:
RemoteException

rebind

public void rebind(RmiCaster name,
                   long timeout)
            throws RemoteException
Rebinds the listener. Not implemented.

Throws:
RemoteException

disconnect

public void disconnect(RmiCaster name)
                throws RemoteException
Disconnects the listener. Not implemented.

Specified by:
disconnect in interface RmiListener
Throws:
RemoteException

getListenerName

public String getListenerName()
                       throws RemoteException
Returns the name of this stream.

Specified by:
getListenerName in interface RmiEventListener
Throws:
RemoteException

main

public static void main(String[] arg)
                 throws Exception
Test purpose only.

Throws:
Exception