org.qtunes.core
Interface Service

All Known Subinterfaces:
Auth, Database, Player, ServiceFactory, Speaker, WebService, ZeroConf
All Known Implementing Classes:
AirtunesManagerService, AuthImpl, ConsoleController, DaapServer, DatabaseImpl, Finder, JmDNSZeroConf, MP3Handler, MP4Handler, PlayerFactory, PlayerImpl, Scanner, SimpleServer, SpeakerImpl, SpeakerImpl, SpeakerImpl, SunServer, TelnetController, TrackReader, TrackWriter, WebPlayer, WebServiceFactory, ZeroConfFactory

public interface Service

The QTunes project is entirely made up of Services, which can be started and stopped (relatively) dynamically. Each Service must implement this interface


Method Summary
 ServiceContext getContext()
          Return the ServiceContext that was passed into startService(org.qtunes.core.ServiceContext)
 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 startService(ServiceContext context)
          Start the Service
 void stopService(ServiceContext context)
          Stop the Service
 

Method Detail

startService

void startService(ServiceContext context)
Start the Service

Parameters:
context - the ServiceContext for this Service

stopService

void stopService(ServiceContext context)
Stop the Service

Parameters:
context - the ServiceContext for this Service (same as was passed into start)

getContext

ServiceContext getContext()
Return the ServiceContext that was passed into startService(org.qtunes.core.ServiceContext)


reportState

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. If no useful state, return null.