x10.net
Class ServerDispatchProxy

java.lang.Object
  extended byjava.lang.Thread
      extended byx10.net.ServerDispatchProxy
All Implemented Interfaces:
java.lang.Runnable, UnitListener

public class ServerDispatchProxy
extends java.lang.Thread
implements UnitListener

ServerDispatchProxy is the server-side proxy which dispatches events to and recieves commands from the SocketController assigned to this object. A new ServerDispatchProxy is constructed for each SocketController that connects to a ControllerServer.


Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ServerDispatchProxy(java.net.Socket s, Controller c)
          ServerDispatchProxy constructs a new ServerDispatchProxy for the specified Controller to the SocketController on the other end of the specified Socket.
 
Method Summary
 void allLightsOff(UnitEvent event)
          allLightsOff recieves the UnitListener event to be dispatched to the SocketController
 void allLightsOn(UnitEvent event)
          allLightsOn recieves the UnitListener event to be dispatched to the SocketController
 void allUnitsOff(UnitEvent event)
          allUnitsOff recieves the UnitListener event to be dispatched to the SocketController
 void run()
          run reads Commands from the SocketController and propogates them along to the local Controller object.
 void unitBright(UnitEvent event)
          unitBright recieves the UnitListener event to be dispatched to the SocketController
 void unitDim(UnitEvent event)
          unitDim recieves the UnitListener event to be dispatched to the SocketController
 void unitOff(UnitEvent event)
          unitOff recieves the UnitListener event to be dispatched to the SocketController
 void unitOn(UnitEvent event)
          unitOn recieves the UnitListener event to be dispatched to the SocketController
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ServerDispatchProxy

public ServerDispatchProxy(java.net.Socket s,
                           Controller c)
                    throws java.io.IOException
ServerDispatchProxy constructs a new ServerDispatchProxy for the specified Controller to the SocketController on the other end of the specified Socket.

Parameters:
s - the Socket to the connected SocketController
c - the Controller that is being shared across the network with the SocketController.
Throws:
java.io.IOException - if an error occurs obtaining streams to/from the connected SocketController.
Method Detail

run

public void run()
run reads Commands from the SocketController and propogates them along to the local Controller object.

Specified by:
run in interface java.lang.Runnable

allUnitsOff

public void allUnitsOff(UnitEvent event)
allUnitsOff recieves the UnitListener event to be dispatched to the SocketController

Specified by:
allUnitsOff in interface UnitListener
Parameters:
event - the event to be dispatched

allLightsOff

public void allLightsOff(UnitEvent event)
allLightsOff recieves the UnitListener event to be dispatched to the SocketController

Specified by:
allLightsOff in interface UnitListener
Parameters:
event - the event to be dispatched

allLightsOn

public void allLightsOn(UnitEvent event)
allLightsOn recieves the UnitListener event to be dispatched to the SocketController

Specified by:
allLightsOn in interface UnitListener
Parameters:
event - the event to be dispatched

unitOn

public void unitOn(UnitEvent event)
unitOn recieves the UnitListener event to be dispatched to the SocketController

Specified by:
unitOn in interface UnitListener
Parameters:
event - the event to be dispatched

unitOff

public void unitOff(UnitEvent event)
unitOff recieves the UnitListener event to be dispatched to the SocketController

Specified by:
unitOff in interface UnitListener
Parameters:
event - the event to be dispatched

unitDim

public void unitDim(UnitEvent event)
unitDim recieves the UnitListener event to be dispatched to the SocketController

Specified by:
unitDim in interface UnitListener
Parameters:
event - the event to be dispatched

unitBright

public void unitBright(UnitEvent event)
unitBright recieves the UnitListener event to be dispatched to the SocketController

Specified by:
unitBright in interface UnitListener
Parameters:
event - the event to be dispatched


Copyright ©2000-2005 Wade Wassenberg.
On the web: http://x10.homelinux.org.
Send bug reports to x10@wass.homelinux.net.
Last Modified June 1, 2005