@ConsumerType
public interface ResourceChangeListener
ResourceChangeListener
objects are registered with the Framework service
registry and are notified with ResourceChange
objects when a
change occurs.
ResourceChangeListener
objects can inspect the received ResourceChange
objects to
determine the type of change, location and other properties.
ResourceChangeListener
objects must be registered with a service property
PATHS
whose value is the list of resource paths for which
the listener is interested in getting change events.
By default a resource listener gets only local events which means events
caused by changes persisted on the same instance as this listener is registered.
If the resource listener is interested in external events, the implementation
should implement the ExternalResourceChangeListener
interface, but still register
the service as a ResourceChangeListener
service.
Modifier and Type | Field and Description |
---|---|
static String |
CHANGES
Array of change types - optional.
|
static String |
PATHS
Array of paths - required.
|
Modifier and Type | Method and Description |
---|---|
void |
onChange(List<ResourceChange> changes)
Report resource changes based on the filter properties of this listener.
|
static final String PATHS
.
should be used.
If one of the paths is a sub resource of another specified path,
the sub path is ignored.
If this property is missing or invalid, the listener is ignored. The type of the
property must either be String, or a String array.static final String CHANGES
ResourceChange.ChangeType
.void onChange(@Nonnull List<ResourceChange> changes)
changes
- The changes.Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.