public abstract class JcrObject extends Object implements org.apache.wicket.model.IDetachable, IObservable
All instances of a type that correspond to the same node are equivalent with respect to the hashCode and equals methods.
Constructor and Description |
---|
JcrObject(org.apache.wicket.model.IModel<javax.jcr.Node> nodeModel) |
JcrObject(JcrNodeModel model)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
detach() |
boolean |
equals(Object obj)
Equivalence of observables; observation will only be started on one instance.
|
protected javax.jcr.Node |
getNode() |
protected JcrNodeModel |
getNodeModel() |
protected IObservationContext |
getObservationContext() |
int |
hashCode() |
protected abstract void |
processEvents(IObservationContext context,
Iterator<? extends IEvent> events)
Process the JCR events.
|
void |
save() |
void |
setObservationContext(IObservationContext<? extends IObservable> context)
Before observation is started on the observable, an observation context is injected by
the observer registry.
|
void |
startObservation()
When the first
IObserver of this observable is registered with the observer
registry, observation is started. |
void |
stopObservation()
When the last
IObserver unregisters, observation is stopped. |
@Deprecated public JcrObject(JcrNodeModel model)
public JcrObject(org.apache.wicket.model.IModel<javax.jcr.Node> nodeModel)
protected javax.jcr.Node getNode() throws javax.jcr.ItemNotFoundException
javax.jcr.ItemNotFoundException
protected JcrNodeModel getNodeModel()
public void save()
public void detach()
detach
in interface org.apache.wicket.model.IDetachable
public void setObservationContext(IObservationContext<? extends IObservable> context)
IObservable
setObservationContext
in interface IObservable
protected IObservationContext getObservationContext()
protected abstract void processEvents(IObservationContext context, Iterator<? extends IEvent> events)
context
- subtype specific observation contextevents
- received JCR eventspublic void startObservation()
IObservable
IObserver
of this observable is registered with the observer
registry, observation is started. Implementations must notify observers until observation
is stopped.
An implementation should register listeners with external data sources, when appropriate. It is possible for an observable to register as an observer for another observable.
startObservation
in interface IObservable
public void stopObservation()
IObservable
IObserver
unregisters, observation is stopped. Any listeners
or observers registered by the observable must be unregistered by the implementation.stopObservation
in interface IObservable
public int hashCode()
hashCode
in interface IObservable
hashCode
in class Object
IObservable.equals(Object)
public boolean equals(Object obj)
IObservable
equals
in interface IObservable
equals
in class Object
Copyright © 2007–2017 Hippo B.V. (http://www.onehippo.com). All rights reserved.