|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.ha.framework.server.DistributedStateImpl
This class manages distributed state across the cluster.
Nested Class Summary |
Nested classes inherited from class org.jboss.ha.framework.interfaces.DistributedState (src) |
DistributedState.DSListener (src) , DistributedState.DSListenerEx (src) |
Field Summary | |
protected java.util.HashMap |
categories
HashMap |
protected java.util.HashMap |
keyListeners
|
protected Logger (src) |
log
|
protected MBeanServer (src) |
mbeanServer
|
protected java.lang.String |
name
|
protected HAPartition (src) |
partition
|
protected static java.lang.Class[] |
remove_types
|
protected static java.lang.String |
SERVICE_NAME
|
protected static java.lang.Class[] |
set_types
|
Constructor Summary | |
DistributedStateImpl()
|
|
DistributedStateImpl(HAPartition (src) partition,
MBeanServer (src) server)
|
Method Summary | |
void |
_remove(java.lang.String category,
java.io.Serializable key)
|
void |
_remove(java.lang.String category,
java.lang.String key)
|
java.io.Serializable |
_removeInternal(java.lang.String category,
java.io.Serializable key)
|
void |
_set(java.lang.String category,
java.io.Serializable key,
java.io.Serializable value)
|
void |
_set(java.lang.String category,
java.lang.String key,
java.io.Serializable value)
|
void |
_setInternal(java.lang.String category,
java.io.Serializable key,
java.io.Serializable value)
|
protected void |
cleanupKeyListeners()
|
java.io.Serializable |
get(java.lang.String category,
java.io.Serializable key)
Read in a value associated to a key in the given category. |
java.util.Collection |
getAllCategories()
Return a list of all categories. |
java.util.Collection |
getAllKeys(java.lang.String category)
Return a list of all keys in a category. |
java.util.Collection |
getAllValues(java.lang.String category)
Return a list of all values in a category. |
java.io.Serializable |
getCurrentState()
Called when a new node need to be initialized. |
void |
init()
|
java.lang.String |
listContent()
|
java.lang.String |
listXmlContent()
|
protected void |
notifyKeyListeners(java.lang.String category,
java.io.Serializable key,
java.io.Serializable value,
boolean locallyModified)
|
protected void |
notifyKeyListenersOfRemove(java.lang.String category,
java.io.Serializable key,
java.io.Serializable oldContent,
boolean locallyModified)
|
void |
registerDSListener(java.lang.String category,
DistributedState.DSListener (src) subscriber)
Subscribes to receive DistributedState.DSListener events |
void |
registerDSListenerEx(java.lang.String category,
DistributedState.DSListenerEx (src) subscriber)
Subscribes to receive DistributedState.DSListenerEx events |
protected void |
registerListener(java.lang.String category,
java.lang.Object subscriber)
|
java.io.Serializable |
remove(java.lang.String category,
java.io.Serializable key)
Remove the key from the ReplicationService in the given category |
java.io.Serializable |
remove(java.lang.String category,
java.io.Serializable key,
boolean asynchronousCall)
Same as remove(String, String) but caller can choose if the call is made synchronously or asynchronously. |
void |
set(java.lang.String category,
java.io.Serializable key,
java.io.Serializable value)
Associates a value to a key in a specific category |
void |
set(java.lang.String category,
java.io.Serializable key,
java.io.Serializable value,
boolean asynchronousCall)
Same as set(String, String) but caller can choose if the call is made synchronously or asynchronously. |
void |
setCurrentState(java.io.Serializable newState)
This callback method is called when a new service starts on a new node: the state that it should hold is transfered to it through this callback |
void |
start()
|
void |
stop()
|
void |
unregisterDSListener(java.lang.String category,
DistributedState.DSListener (src) subscriber)
Subscribes from DistributedState.DSListener events |
void |
unregisterDSListenerEx(java.lang.String category,
DistributedState.DSListenerEx (src) subscriber)
Subscribes from DistributedState.DSListenerEx events |
protected void |
unregisterListener(java.lang.String category,
java.lang.Object subscriber)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final java.lang.String SERVICE_NAME
protected static final java.lang.Class[] set_types
protected static final java.lang.Class[] remove_types
protected java.util.HashMap categories
protected java.util.HashMap keyListeners
protected HAPartition (src) partition
protected Logger (src) log
protected MBeanServer (src) mbeanServer
protected java.lang.String name
Constructor Detail |
public DistributedStateImpl()
public DistributedStateImpl(HAPartition (src) partition, MBeanServer (src) server)
Method Detail |
public void init() throws java.lang.Exception
java.lang.Exception
public void start() throws java.lang.Exception
java.lang.Exception
public void stop() throws java.lang.Exception
java.lang.Exception
public java.lang.String listContent() throws java.lang.Exception
listContent
in interface DistributedStateImplMBean (src)
java.lang.Exception
public java.lang.String listXmlContent() throws java.lang.Exception
listXmlContent
in interface DistributedStateImplMBean (src)
java.lang.Exception
public void set(java.lang.String category, java.io.Serializable key, java.io.Serializable value) throws java.lang.Exception
DistributedState (src)
set
in interface DistributedState (src)
category
- Name of the private naming-spacekey
- Name of the data to setvalue
- Value of the data to set
java.lang.Exception
- If a network communication occurspublic void set(java.lang.String category, java.io.Serializable key, java.io.Serializable value, boolean asynchronousCall) throws java.lang.Exception
DistributedState (src)
set
in interface DistributedState (src)
java.lang.Exception
public java.io.Serializable remove(java.lang.String category, java.io.Serializable key) throws java.lang.Exception
DistributedState (src)
remove
in interface DistributedState (src)
category
- Name of the categorykey
- Key to be removed
java.lang.Exception
- if a network exception occurs while removing the entry.public java.io.Serializable remove(java.lang.String category, java.io.Serializable key, boolean asynchronousCall) throws java.lang.Exception
DistributedState (src)
remove
in interface DistributedState (src)
java.lang.Exception
public java.io.Serializable get(java.lang.String category, java.io.Serializable key)
DistributedState (src)
get
in interface DistributedState (src)
category
- Name of the private naming-spacekey
- The key of the value to read
public java.util.Collection getAllCategories()
DistributedState (src)
getAllCategories
in interface DistributedState (src)
public java.util.Collection getAllKeys(java.lang.String category)
DistributedState (src)
getAllKeys
in interface DistributedState (src)
category
- The category under which to look for keys
public java.util.Collection getAllValues(java.lang.String category)
DistributedState (src)
getAllValues
in interface DistributedState (src)
category
- The category name under which to look for values
public void registerDSListenerEx(java.lang.String category, DistributedState.DSListenerEx (src) subscriber)
DistributedState (src)
DistributedState.DSListenerEx
(src) events
registerDSListenerEx
in interface DistributedState (src)
category
- Name of the private-space to watch forsubscriber
- Object that will receive callbacks. Thispublic void unregisterDSListenerEx(java.lang.String category, DistributedState.DSListenerEx (src) subscriber)
DistributedState (src)
DistributedState.DSListenerEx
(src) events
unregisterDSListenerEx
in interface DistributedState (src)
category
- Name of the private-space dictionary currently observedsubscriber
- object currently observing this categorypublic void registerDSListener(java.lang.String category, DistributedState.DSListener (src) subscriber)
DistributedState (src)
DistributedState.DSListener
(src) events
registerDSListener
in interface DistributedState (src)
category
- Name of the private-space to watch forsubscriber
- Object that will receive callbacks. Thispublic void unregisterDSListener(java.lang.String category, DistributedState.DSListener (src) subscriber)
DistributedState (src)
DistributedState.DSListener
(src) events
unregisterDSListener
in interface DistributedState (src)
category
- Name of the private-space dictionary currently observedsubscriber
- object currently observing this categorypublic void _set(java.lang.String category, java.lang.String key, java.io.Serializable value) throws java.lang.Exception
java.lang.Exception
public void _set(java.lang.String category, java.io.Serializable key, java.io.Serializable value) throws java.lang.Exception
java.lang.Exception
public void _setInternal(java.lang.String category, java.io.Serializable key, java.io.Serializable value) throws java.lang.Exception
java.lang.Exception
public void _remove(java.lang.String category, java.lang.String key) throws java.lang.Exception
java.lang.Exception
public void _remove(java.lang.String category, java.io.Serializable key) throws java.lang.Exception
java.lang.Exception
public java.io.Serializable _removeInternal(java.lang.String category, java.io.Serializable key) throws java.lang.Exception
java.lang.Exception
public java.io.Serializable getCurrentState()
HAPartition.HAPartitionStateTransfer (src)
getCurrentState
in interface HAPartition.HAPartitionStateTransfer (src)
public void setCurrentState(java.io.Serializable newState)
HAPartition.HAPartitionStateTransfer (src)
setCurrentState
in interface HAPartition.HAPartitionStateTransfer (src)
newState
- The serialized representation of the state of the new service.protected void registerListener(java.lang.String category, java.lang.Object subscriber)
protected void unregisterListener(java.lang.String category, java.lang.Object subscriber)
protected void notifyKeyListeners(java.lang.String category, java.io.Serializable key, java.io.Serializable value, boolean locallyModified)
protected void notifyKeyListenersOfRemove(java.lang.String category, java.io.Serializable key, java.io.Serializable oldContent, boolean locallyModified)
protected void cleanupKeyListeners()
|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |