jaugment2.UI.textUI
Class SimpleTextUIRepresentable

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteServer
              |
              +--java.rmi.server.UnicastRemoteObject
                    |
                    +--jaugment2.UI.textUI.SimpleTextUIRepresentable
Direct Known Subclasses:
MediaPlayerTextRepresentation, PasswordServiceTextRepresentation, SemiNaturalVoiceProcessorTextRepresentation, SSHServiceTextRepresentation, TextUI.ProcessAdaptor, TextUIHelloWorldEntry

public class SimpleTextUIRepresentable
extends java.rmi.server.UnicastRemoteObject
implements TextUIRepresentable, SemiNaturalInputProcessing.Answerable

This class shall simplify the Developement of a TextUIRepresentable. You provide it with an implementation of SimpleTextUIRepresentable.Proc, so it knows where to store stdin-data and it takes care of all the rest like handling leases and registrations. One implementatio of Proc is already proviced named SimpleProcessProc. It gets a process and handles the stdin/stderr/stdout of that one.

See Also:
Serialized Form

Inner Class Summary
private static class SimpleTextUIRepresentable.outputListenerEntry
          class for entries in outputListeners.
static interface SimpleTextUIRepresentable.Proc
           
static class SimpleTextUIRepresentable.SimpleProcessProc
          An implementation for Proc encapsuling a native shell-process
 
Inner classes inherited from class jaugment2.UI.textUI.TextUIRepresentable
TextUIRepresentable.TextUIFactory, TextUIRepresentable.TextUIRepresentableRemoteEvent
 
Field Summary
private  SimpleLandlord landlord
           
private  SimpleLandlord.LeaseListener myLeaseListener
           
private  java.util.LinkedList outputListeners
           
 SimpleTextUIRepresentable.Proc proc
           
 
Fields inherited from class java.rmi.server.UnicastRemoteObject
csf, port, portFactoryParamTypes, portParamTypes, serialVersionUID, ssf
 
Fields inherited from class java.rmi.server.RemoteServer
log, logname, serialVersionUID
 
Fields inherited from class java.rmi.server.RemoteObject
ref, serialVersionUID
 
Constructor Summary
SimpleTextUIRepresentable(SimpleTextUIRepresentable.Proc p)
           
 
Method Summary
 net.jini.core.lease.Lease addOutputListener(net.jini.core.event.RemoteEventListener listener, java.rmi.MarshalledObject handback, long requestedDuration)
           
 void ErroutputMe(java.lang.String out)
           
 void ErroutputMe(java.lang.StringBuffer out)
           
 void input(java.lang.StringBuffer indata)
           
 void outputMe(java.lang.String out)
           
 void outputMe(java.lang.StringBuffer out)
           
 void setProc(SimpleTextUIRepresentable.Proc p)
           
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
, clone, exportObject, exportObject, exportObject, exportObject, readObject, reexport, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub, writeObject
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

landlord

private SimpleLandlord landlord

outputListeners

private java.util.LinkedList outputListeners

myLeaseListener

private SimpleLandlord.LeaseListener myLeaseListener

proc

public SimpleTextUIRepresentable.Proc proc
Constructor Detail

SimpleTextUIRepresentable

public SimpleTextUIRepresentable(SimpleTextUIRepresentable.Proc p)
                          throws java.rmi.RemoteException
Method Detail

outputMe

public void outputMe(java.lang.String out)
              throws java.rmi.RemoteException
Specified by:
outputMe in interface SemiNaturalInputProcessing.Answerable

outputMe

public void outputMe(java.lang.StringBuffer out)
              throws java.rmi.RemoteException
Specified by:
outputMe in interface SemiNaturalInputProcessing.Answerable

ErroutputMe

public void ErroutputMe(java.lang.String out)
                 throws java.rmi.RemoteException
Specified by:
ErroutputMe in interface SemiNaturalInputProcessing.Answerable

ErroutputMe

public void ErroutputMe(java.lang.StringBuffer out)
                 throws java.rmi.RemoteException
Specified by:
ErroutputMe in interface SemiNaturalInputProcessing.Answerable

setProc

public void setProc(SimpleTextUIRepresentable.Proc p)

input

public void input(java.lang.StringBuffer indata)
           throws java.rmi.RemoteException
Specified by:
input in interface TextUIRepresentable

addOutputListener

public net.jini.core.lease.Lease addOutputListener(net.jini.core.event.RemoteEventListener listener,
                                                   java.rmi.MarshalledObject handback,
                                                   long requestedDuration)
                                            throws java.rmi.RemoteException,
                                                   net.jini.core.lease.LeaseDeniedException
Specified by:
addOutputListener in interface TextUIRepresentable