public interface WebContainerListener
A listener interface to be used with WebContainerManager to notify interested entities about lifecycle
events of WebContainer. This is desinged to be higher-level interface than pure
ServiceListener.
While it can't be guaranteed by the interface alone, WebContainerManager which is the invoker of
such listeners guarantees that, the notifications will be passed in single thread. Even if the WebContainer
service is immediately registered and unregistered a moment later,
webContainerChanged(ServiceReference, ServiceReference) calls from single WebContainerManager
will never run in parallel.
| Modifier and Type | Method and Description |
|---|---|
void |
bundleStopped(org.osgi.framework.Bundle bundle)
Notification about bundle being stopped.
|
void |
webContainerChanged(org.osgi.framework.ServiceReference<org.ops4j.pax.web.service.WebContainer> oldReference,
org.osgi.framework.ServiceReference<org.ops4j.pax.web.service.WebContainer> newReference)
Notification about changed reference to a
WebContainer. |
void webContainerChanged(org.osgi.framework.ServiceReference<org.ops4j.pax.web.service.WebContainer> oldReference,
org.osgi.framework.ServiceReference<org.ops4j.pax.web.service.WebContainer> newReference)
Notification about changed reference to a WebContainer. When the reference is not changed in the
underlying tracker (like changing a property of registered WebContainer that doesn't impact the
service ranking), this notification is simply not sent.
So in other words, a listener is always recommended to clean up the state from old reference (if not null) and pass the state to new reference (if not null).
The listener is guaranteed to be invoked sequentially - even if WebContainer is immediately
unregistered, next webContainerChanged(org.osgi.framework.ServiceReference<org.ops4j.pax.web.service.WebContainer>, org.osgi.framework.ServiceReference<org.ops4j.pax.web.service.WebContainer>) will be called after previous call finishes. The gurantee
is given by WebContainerManager.
oldReference - newReference - void bundleStopped(org.osgi.framework.Bundle bundle)
WebContainerManager will never call this method in
parallel - also in parallel with webContainerChanged(ServiceReference, ServiceReference).bundle - Copyright © 2006–2024 OPS4J - Open Participation Software for Java. All rights reserved.