public class WorkspaceEventListenerRegistration extends Object
Helper class for registering EventListener
for workspace observation.
Use observe(String, String, EventListener)
to obtain a WorkspaceEventListenerRegistration.Registrar
object for configuring the event listener
and call WorkspaceEventListenerRegistration.Registrar.register()
to perform the actual registration.
The returned WorkspaceEventListenerRegistration.Handle
should be used to unregister the event listener
.
EventListener
,
ObservationManager
Modifier and Type | Class and Description |
---|---|
static interface |
WorkspaceEventListenerRegistration.Handle
Handle used for unregistering
EventListener s. |
static class |
WorkspaceEventListenerRegistration.Registrar
Registrar for easing setup and de/registration of
EventListener . |
static class |
WorkspaceEventListenerRegistration.WorkspaceEventListenerRegistrationException
Exception thrown when same instance of a
EventListener is already registered. |
Modifier and Type | Method and Description |
---|---|
static WorkspaceEventListenerRegistration.Registrar |
observe(String workspace,
String observationPath,
javax.jcr.observation.EventListener eventListener)
Creates a
WorkspaceEventListenerRegistration.Registrar object for configuring and registering the EventListener . |
public static WorkspaceEventListenerRegistration.Registrar observe(String workspace, String observationPath, javax.jcr.observation.EventListener eventListener)
Creates a WorkspaceEventListenerRegistration.Registrar
object for configuring and registering the EventListener
.
Be careful that if you observe "/", events may be generated for jcr:system, which is "shared" across all workspaces.
Use FilteredEventListener
and JCR_SYSTEM_EXCLUDING_PREDICATE
wherever appropriate.
Note that only one instance of the EventListener
is allowed per workspace.
workspace
- workspace to be observedobservationPath
- path in the workspace to be observedeventListener
- event listenerWorkspaceEventListenerRegistration.Registrar
object for configuring and registering the EventListener
NullPointerException
- if any of the mandatory parameters is nullCopyright © 2003–2016 Magnolia International Ltd.. All rights reserved.