org.qtunes.web.spi.simple
Class SimpleServer

java.lang.Object
  extended by org.qtunes.web.spi.simple.SimpleServer
All Implemented Interfaces:
java.lang.Runnable, Service, WebService

public class SimpleServer
extends java.lang.Object
implements WebService, java.lang.Runnable


Constructor Summary
SimpleServer()
           
 
Method Summary
 java.net.InetSocketAddress getAddress()
           
 ServiceContext getContext()
          Return the ServiceContext that was passed into Service.startService(org.qtunes.core.ServiceContext)
 java.lang.String hasHandler(java.lang.String path)
           
 java.util.Map<java.lang.String,java.lang.Object> reportState()
          Return a Map describing the state of this Service, for serialization back to any client that needs to know (eg webplayer) - so values should be serializable objects, eg Lists, Maps or simple objects.
 void run()
           
 void setHandler(java.lang.String path, WebHandler handler)
           
 void startService(ServiceContext context)
          Start the Service
 void stopService(ServiceContext context)
          Stop the Service
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleServer

public SimpleServer()
Method Detail

run

public void run()
Specified by:
run in interface java.lang.Runnable

getAddress

public java.net.InetSocketAddress getAddress()
Specified by:
getAddress in interface WebService

hasHandler

public java.lang.String hasHandler(java.lang.String path)
Specified by:
hasHandler in interface WebService

setHandler

public void setHandler(java.lang.String path,
                       WebHandler handler)
Specified by:
setHandler in interface WebService

getContext

public ServiceContext getContext()
Description copied from interface: Service
Return the ServiceContext that was passed into Service.startService(org.qtunes.core.ServiceContext)

Specified by:
getContext in interface Service

startService

public void startService(ServiceContext context)
Description copied from interface: Service
Start the Service

Specified by:
startService in interface Service
Parameters:
context - the ServiceContext for this Service

stopService

public void stopService(ServiceContext context)
Description copied from interface: Service
Stop the Service

Specified by:
stopService in interface Service
Parameters:
context - the ServiceContext for this Service (same as was passed into start)

reportState

public java.util.Map<java.lang.String,java.lang.Object> reportState()
Description copied from interface: Service
Return a Map describing the state of this Service, for serialization back to any client that needs to know (eg webplayer) - so values should be serializable objects, eg Lists, Maps or simple objects. If no useful state, return null.

Specified by:
reportState in interface Service