org.apache.geronimo.messaging.replication
Class SimpleReplicatedMap

java.lang.Object
  extended byorg.apache.geronimo.messaging.replication.SimpleReplicatedMap
All Implemented Interfaces:
Map, ReplicationCapable, Serializable

public class SimpleReplicatedMap
extends Object
implements Map, ReplicationCapable

A simple Map, which is ReplicationCapable aware.

Version:
$Revision: 1.1 $ $Date: 2004/05/11 12:06:40 $
See Also:
Serialized Form

Nested Class Summary
static class SimpleReplicatedMap.MapUpdateEvent
           
 
Nested classes inherited from class java.util.Map
Map.Entry
 
Constructor Summary
SimpleReplicatedMap()
           
 
Method Summary
 void addUpdateListener(UpdateListener aListener)
          Adds an UpdateEvent listener.
 void clear()
           
 boolean containsKey(Object key)
           
 boolean containsValue(Object value)
           
 Set entrySet()
           
 boolean equals(Object obj)
           
 Object get(Object key)
           
 Object getID()
          Identifier of this ReplicationCapable.
 int hashCode()
           
 boolean isEmpty()
           
 Set keySet()
           
 void mergeWithUpdate(UpdateEvent anEvent)
          Merges an UpdateEvent with the state of this instance.
 Object put(Object key, Object value)
           
 void putAll(Map t)
           
 Object remove(Object key)
           
 void removeUpdateListener(UpdateListener aListener)
          Removes the specified UpdateListener.
 void setID(Object anID)
          Sets the identifier of this instance in the scope of the replication group managing it.
 int size()
           
 Collection values()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleReplicatedMap

public SimpleReplicatedMap()
Method Detail

setID

public void setID(Object anID)
Description copied from interface: ReplicationCapable
Sets the identifier of this instance in the scope of the replication group managing it.

Specified by:
setID in interface ReplicationCapable
Parameters:
anID - Identifier.

getID

public Object getID()
Description copied from interface: ReplicationCapable
Identifier of this ReplicationCapable. It identifies uniquely the instance in the scope of a replication group.
Identifiers are automatically created by ReplicationMembers upon registration.

Specified by:
getID in interface ReplicationCapable
Returns:
Identifier of this instance.

addUpdateListener

public void addUpdateListener(UpdateListener aListener)
Description copied from interface: ReplicationCapable
Adds an UpdateEvent listener.

Specified by:
addUpdateListener in interface ReplicationCapable
Parameters:
aListener - Listener to be notified when an update is performed on this instance.

removeUpdateListener

public void removeUpdateListener(UpdateListener aListener)
Description copied from interface: ReplicationCapable
Removes the specified UpdateListener.

Specified by:
removeUpdateListener in interface ReplicationCapable
Parameters:
aListener - Listener to be removed.

mergeWithUpdate

public void mergeWithUpdate(UpdateEvent anEvent)
                     throws ReplicationException
Description copied from interface: ReplicationCapable
Merges an UpdateEvent with the state of this instance.

Specified by:
mergeWithUpdate in interface ReplicationCapable
Parameters:
anEvent - UpdateEvent to be merged with this instance.
Throws:
ReplicationException - Indicates that the merge can not be performed.

clear

public void clear()
Specified by:
clear in interface Map

containsKey

public boolean containsKey(Object key)
Specified by:
containsKey in interface Map

containsValue

public boolean containsValue(Object value)
Specified by:
containsValue in interface Map

entrySet

public Set entrySet()
Specified by:
entrySet in interface Map

equals

public boolean equals(Object obj)
Specified by:
equals in interface Map

get

public Object get(Object key)
Specified by:
get in interface Map

hashCode

public int hashCode()
Specified by:
hashCode in interface Map

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Map

keySet

public Set keySet()
Specified by:
keySet in interface Map

put

public Object put(Object key,
                  Object value)
Specified by:
put in interface Map

putAll

public void putAll(Map t)
Specified by:
putAll in interface Map

remove

public Object remove(Object key)
Specified by:
remove in interface Map

size

public int size()
Specified by:
size in interface Map

values

public Collection values()
Specified by:
values in interface Map


Copyright © 2003-2005 Apache Software Foundation. All Rights Reserved.