org.objectweb.proactive.core.body
Class BodyMap

java.lang.Object
  |
  +--org.objectweb.proactive.core.event.AbstractEventProducer
        |
        +--org.objectweb.proactive.core.body.BodyMap
All Implemented Interfaces:
java.lang.Cloneable, java.io.Externalizable, java.io.Serializable

public class BodyMap
extends AbstractEventProducer
implements java.lang.Cloneable, java.io.Externalizable

**For internal use only**

This class is a Map between UniqueID and either remote or local bodies. It accepts event listeners interested in BodyEvent. Body event are produced whenever a body is added or removed from the collection.

In case of serialization of a object of this class, all reference to local bodies will get serialized as reference of remote body. Local bodies are never serialized from this container.

Since:
ProActive 0.9
Version:
1.1, 2001/12/23
Author:
ProActive Team
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class org.objectweb.proactive.core.event.AbstractEventProducer
AbstractEventProducer.ListenerList
 
Field Summary
 
Fields inherited from class org.objectweb.proactive.core.event.AbstractEventProducer
eventListeners, logger, shouldSerializeListeners
 
Constructor Summary
BodyMap()
           
 
Method Summary
 void addBodyEventListener(BodyEventListener listener)
           
 java.util.Iterator bodiesIterator()
           
 java.lang.Object clone()
           
 boolean containsBody(UniqueID id)
           
 UniversalBody getBody(UniqueID id)
           
protected  void notifyOneListener(ProActiveListener listener, ProActiveEvent event)
          Notifies one listener with the event.
 void putBody(UniqueID id, UniversalBody b)
          add the set (id, node) in the idToBodyMap block if it already exists until it is removed
 void readExternal(java.io.ObjectInput in)
          The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays.
 void removeBody(UniqueID id)
           
 void removeBodyEventListener(BodyEventListener listener)
           
 int size()
           
 java.lang.String toString()
           
 void updateBody(UniqueID id, UniversalBody b)
          add the set (id, node) in the idToBodyMap erase any previous entry
 void writeExternal(java.io.ObjectOutput out)
          The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.
 
Methods inherited from class org.objectweb.proactive.core.event.AbstractEventProducer
addListener, hasListeners, notifyAllListeners, removeListener
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BodyMap

public BodyMap()
Method Detail

putBody

public void putBody(UniqueID id,
                    UniversalBody b)
add the set (id, node) in the idToBodyMap block if it already exists until it is removed


updateBody

public void updateBody(UniqueID id,
                       UniversalBody b)
add the set (id, node) in the idToBodyMap erase any previous entry


removeBody

public void removeBody(UniqueID id)

size

public int size()

getBody

public UniversalBody getBody(UniqueID id)

containsBody

public boolean containsBody(UniqueID id)

bodiesIterator

public java.util.Iterator bodiesIterator()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

addBodyEventListener

public void addBodyEventListener(BodyEventListener listener)

removeBodyEventListener

public void removeBodyEventListener(BodyEventListener listener)

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays.

Specified by:
readExternal in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.

Specified by:
writeExternal in interface java.io.Externalizable
java.io.IOException

notifyOneListener

protected void notifyOneListener(ProActiveListener listener,
                                 ProActiveEvent event)
Description copied from class: AbstractEventProducer
Notifies one listener with the event.

Specified by:
notifyOneListener in class AbstractEventProducer


Copyright © April 2004 INRIA All Rights Reserved.