|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.qtunes.main.ServiceContextImpl
public class ServiceContextImpl
Constructor Summary | |
---|---|
ServiceContextImpl(QTunes qtunes,
Service service,
java.lang.String servicename,
org.qtunes.main.PropertyManager props)
|
Method Summary | ||
---|---|---|
void |
addListener(Listener listener)
Add a Listener to the Server, it will be notified of events |
|
ServiceContext |
addService(java.lang.Class<?>[] classes,
Service service,
java.util.Map<java.lang.String,java.lang.String> properties,
boolean permanent)
Add a service |
|
void |
debug(java.lang.String message)
|
|
void |
debug(java.lang.String message,
java.lang.Throwable e)
|
|
void |
error(java.lang.String message,
java.lang.Throwable e)
|
|
void |
fireEvent(java.lang.String topic,
java.lang.Object[] o)
Fire an event - the Listeners registered with the server will be notified. |
|
java.lang.String |
getGlobalProperty(java.lang.String key)
Get a system-wide property |
|
java.lang.String |
getProperty(java.lang.String key)
Get a property of this Service |
|
java.lang.String[] |
getPropertyNames()
Return a list of properties of this Service |
|
java.util.Date |
getServerBuildDate()
Return the build date of the Server |
|
java.lang.String |
getServerName()
Return the logical name of the Server |
|
Service |
getService()
Get the Service for this ServiceContext |
|
|
getService(java.lang.Class<E> type)
Get the first Service object of the specified type |
|
|
getService(java.lang.Class<E> type,
java.lang.String filter)
Get the first Service object of the specified type |
|
java.lang.String |
getServiceName()
Return the unique logical name of this Service |
|
java.lang.String[] |
getServiceNames()
Return the list of Service names |
|
|
getServices(java.lang.Class<E> type,
java.lang.String filter)
Get a list of all Service objects of the specified type |
|
java.lang.String |
getSoftwareName()
Return the name and version of the Software |
|
void |
info(java.lang.String message)
|
|
boolean |
isActive()
Return true if the Service has been started |
|
void |
putProperty(java.lang.String key,
java.lang.String value)
Set a property of this Service |
|
void |
quit()
|
|
void |
removeListener(Listener listener)
Remove a Listener to the Server, it will be notified of events |
|
void |
removeService()
Remove a service |
|
void |
start()
|
|
void |
stop()
|
|
void |
warn(java.lang.String message,
java.lang.Throwable e)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ServiceContextImpl(QTunes qtunes, Service service, java.lang.String servicename, org.qtunes.main.PropertyManager props)
Method Detail |
---|
public Service getService()
ServiceContext
getService
in interface ServiceContext
public java.lang.String getServiceName()
ServiceContext
getServiceName
in interface ServiceContext
public void debug(java.lang.String message)
debug
in interface ServiceContext
public void debug(java.lang.String message, java.lang.Throwable e)
debug
in interface ServiceContext
public void info(java.lang.String message)
info
in interface ServiceContext
public void warn(java.lang.String message, java.lang.Throwable e)
warn
in interface ServiceContext
public void error(java.lang.String message, java.lang.Throwable e)
error
in interface ServiceContext
public java.lang.String getServerName()
ServiceContext
getServerName
in interface ServiceContext
public java.lang.String getSoftwareName()
ServiceContext
getSoftwareName
in interface ServiceContext
public java.util.Date getServerBuildDate()
ServiceContext
getServerBuildDate
in interface ServiceContext
public void addListener(Listener listener)
Listener
to the Server, it will be notified of events
addListener
in interface ServiceContext
public void removeListener(Listener listener)
Listener
to the Server, it will be notified of events
removeListener
in interface ServiceContext
public void fireEvent(java.lang.String topic, java.lang.Object[] o)
qtunes.fireEvent("stateChanged", new Object[] { "track", track, "user", user });
fireEvent
in interface ServiceContext
o
- an array of [key, value]public java.lang.String[] getPropertyNames()
ServiceContext
getPropertyNames
in interface ServiceContext
public java.lang.String getGlobalProperty(java.lang.String key)
ServiceContext
getGlobalProperty
in interface ServiceContext
public java.lang.String getProperty(java.lang.String key)
ServiceContext
getProperty
in interface ServiceContext
public void putProperty(java.lang.String key, java.lang.String value)
ServiceContext
putProperty
in interface ServiceContext
public <E extends Service> E getService(java.lang.Class<E> type)
ServiceContext
Service
object of the specified type
getService
in interface ServiceContext
public <E extends Service> E getService(java.lang.Class<E> type, java.lang.String filter)
ServiceContext
Service
object of the specified type
getService
in interface ServiceContext
public <E extends Service> E[] getServices(java.lang.Class<E> type, java.lang.String filter)
ServiceContext
Service
objects of the specified type
getServices
in interface ServiceContext
public void start()
start
in interface ServiceContext
public void stop()
stop
in interface ServiceContext
public boolean isActive()
ServiceContext
isActive
in interface ServiceContext
public ServiceContext addService(java.lang.Class<?>[] classes, Service service, java.util.Map<java.lang.String,java.lang.String> properties, boolean permanent)
ServiceContext
addService
in interface ServiceContext
public void removeService()
ServiceContext
removeService
in interface ServiceContext
public java.lang.String[] getServiceNames()
ServiceContext
getServiceNames
in interface ServiceContext
public void quit()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |