org.objectweb.proactive.core.body
Class LocalBodyStore

java.lang.Object
  extended byorg.objectweb.proactive.core.body.LocalBodyStore

public class LocalBodyStore
extends java.lang.Object

**For internal use only**

This class store all active bodies known in the current JVM. The class is a singleton in a given JVM. It also associates each active thread with its matching body.

Since:
ProActive 0.9
Version:
1.0, 2001/10/23
Author:
ProActive Team
See Also:
Body, UniqueID

Method Summary
 void addBodyEventListener(BodyEventListener listener)
          Adds a listener of body events.
 Body getCurrentThreadBody()
          Returns the body associated with the thread calling the method.
 Body getForwarder(UniqueID bodyID)
          Returns the forwarder belonging to this JVM whose ID is the one specified.
 MetaObjectFactory getHalfBodyMetaObjectFactory()
           
static LocalBodyStore getInstance()
           
 BodyMap getLocalBodies()
          Returns all local Bodies in a new BodyMap
 Body getLocalBody(UniqueID bodyID)
          Returns the body belonging to this JVM whose ID is the one specified.
 BodyMap getLocalHalfBodies()
          Returns all local HalfBodies in a new BodyMap
 Body getLocalHalfBody(UniqueID bodyID)
          Returns the halfbody belonging to this JVM whose ID is the one specified.
 void registerForwarder(AbstractBody body)
           
 void removeBodyEventListener(BodyEventListener listener)
          Removes a listener of body events.
 void setCurrentThreadBody(Body body)
          Associates the body with the thread calling the method.
 void setHalfBodyMetaObjectFactory(MetaObjectFactory factory)
           
 void unregisterForwarder(AbstractBody body)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static LocalBodyStore getInstance()

getHalfBodyMetaObjectFactory

public MetaObjectFactory getHalfBodyMetaObjectFactory()

setHalfBodyMetaObjectFactory

public void setHalfBodyMetaObjectFactory(MetaObjectFactory factory)

getCurrentThreadBody

public Body getCurrentThreadBody()
Returns the body associated with the thread calling the method. If no body is associated with the calling thread, an HalfBody is created to manage the futures.

Returns:
the body associated to the active object whose active thread is calling this method.

setCurrentThreadBody

public void setCurrentThreadBody(Body body)
Associates the body with the thread calling the method.

Parameters:
body - the body to associate to the active thread that calls this method.

getLocalBody

public Body getLocalBody(UniqueID bodyID)
Returns the body belonging to this JVM whose ID is the one specified. Returns null if a body with such an id is not found in this jvm

Parameters:
bodyID - the ID to look for
Returns:
the body with matching id or null

getLocalHalfBody

public Body getLocalHalfBody(UniqueID bodyID)
Returns the halfbody belonging to this JVM whose ID is the one specified. Returns null if a halfbody with such an id is not found in this jvm

Parameters:
bodyID - the ID to look for
Returns:
the halfbody with matching id or null

getForwarder

public Body getForwarder(UniqueID bodyID)
Returns the forwarder belonging to this JVM whose ID is the one specified. Returns null if a forwarder with such an id is not found in this jvm

Parameters:
bodyID - the ID to look for
Returns:
the halfbody with matching id or null

getLocalBodies

public BodyMap getLocalBodies()
Returns all local Bodies in a new BodyMap

Returns:
all local Bodies in a new BodyMap

getLocalHalfBodies

public BodyMap getLocalHalfBodies()
Returns all local HalfBodies in a new BodyMap

Returns:
all local HalfBodies in a new BodyMap

addBodyEventListener

public void addBodyEventListener(BodyEventListener listener)
Adds a listener of body events. The listener is notified every time a body (active or not) is registered or unregistered in this JVM.

Parameters:
listener - the listener of body events to add

removeBodyEventListener

public void removeBodyEventListener(BodyEventListener listener)
Removes a listener of body events.

Parameters:
listener - the listener of body events to remove

registerForwarder

public void registerForwarder(AbstractBody body)

unregisterForwarder

public void unregisterForwarder(AbstractBody body)


Copyright ? April 2005 INRIA All Rights Reserved.