|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object livespace.services.Synchronizer livespace.services.PropertySynchronizer
public class PropertySynchronizer
Allows synchronisation to take place when a given property changes to a set value.
Field Summary | |
---|---|
static Object |
NON_NULL_VALUE
Indicates any non-null value. |
protected PropertyPath |
propertyPath
|
protected Object |
value
|
Fields inherited from class livespace.services.Synchronizer |
---|
source, synced |
Constructor Summary | |
---|---|
PropertySynchronizer(IDataObject source,
Object property,
Object value)
Create a new instance. |
|
PropertySynchronizer(IDataObject source,
PropertyPath path,
Object value)
Create a new instance. |
|
PropertySynchronizer(IDataObject source,
String path,
Object value)
Create a new instance. |
Method Summary | |
---|---|
protected String |
createFailMessage()
Create an error message indicating why synchronization has failed. |
Object |
getValue(IDataObject object)
Shortcut to get the value of the property for a given object. |
protected boolean |
isSynchronized()
Called to test whether the object is currently synchronized. |
protected boolean |
isSynchronized(PropertyEvent e)
This is called whenever a property changes on the object of interest. |
static void |
waitForNonNullProperty(IDataObject object,
Object property)
Shortcut for using this class to wait for a property to become any non-null value (i.e. |
static void |
waitForNonNullProperty(IDataObject object,
String path)
Shortcut for using this class to wait for a property path to become any non-null value (i.e. |
static void |
waitForProperty(IDataObject object,
Object property,
Object value)
Shortcut for using this class to wait for a property change. |
static void |
waitForProperty(IDataObject object,
String path,
Object value)
Shortcut for using this class to wait for a property change. |
Methods inherited from class livespace.services.Synchronizer |
---|
propertyValueChanged, synchronize, synchronize |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Object NON_NULL_VALUE
protected final PropertyPath propertyPath
protected final Object value
Constructor Detail |
---|
public PropertySynchronizer(IDataObject source, Object property, Object value)
source
- The source object.property
- The property to monitor.value
- The new value. Use NON_NULL_VALUE
to
indicate match any non-null value for the property.public PropertySynchronizer(IDataObject source, String path, Object value)
source
- The source object.path
- The property path to monitor. This may be a property
path in the form "property1/property2".value
- The new value. Use NON_NULL_VALUE
to
indicate match any non-null value for the property.public PropertySynchronizer(IDataObject source, PropertyPath path, Object value)
source
- The source object.path
- The property path to monitor.value
- The new value. Use NON_NULL_VALUE
to
indicate match any non-null value for the property.Method Detail |
---|
public static void waitForProperty(IDataObject object, Object property, Object value) throws SynchronizationException
object
- The obect to listen to.property
- The property.value
- The value.
SynchronizationException
- if property doesn't become equal
to value within the default timeout.PropertySynchronizer(IDataObject, Object, Object)
public static void waitForProperty(IDataObject object, String path, Object value) throws SynchronizationException
object
- The obect to listen to.path
- The property path of form "property1/property2/...".value
- The value.
SynchronizationException
- if property doesn't become equal
to value within the default timeout.PropertySynchronizer(IDataObject, String, Object)
,
PropertyPath.PropertyPath(String)
public static void waitForNonNullProperty(IDataObject object, Object property) throws SynchronizationException
object
- The obect to listen to.property
- The property.
SynchronizationException
- if property doesn't become
non-null within the default timeout.public static void waitForNonNullProperty(IDataObject object, String path) throws SynchronizationException
object
- The obect to listen to.path
- The property path of form "property1/property2/...".
SynchronizationException
- if property doesn't become
non-null within the default timeout.PropertyPath.PropertyPath(String)
public Object getValue(IDataObject object)
protected boolean isSynchronized()
Synchronizer
isSynchronized
in class Synchronizer
protected boolean isSynchronized(PropertyEvent e)
Synchronizer
Synchronizer.isSynchronized()
.
Subclasses may override this if they want to use the property
change event as part of the test.
isSynchronized
in class Synchronizer
protected String createFailMessage()
Synchronizer
createFailMessage
in class Synchronizer
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |