org.jboss.test.cluster.ds
Class DistributedStateUser

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport (src) 
      extended byorg.jboss.test.cluster.ds.DistributedStateUser
All Implemented Interfaces:
DistributedState.DSListenerEx (src) , IDistributedState (src) , NotificationBroadcaster (src) , NotificationEmitter (src)

public class DistributedStateUser
extends JBossNotificationBroadcasterSupport (src)
implements IDistributedState (src) , DistributedState.DSListenerEx (src)

Tests of the


Nested Class Summary
 
Nested classes inherited from class org.jboss.test.cluster.ds.IDistributedState (src)
IDistributedState.NotifyData (src)
 
Field Summary
protected  java.lang.String category
           
protected  DistributedState (src) entryMap
           
protected static Logger (src) log
           
protected  java.lang.String partitionName
           
protected  long sequence
           
 
Constructor Summary
DistributedStateUser()
           
 
Method Summary
 void flush()
          Remove all entries from the cache.
 java.io.Serializable get(java.io.Serializable key)
           
 java.lang.String getCategory()
           
 java.lang.String getPartitionName()
           
 void keyHasBeenRemoved(java.lang.String category, java.io.Serializable key, java.io.Serializable previousContent, boolean locallyModified)
          Called whenever a key has been removed from a category the called object had subscribed in.
 void put(java.io.Serializable key, java.io.Serializable value)
           
 void remove(java.io.Serializable key)
           
 void setCategory(java.lang.String category)
           
 void setPartitionName(java.lang.String partitionName)
           
 int size()
           
 void start()
           
 void stop()
           
 void valueHasChanged(java.lang.String category, java.io.Serializable key, java.io.Serializable value, boolean locallyModified)
          Called whenever a key has been added or modified in the category the called object has subscribed in.
 
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport (src)
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static Logger (src)  log

entryMap

protected DistributedState (src)  entryMap

category

protected java.lang.String category

partitionName

protected java.lang.String partitionName

sequence

protected long sequence
Constructor Detail

DistributedStateUser

public DistributedStateUser()
Method Detail

getPartitionName

public java.lang.String getPartitionName()

setPartitionName

public void setPartitionName(java.lang.String partitionName)

getCategory

public java.lang.String getCategory()

setCategory

public void setCategory(java.lang.String category)

start

public void start()
           throws java.lang.Exception
Throws:
java.lang.Exception

stop

public void stop()

get

public java.io.Serializable get(java.io.Serializable key)
Specified by:
get in interface IDistributedState (src)

put

public void put(java.io.Serializable key,
                java.io.Serializable value)
         throws java.lang.Exception
Specified by:
put in interface IDistributedState (src)
Throws:
java.lang.Exception

remove

public void remove(java.io.Serializable key)
            throws java.lang.Exception
Specified by:
remove in interface IDistributedState (src)
Throws:
java.lang.Exception

flush

public void flush()
Remove all entries from the cache.

Specified by:
flush in interface IDistributedState (src)

size

public int size()
Specified by:
size in interface IDistributedState (src)

valueHasChanged

public void valueHasChanged(java.lang.String category,
                            java.io.Serializable key,
                            java.io.Serializable value,
                            boolean locallyModified)
Description copied from interface: DistributedState.DSListenerEx (src)
Called whenever a key has been added or modified in the category the called object has subscribed in.

Specified by:
valueHasChanged in interface DistributedState.DSListenerEx (src)
Parameters:
category - The category of the modified/added entry
key - The key that has been added or its value modified
value - The new value of the key

keyHasBeenRemoved

public void keyHasBeenRemoved(java.lang.String category,
                              java.io.Serializable key,
                              java.io.Serializable previousContent,
                              boolean locallyModified)
Description copied from interface: DistributedState.DSListenerEx (src)
Called whenever a key has been removed from a category the called object had subscribed in.

Specified by:
keyHasBeenRemoved in interface DistributedState.DSListenerEx (src)
Parameters:
category - The category under which a key has been removed
key - The key that has been removed
previousContent - The previous content of the key that has been removed