public abstract class AbstractContext extends Object
Modifier and Type | Field and Description |
---|---|
static String |
COPY_PROPERTIES
Property used to indicate copying of properties is needed by context.
|
protected long |
lastTouchedTime |
protected AbstractContext |
parent |
protected Map<String,Object> |
properties |
Modifier | Constructor and Description |
---|---|
protected |
AbstractContext() |
protected |
AbstractContext(AbstractContext parent) |
Modifier and Type | Method and Description |
---|---|
void |
clearPropertyDifferences()
Once the clustering mechanism transmits the property differences,
it should call this method to avoid retransmitting stuff that has already
been sent.
|
void |
flush() |
long |
getLastTouchedTime() |
Object |
getLocalProperty(String key)
Retrieves an object given a key.
|
AbstractContext |
getParent() |
Map<String,Object> |
getProperties()
Deprecated.
|
Object |
getProperty(String key)
Retrieves an object given a key.
|
Map<String,Object> |
getPropertyDifferences()
Get the property differences since the last transmission by the clustering
mechanism
|
Iterator<String> |
getPropertyNames()
An iterator over a collection of
String objects, which are the
keys in the properties object. |
Object |
getPropertyNonReplicable(String key)
Retrieves an object given a key.
|
abstract ConfigurationContext |
getRootContext() |
boolean |
isAncestor(AbstractContext context) |
void |
mergeProperties(Map<String,Object> props)
This will do a copy of the given properties to the current properties
table.
|
void |
removeProperty(String key)
Remove a property.
|
void |
removePropertyNonReplicable(String key)
Remove a property.
|
void |
setLastTouchedTime(long t) |
void |
setNonReplicableProperty(String key,
Object value)
Store a property in this context.
|
void |
setParent(AbstractContext context) |
void |
setProperties(Map<String,Object> properties)
This will set the properties to the context.
|
void |
setProperty(String key,
Object value)
Store a property in this context
|
protected void |
touch()
ServiceContext and ServiceGroupContext are not getting automatically garbage collected.
|
public static final String COPY_PROPERTIES
protected long lastTouchedTime
protected transient AbstractContext parent
protected AbstractContext(AbstractContext parent)
protected AbstractContext()
public AbstractContext getParent()
public boolean isAncestor(AbstractContext context)
context
- public Map<String,Object> getProperties()
getPropertyNames()
, getProperty(String)
,
setProperty(String, Object)
& removeProperty(String)
instead.public Iterator<String> getPropertyNames()
String
objects, which are the
keys in the properties object.public Object getProperty(String key)
key
- - if not found, will return nullpublic Object getLocalProperty(String key)
key
- - if not found, will return nullpublic Object getPropertyNonReplicable(String key)
key
- - if not found, will return nullpublic void setProperty(String key, Object value)
key
- value
- public void setNonReplicableProperty(String key, Object value)
key
- value
- public void removeProperty(String key)
key
- public void removePropertyNonReplicable(String key)
key
- public Map<String,Object> getPropertyDifferences()
public void clearPropertyDifferences()
public void setParent(AbstractContext context)
context
- public void setProperties(Map<String,Object> properties)
COPY_PROPERTIES
) so that if set to true, this code
will copy the whole thing, without just referencing to the source.properties
- public void mergeProperties(Map<String,Object> props)
props
- The table of properties to copyprotected void touch()
public long getLastTouchedTime()
public void setLastTouchedTime(long t)
public abstract ConfigurationContext getRootContext()
Copyright © 2004–2014 The Apache Software Foundation. All rights reserved.