sophware.home.net
Class NetworkHomeServer

java.lang.Object
  extended by java.lang.Thread
      extended by sophware.home.net.NetworkHomeServer
All Implemented Interfaces:
java.lang.Runnable, HomeListener

public class NetworkHomeServer
extends java.lang.Thread
implements HomeListener

NetworkHomeServer provides a network bridge for a Home. This server can be used in conjuction with the NetworkHomeTransceiver to provide access to any home powerline interface on one machine to any other machine on the same network.

Version:
1.0, 03/02/07
Author:
Russell Soph
See Also:
NetworkHomeTransceiver, Home

Nested Class Summary
 class NetworkHomeServer.NetworkHomeClient
           
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
NetworkHomeServer(Home home, int port)
          Instantiates a NetworkHomeServer for the given Home listening on the given port.
 
Method Summary
 void handleHomeEvent(HomeEvent event)
          Called when a HomeEvent is received.
 void objectAdded(java.lang.Object dev)
          Called when a Object is added to the Home.
 void objectRemoved(java.lang.Object dev)
          Called when a Object is removed from the Home.
 void run()
          Runnable implementation to accept connections from remote clients
 void send(java.lang.Object obj)
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, 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

NetworkHomeServer

public NetworkHomeServer(Home home,
                         int port)
                  throws HomeException
Instantiates a NetworkHomeServer for the given Home listening on the given port.

Parameters:
home - the Home that will be exposed on the network
port - the port upon which this server is listening
Throws:
HomeException
Method Detail

objectAdded

public void objectAdded(java.lang.Object dev)
Description copied from interface: HomeListener
Called when a Object is added to the Home.

Specified by:
objectAdded in interface HomeListener
Parameters:
dev - the Object that was added.

objectRemoved

public void objectRemoved(java.lang.Object dev)
Description copied from interface: HomeListener
Called when a Object is removed from the Home.

Specified by:
objectRemoved in interface HomeListener
Parameters:
dev - the Object that was added.

handleHomeEvent

public void handleHomeEvent(HomeEvent event)
Description copied from interface: HomeListener
Called when a HomeEvent is received.

Specified by:
handleHomeEvent in interface HomeListener
Parameters:
event - the HomeEvent that occurred.

send

public void send(java.lang.Object obj)

run

public void run()
Runnable implementation to accept connections from remote clients

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread