com.hammurapi.flow.runtime
Interface PropertySet

All Known Subinterfaces:
PersistentPropertySet

public interface PropertySet

Set of properties.

Author:
Pavel

Method Summary
 void cancel(String name)
          Removes callable to be cooked from the cooking queue, converting it to lazy, if it is not already cooked.
 void clear()
          Removes all entries from the property set
 boolean compareProperties(PropertySet otherSet)
           
 boolean containsAll(PropertySet subSet)
           
 void cook(String name, Callable<?> callable)
          Puts callable to the property set for asynchronous invocation to retrieve value at some point in the future.
 void cook(String name, Callable<?> callable, long delay, TimeUnit timeUnit)
          Puts callable to the property set for asynchronous invocation to retrieve value at some point in the future after specified delay.
 void cooking(String name, Future<?> future)
          Puts value which is not ready yet but "is being cooked by another thread" to the property set to be used at some point of time in the future.
 Object get(String name)
          Retrieves property.
 Object get(String name, Object defaultValue)
           
 Set<String> getPropertyNames()
           
 PropertySet getSubset(String prefix)
           
 void lazy(String name, Callable<?> callable)
          Puts callable to the property set.
 void mount(String prefix, PropertySet source)
          Mounts source property set at specified prefix.
 void remove(String name)
          Removes property from the set.
 void set(String name, Object value)
          Sets property.
 void setAll(PropertySet source)
          Copies all entries from the source property set to self.
 

Method Detail

getPropertyNames

Set<String> getPropertyNames()
Returns:
Names of properties in the set

getSubset

PropertySet getSubset(String prefix)
Parameters:
prefix -
Returns:
Property set which operates on properties starting with given prefix.

remove

void remove(String name)
Removes property from the set. Chained properties are shadowed (appear to be removed).

Parameters:
name -

clear

void clear()
Removes all entries from the property set


mount

void mount(String prefix,
           PropertySet source)
Mounts source property set at specified prefix. E.g. if source property set has entry 'a' and prefix is 'b/' then that entry will be available as 'b/a'. Mounted entries shadow own entries.

Parameters:
prefix -
source -

setAll

void setAll(PropertySet source)
Copies all entries from the source property set to self.

Parameters:
source -

containsAll

boolean containsAll(PropertySet subSet)
Parameters:
subSet -
Returns:
true if all properties of subset are present in this set with same values.

compareProperties

boolean compareProperties(PropertySet otherSet)
Parameters:
otherSet -
Returns:
true if all properties in this set are equal to properties in the other set.

get

Object get(String name)
Retrieves property.


get

Object get(String name,
           Object defaultValue)
Parameters:
name - Property name.
defaultValue - Default value.
Returns:
Property value or default value if property doesn't exist in the property set.

set

void set(String name,
         Object value)
Sets property.

Parameters:
name -
value -

cook

void cook(String name,
          Callable<?> callable)
Puts callable to the property set for asynchronous invocation to retrieve value at some point in the future.

Parameters:
name -
callable -

cook

void cook(String name,
          Callable<?> callable,
          long delay,
          TimeUnit timeUnit)
Puts callable to the property set for asynchronous invocation to retrieve value at some point in the future after specified delay.

Parameters:
name -
callable -
delay -

cooking

void cooking(String name,
             Future<?> future)
Puts value which is not ready yet but "is being cooked by another thread" to the property set to be used at some point of time in the future.

Parameters:
name -
future - Value being cooked.

lazy

void lazy(String name,
          Callable<?> callable)
Puts callable to the property set. Value from callable is retrieved when get() method for the given name is invoked.

Parameters:
name -
callable -

cancel

void cancel(String name)
Removes callable to be cooked from the cooking queue, converting it to lazy, if it is not already cooked.

Parameters:
name -