public class LogEventAdapter extends AbstractAdapter implements org.osgi.framework.ServiceListener
LogReaderService services
with the framework and subsequently, a LogListener callback with any
currently available LogReaderService. Any received log event is then
posted via the EventAdmin as specified in 113.6.6 OSGi R4 compendium.
Note that this class does not create a hard dependency on the org.osgi.service.log
packages. The adaption only takes place if it is present or once it becomes
available hence, combined with a DynamicImport-Package no hard dependency is
needed.| Constructor and Description |
|---|
LogEventAdapter(org.osgi.framework.BundleContext context,
org.osgi.service.event.EventAdmin admin)
The constructor of the adapter.
|
| Modifier and Type | Method and Description |
|---|---|
void |
destroy(org.osgi.framework.BundleContext context) |
void |
serviceChanged(org.osgi.framework.ServiceEvent event)
Once a
LogReaderService register event is received this method
registers a LogListener with the received service that assembles
and posts any log event via the EventAdmin as specified in
113.6.6 OSGi R4 compendium. |
getEventAdminpublic LogEventAdapter(org.osgi.framework.BundleContext context,
org.osgi.service.event.EventAdmin admin)
LogReaderService services and
subsequently, a LogListener callback with any currently available
LogReaderService. Any received log event is then posted via the given
EventAdmin.context - The bundle context with which to register as a listener.admin - The EventAdmin to use for posting events.public void destroy(org.osgi.framework.BundleContext context)
destroy in class AbstractAdapterpublic void serviceChanged(org.osgi.framework.ServiceEvent event)
LogReaderService register event is received this method
registers a LogListener with the received service that assembles
and posts any log event via the EventAdmin as specified in
113.6.6 OSGi R4 compendium.serviceChanged in interface org.osgi.framework.ServiceListenerevent - The event to adapt.Copyright © 2006–2021 The Apache Software Foundation. All rights reserved.