|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.qtunes.core.OSGIServiceContext
public final class OSGIServiceContext
Field Summary |
---|
Fields inherited from interface org.qtunes.core.ServiceContext |
---|
EVENTPREFIX |
Constructor Summary | |
---|---|
OSGIServiceContext(org.osgi.service.component.ComponentContext context,
Service service)
|
Method Summary | ||
---|---|---|
void |
addListener(Listener listener)
Add a Listener to the Server, it will be notified of events |
|
ServiceContext |
addService(Class<?>[] classes,
Service service,
Map<?,?> properties)
Add a service |
|
void |
debug(String message)
|
|
void |
debug(String message,
Throwable e)
|
|
void |
error(String message,
Throwable e)
|
|
void |
fireEvent(String name)
Fire an event - the Listeners registered with the server will be notified |
|
void |
fireEvent(String topic,
Object[] o)
Fire an event - the Listeners registered with the server will be notified. |
|
org.osgi.service.component.ComponentContext |
getComponentContext()
|
|
String |
getProperty(String key)
|
|
String[] |
getPropertyNames()
|
|
String |
getServerName()
Return the logical name of the Server |
|
Service |
getService()
Get the Service for this ServiceContext |
|
|
getService(Class<E> clazz)
Get the first Service object of the specified type |
|
Service |
getServiceByShortName(String shortname)
Get the first Service object with the specified shortname |
|
|
getServices(Class<E> clazz)
Get a list of all Service objects of the specified type |
|
String[] |
getServiceShortNames()
|
|
String |
getSoftwareName()
Return the name and version of the Software |
|
void |
info(String message)
|
|
Object |
load()
|
|
void |
removeListener(Listener listener)
Remove a Listener to the Server, it will be notified of events |
|
void |
removeService()
Remove a service |
|
void |
save(Object o)
Add the specified object to the system State and save that state to disk. |
|
void |
start()
|
|
void |
stop()
|
|
void |
warn(String message,
Throwable e)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OSGIServiceContext(org.osgi.service.component.ComponentContext context, Service service)
Method Detail |
---|
public org.osgi.service.component.ComponentContext getComponentContext()
public Service getService()
ServiceContext
getService
in interface ServiceContext
public void debug(String message)
debug
in interface ServiceContext
public void debug(String message, Throwable e)
debug
in interface ServiceContext
public void info(String message)
info
in interface ServiceContext
public void warn(String message, Throwable e)
warn
in interface ServiceContext
public void error(String message, Throwable e)
error
in interface ServiceContext
public void save(Object o)
ServiceContext
save
in interface ServiceContext
public Object load()
load
in interface ServiceContext
public String getSoftwareName()
ServiceContext
getSoftwareName
in interface ServiceContext
public String getServerName()
ServiceContext
getServerName
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(String name)
fireEvent
in interface ServiceContext
public void fireEvent(String topic, Object[] o)
qtunes.fireEvent("stateChanged", new Object[] { "track", track, "user", user });
fireEvent
in interface ServiceContext
o
- an array of [key, value]public String[] getPropertyNames()
getPropertyNames
in interface ServiceContext
public String getProperty(String key)
getProperty
in interface ServiceContext
public <E extends Service> E getService(Class<E> clazz)
ServiceContext
Service
object of the specified type
getService
in interface ServiceContext
public String[] getServiceShortNames()
getServiceShortNames
in interface ServiceContext
public <E extends Service> E[] getServices(Class<E> clazz)
ServiceContext
Service
objects of the specified type
getServices
in interface ServiceContext
public Service getServiceByShortName(String shortname)
ServiceContext
Service
object with the specified shortname
getServiceByShortName
in interface ServiceContext
public void start()
start
in interface ServiceContext
public void stop()
stop
in interface ServiceContext
public ServiceContext addService(Class<?>[] classes, Service service, Map<?,?> properties)
ServiceContext
addService
in interface ServiceContext
public void removeService()
ServiceContext
removeService
in interface ServiceContext
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |