public abstract class AbstractContext
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
COPY_PROPERTIES
Property used to indicate copying of properties is needed by context.
|
protected long |
lastTouchedTime |
protected AbstractContext |
parent |
protected java.util.Map<java.lang.String,java.lang.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() |
java.lang.Object |
getLocalProperty(java.lang.String key)
Retrieves an object given a key.
|
AbstractContext |
getParent() |
java.util.Map<java.lang.String,java.lang.Object> |
getProperties()
Deprecated.
|
java.lang.Object |
getProperty(java.lang.String key)
Retrieves an object given a key.
|
java.util.Map<java.lang.String,java.lang.Object> |
getPropertyDifferences()
Get the property differences since the last transmission by the clustering
mechanism
|
java.util.Iterator<java.lang.String> |
getPropertyNames()
An iterator over a collection of
String objects, which are the
keys in the properties object. |
java.lang.Object |
getPropertyNonReplicable(java.lang.String key)
Retrieves an object given a key.
|
abstract ConfigurationContext |
getRootContext() |
boolean |
isAncestor(AbstractContext context) |
void |
mergeProperties(java.util.Map<java.lang.String,java.lang.Object> props)
This will do a copy of the given properties to the current properties
table.
|
void |
removeProperty(java.lang.String key)
Remove a property.
|
void |
removePropertyNonReplicable(java.lang.String key)
Remove a property.
|
void |
setLastTouchedTime(long t) |
void |
setNonReplicableProperty(java.lang.String key,
java.lang.Object value)
Store a property in this context.
|
void |
setParent(AbstractContext context) |
void |
setProperties(java.util.Map<java.lang.String,java.lang.Object> properties)
This will set the properties to the context.
|
void |
setProperty(java.lang.String key,
java.lang.Object value)
Store a property in this context
|
protected void |
touch()
ServiceContext and ServiceGroupContext are not getting automatically garbage collected.
|
public static final java.lang.String COPY_PROPERTIES
protected long lastTouchedTime
protected transient AbstractContext parent
protected transient java.util.Map<java.lang.String,java.lang.Object> properties
protected AbstractContext(AbstractContext parent)
protected AbstractContext()
public AbstractContext getParent()
public boolean isAncestor(AbstractContext context)
context - public java.util.Map<java.lang.String,java.lang.Object> getProperties()
getPropertyNames(), getProperty(String),
setProperty(String, Object) & removeProperty(String)instead.public java.util.Iterator<java.lang.String> getPropertyNames()
String objects, which are the
keys in the properties object.public java.lang.Object getProperty(java.lang.String key)
key - - if not found, will return nullpublic java.lang.Object getLocalProperty(java.lang.String key)
key - - if not found, will return nullpublic java.lang.Object getPropertyNonReplicable(java.lang.String key)
key - - if not found, will return nullpublic void setProperty(java.lang.String key,
java.lang.Object value)
key - value - public void setNonReplicableProperty(java.lang.String key,
java.lang.Object value)
key - value - public void removeProperty(java.lang.String key)
key - public void removePropertyNonReplicable(java.lang.String key)
key - public java.util.Map<java.lang.String,java.lang.Object> getPropertyDifferences()
public void clearPropertyDifferences()
public void setParent(AbstractContext context)
context - public void setProperties(java.util.Map<java.lang.String,java.lang.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(java.util.Map<java.lang.String,java.lang.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-2021 The Apache Software Foundation. All Rights Reserved.