org.objectweb.proactive.core.body
Class LocalBodyStore

java.lang.Object
  |
  +--org.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.
 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 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)
           
 
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.


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

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


Copyright © April 2004 INRIA All Rights Reserved.