|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.objectweb.proactive.ProActive
Field Summary | |
static java.util.HashMap |
codeLevel
Code level is used for temporary handlers |
static java.util.HashMap |
defaultLevel
This level is used for default handlers |
protected static org.apache.log4j.Logger |
logger
|
static java.util.HashMap |
VMLevel
VM level provides different strategies according to the virtual machine |
Method Summary | |
static void |
disableAC(java.lang.Object obj)
Disable the automatic continuation mechanism for this active object. |
static void |
enableAC(java.lang.Object obj)
Enable the automatic continuation mechanism for this active object. |
static Body |
getBodyOnThis()
When an active object is created, it is associated with a Body that takes care of all non fonctionnal properties. |
static java.lang.Object |
getFutureValue(java.lang.Object future)
Return the object contains by the future (ie its target). |
static java.lang.String |
getJobId()
|
static ProActiveDescriptor |
getProactiveDescriptor(java.lang.String xmlDescriptorUrl)
Returns a ProActiveDescriptor that gives an object representation
of the XML document located at the given url. |
static StubObject |
getStubOnThis()
Returns a Stub-Proxy couple pointing to the local body associated to the active object whose active thread is calling this method. |
static boolean |
isAwaited(java.lang.Object future)
Return false if the object future is available.
|
static java.lang.Object |
lookupActive(java.lang.String classname,
java.lang.String url)
Looks-up an active object previously registered in a RMI registry. |
static VirtualNode |
lookupVirtualNode(java.lang.String url,
java.lang.String protocol)
Looks-up a VirtualNode previously registered in a registry(RMI or JINI) |
static void |
migrateTo(Body bodyToMigrate,
Node node,
boolean priority)
Migrates the body bodyToMigrate to the given node.
|
static void |
migrateTo(Body bodyToMigrate,
java.lang.Object activeObject,
boolean priority)
Migrates the given body to the same location as the active object given in parameter. |
static void |
migrateTo(Body bodyToMigrate,
java.lang.String nodeURL,
boolean priority)
Migrates the given body to the node caracterized by the given url. |
static void |
migrateTo(Node node)
Migrates the active object whose active thread is calling this method to the given node. |
static void |
migrateTo(java.lang.Object activeObject)
Migrates the active object whose active thread is calling this method to the same location as the active object given in parameter. |
static void |
migrateTo(java.lang.String nodeURL)
Migrates the active object whose active thread is calling this method to the node caracterized by the given url. |
static java.lang.Object |
newActive(java.lang.String classname,
java.lang.Object[] constructorParameters)
Creates a new ActiveObject based on classname attached to a default node in the local JVM. |
static java.lang.Object |
newActive(java.lang.String classname,
java.lang.Object[] constructorParameters,
Node node)
Creates a new ActiveObject based on classname attached to the given node or on a default node in the local JVM if the given node is null. |
static java.lang.Object |
newActive(java.lang.String classname,
java.lang.Object[] constructorParameters,
Node node,
Active activity,
MetaObjectFactory factory)
Creates a new ActiveObject based on classname attached to the given node or on a default node in the local JVM if the given node is null. |
static java.lang.Object |
newActive(java.lang.String classname,
java.lang.Object[] constructorParameters,
java.lang.String nodeURL)
Creates a new ActiveObject based on classname attached to the node of the given URL. |
static java.lang.Object |
newActive(java.lang.String classname,
java.lang.Object[] constructorParameters,
VirtualNode virtualnode)
Creates a new set of active objects based on classname attached to the given virtualnode. |
static java.lang.Object |
newActive(java.lang.String classname,
java.lang.Object[] constructorParameters,
VirtualNode virtualnode,
Active activity,
MetaObjectFactory factory)
Creates a new ActiveObject based on classname attached to the given virtualnode. |
static Component |
newActiveComponent(java.lang.String classname,
java.lang.Object[] constructorParameters,
Node node,
Active activity,
MetaObjectFactory factory,
ComponentParameters componentParameters)
Creates a new ProActive component over the specified base class, according to the given component parameters, and returns a reference on the component of type Component. |
static Component |
newActiveComponent(java.lang.String className,
java.lang.Object[] constructorParameters,
VirtualNode vn,
ComponentParameters componentParameters)
Creates a new ProActive component over the specified base class, according to the given component parameters, and returns a reference on the component of type Component. |
static void |
register(java.lang.Object obj,
java.lang.String url)
Registers an active object into a RMI registry. |
static void |
registerVirtualNode(VirtualNode virtualNode,
java.lang.String registrationProtocol,
boolean replacePreviousBinding)
Registers locally the given VirtualNode in a registry such RMIRegistry or JINI Lookup Service. |
static IHandler |
searchExceptionHandler(NonFunctionalException ex)
Search an appropriate handler for a given non functional exception. |
static IHandler |
searchExceptionHandler(NonFunctionalException ex,
java.util.HashMap level,
int levelID)
Search an appropriate handler for a given non functional exception. |
static void |
setExceptionHandler(int ID_level,
java.lang.Object obj,
java.lang.Class hName,
java.lang.Class exName)
Add a new handler to a specific level. |
static void |
setImmediateService(java.lang.Object obj,
java.lang.String methodName)
Set an immmediate execution for the active object obj, ie request of name methodName will be executed by the calling thread, and not add in the request queue. |
static java.lang.Object |
turnActive(java.lang.Object target)
Turns the target object into an ActiveObject attached to a default node in the local JVM. |
static java.lang.Object |
turnActive(java.lang.Object target,
Node node)
Turns the target object into an Active Object and send it to the given Node or to a default node in the local JVM if the given node is null. |
static java.lang.Object |
turnActive(java.lang.Object target,
Node node,
Active activity,
MetaObjectFactory factory)
Turns the target object into an Active Object and send it to the given Node or to a default node in the local JVM if the given node is null. |
static java.lang.Object |
turnActive(java.lang.Object target,
java.lang.String nodeURL)
Turns the target object into an Active Object and send it to the Node identified by the given url. |
static java.lang.Object |
turnActive(java.lang.Object target,
java.lang.String nameOfTargetType,
Node node)
Turns a Java object into an Active Object and send it to a remote Node or to a local node if the given node is null. |
static java.lang.Object |
turnActive(java.lang.Object target,
java.lang.String nameOfTargetType,
Node node,
Active activity,
MetaObjectFactory factory)
Turns a Java object into an Active Object and send it to a remote Node or to a local node if the given node is null. |
static java.lang.Object |
turnActive(java.lang.Object target,
java.lang.String nameOfTargetType,
VirtualNode virtualnode)
Turns a Java object into an Active Object and send it to remote Nodes mapped to the given virtualnode in the XML deployment descriptor. |
static void |
unregister(java.lang.String url)
Unregisters an active object previously registered into a RMI registry. |
static void |
unregisterVirtualNode(VirtualNode virtualNode)
Unregisters the virtualNode previoulsy registered in a registry such as JINI or RMI. |
static IHandler |
unsetExceptionHandler(int ID_level,
java.lang.Object obj,
java.lang.Class exName)
Remove the handler associated to a non functional exception. |
static void |
waitFor(java.lang.Object future)
Blocks the calling thread until the object future
is available. |
static void |
waitForAll(java.util.Vector futures)
Blocks the calling thread until all futures in the vector are available. |
static int |
waitForAny(java.util.Vector futures)
Blocks the calling thread until one of the futures in the vector is available. |
static void |
waitForTheNth(java.util.Vector futures,
int n)
Blocks the calling thread until the N-th of the futures in the vector is available. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static org.apache.log4j.Logger logger
public static java.util.HashMap defaultLevel
public static java.util.HashMap VMLevel
public static java.util.HashMap codeLevel
Method Detail |
public static java.lang.Object newActive(java.lang.String classname, java.lang.Object[] constructorParameters) throws ActiveObjectCreationException, NodeException
classname
- the name of the class to instanciate as activeconstructorParameters
- the parameters of the constructor.
ActiveObjectCreationException
- if a problem occur while creating the stub or the body
NodeException
- if the DefaultNode cannot be createdpublic static java.lang.Object newActive(java.lang.String classname, java.lang.Object[] constructorParameters, java.lang.String nodeURL) throws ActiveObjectCreationException, NodeException
classname
- the name of the class to instanciate as activeconstructorParameters
- the parameters of the constructor.nodeURL
- the URL of the node where to create the active object. If null, the active object
is created localy on a default node
ActiveObjectCreationException
- if a problem occur while creating the stub or the body
NodeException
- if the node URL cannot be resolved as an existing Nodepublic static java.lang.Object newActive(java.lang.String classname, java.lang.Object[] constructorParameters, Node node) throws ActiveObjectCreationException, NodeException
classname
- the name of the class to instanciate as activeconstructorParameters
- the parameters of the constructor.node
- the possibly null node where to create the active object.
ActiveObjectCreationException
- if a problem occur while creating the stub or the body
NodeException
- if the node was null and that the DefaultNode cannot be createdpublic static java.lang.Object newActive(java.lang.String classname, java.lang.Object[] constructorParameters, Node node, Active activity, MetaObjectFactory factory) throws ActiveObjectCreationException, NodeException
classname
- the name of the class to instanciate as activeconstructorParameters
- the parameters of the constructor of the object
to instantiate as active. If some parameters are primitive types, the wrapper
class types should be given here. null can be used to specify that no parameter
are passed to the constructor.node
- the possibly null node where to create the active object. If null, the active object
is created localy on a default nodeactivity
- the possibly null activity object defining the different step in the activity of the object.
see the definition of the activity in the javadoc of this classe for more information.factory
- the possibly null meta factory giving all factories for creating the meta-objects part of the
body associated to the reified object. If null the default ProActive MataObject factory is used.
ActiveObjectCreationException
- if a problem occur while creating the stub or the body
NodeException
- if the node was null and that the DefaultNode cannot be createdpublic static java.lang.Object newActive(java.lang.String classname, java.lang.Object[] constructorParameters, VirtualNode virtualnode) throws ActiveObjectCreationException, NodeException
classname
- classname the name of the class to instanciate as activeconstructorParameters
- constructorParameters the parameters of the constructor.virtualnode
- The virtualnode where to create active objects. Active objects will be created
on each node mapped to the given virtualnode in XML deployment descriptor.
ActiveObjectCreationException
- if a problem occur while creating the stub or the body
NodeException
- if the virtualnode was nullpublic static java.lang.Object newActive(java.lang.String classname, java.lang.Object[] constructorParameters, VirtualNode virtualnode, Active activity, MetaObjectFactory factory) throws ActiveObjectCreationException, NodeException
classname
- classname the name of the class to instanciate as activeconstructorParameters
- constructorParameters the parameters of the constructor.virtualnode
- The virtualnode where to create active objects. Active objects will be created
on each node mapped to the given virtualnode in XML deployment descriptor.activity
- the possibly null activity object defining the different step in the activity of the object.
see the definition of the activity in the javadoc of this classe for more information.factory
- the possibly null meta factory giving all factories for creating the meta-objects part of the
body associated to the reified object. If null the default ProActive MataObject factory is used.
ActiveObjectCreationException
- if a problem occur while creating the stub or the body
NodeException
- if the virtualnode was nullpublic static Component newActiveComponent(java.lang.String classname, java.lang.Object[] constructorParameters, Node node, Active activity, MetaObjectFactory factory, ComponentParameters componentParameters) throws ActiveObjectCreationException, NodeException
classname
- the name of the base class. "Composite" if the component is a composite,
"ParallelComposite" if the component is a parallel composite componentconstructorParameters
- the parameters of the constructor of the object
to instantiate as active. If some parameters are primitive types, the wrapper
class types should be given here. null can be used to specify that no parameter
are passed to the constructor.node
- the possibly null node where to create the active object. If null, the active object
is created localy on a default nodeactivity
- the possibly null activity object defining the different step in the activity of the object.
see the definition of the activity in the javadoc of this classe for more information.factory
- should be null for components (automatically created)componentParameters
- the parameters of the component
ActiveObjectCreationException
- if a problem occurs while creating the stub or the body
NodeException
- if the node was null and that the DefaultNode cannot be createdpublic static Component newActiveComponent(java.lang.String className, java.lang.Object[] constructorParameters, VirtualNode vn, ComponentParameters componentParameters) throws ActiveObjectCreationException, NodeException
constructorParameters
- the parameters of the constructor of the object
to instantiate as active. If some parameters are primitive types, the wrapper
class types should be given here. null can be used to specify that no parameter
are passed to the constructor.componentParameters
- the parameters of the component
ActiveObjectCreationException
- if a problem occurs while creating the stub or the body
NodeException
- if the node was null and that the DefaultNode cannot be createdpublic static java.lang.Object turnActive(java.lang.Object target) throws ActiveObjectCreationException, NodeException
target
- The object to turn active
ActiveObjectCreationException
- if a problem occur while creating the stub or the body
NodeException
- if the DefaultNode cannot be createdpublic static java.lang.Object turnActive(java.lang.Object target, java.lang.String nodeURL) throws ActiveObjectCreationException, NodeException
target
- The object to turn activenodeURL
- the URL of the node where to create the active object on. If null, the active object
is created localy on a default node
ActiveObjectCreationException
- if a problem occur while creating the stub or the body
NodeException
- if the node was null and that the DefaultNode cannot be createdpublic static java.lang.Object turnActive(java.lang.Object target, Node node) throws ActiveObjectCreationException, NodeException
target
- The object to turn activenode
- The Node the object should be sent to or null to create the active
object in the local JVM
ActiveObjectCreationException
- if a problem occur while creating the stub or the body
NodeException
- if the node was null and that the DefaultNode cannot be createdpublic static java.lang.Object turnActive(java.lang.Object target, Node node, Active activity, MetaObjectFactory factory) throws ActiveObjectCreationException, NodeException
target
- The object to turn activenode
- The Node the object should be sent to or null to create the active
object in the local JVMactivity
- the possibly null activity object defining the different step in the activity of the object.
see the definition of the activity in the javadoc of this classe for more information.factory
- the possibly null meta factory giving all factories for creating the meta-objects part of the
body associated to the reified object. If null the default ProActive MataObject factory is used.
ActiveObjectCreationException
- if a problem occur while creating the stub or the body
NodeException
- if the node was null and that the DefaultNode cannot be createdpublic static java.lang.Object turnActive(java.lang.Object target, java.lang.String nameOfTargetType, Node node) throws ActiveObjectCreationException, NodeException
nameOfTargetType
.
target
- The object to turn activenameOfTargetType
- the fully qualified name of the type the stub class should
inherit from. That type can be less specific than the type of the target object.node
- The Node the object should be sent to or null to create the active
object in the local JVM
ActiveObjectCreationException
- if a problem occur while creating the stub or the body
NodeException
- if the node was null and that the DefaultNode cannot be createdpublic static java.lang.Object turnActive(java.lang.Object target, java.lang.String nameOfTargetType, Node node, Active activity, MetaObjectFactory factory) throws ActiveObjectCreationException, NodeException
nameOfTargetType
.
A Stub is dynamically generated for the existing object. The result of the call
will be an instance of the Stub class pointing to the proxy object pointing
to the body object pointing to the existing object. The body can be remote
or local depending if the existing is sent remotely or not.
target
- The object to turn activenameOfTargetType
- the fully qualified name of the type the stub class should
inherit from. That type can be less specific than the type of the target object.node
- The Node the object should be sent to or null to create the active
object in the local JVMactivity
- the possibly null activity object defining the different step in the activity of the object.
see the definition of the activity in the javadoc of this classe for more information.factory
- the possibly null meta factory giving all factories for creating the meta-objects part of the
body associated to the reified object. If null the default ProActive MataObject factory is used.
ActiveObjectCreationException
- if a problem occur while creating the stub or the body
NodeException
- if the node was null and that the DefaultNode cannot be createdpublic static java.lang.Object turnActive(java.lang.Object target, java.lang.String nameOfTargetType, VirtualNode virtualnode) throws ActiveObjectCreationException, NodeException
nameOfTargetType
.
target
- The object to turn activenameOfTargetType
- the fully qualified name of the type the stub class should
inherit from. That type can be less specific than the type of the target object.virtualnode
- The VirtualNode where the target object will be turn into an Active Object
Target object will be turned into an Active Object on each node mapped to the given virtualnode in XML deployment descriptor.
ActiveObjectCreationException
- if a problem occur while creating the stub or the body
NodeException
- if the node was null and that the DefaultNode cannot be createdpublic static void register(java.lang.Object obj, java.lang.String url) throws java.io.IOException
obj
- the active object to register.url
- the url under which the remote body is registered.
java.io.IOException
- if the remote body cannot be registeredpublic static void unregister(java.lang.String url) throws java.io.IOException
url
- the url under which the active object is registered.
java.io.IOException
- if the remote object cannot be removed from the registrypublic static java.lang.Object lookupActive(java.lang.String classname, java.lang.String url) throws ActiveObjectCreationException, java.io.IOException
classname
- the fully qualified name of the class the stub should inherit from.url
- the url under which the remote body is registered.
classname
pointing to the
remote body found
java.io.IOException
- if the remote body cannot be found under the given url
or if the object found is not of type RemoteBody
ActiveObjectCreationException
- if the stub-proxy couple cannot be createdpublic static void waitFor(java.lang.Object future)
future
is available. future
must be the result object of an
asynchronous call. Usually the the wait by necessity model take care
of blocking the caller thread asking for a result not yet available.
This method allows to block before the result is first used.
public static ProActiveDescriptor getProactiveDescriptor(java.lang.String xmlDescriptorUrl) throws ProActiveException
ProActiveDescriptor
that gives an object representation
of the XML document located at the given url.
ProActiveException
- if a problem occurs during the creation of the objectProActiveDescriptor
,
VirtualNode
,
VirtualMachine
public static void registerVirtualNode(VirtualNode virtualNode, java.lang.String registrationProtocol, boolean replacePreviousBinding) throws ProActiveException
virtualNode
- the VirtualNode to register.registrationProtocol
- The protocol used for registration. At this time RMI and JINI are supportedreplacePreviousBinding
-
ProActiveException
- If the VirtualNode with the given name does not exist on the local runtimepublic static VirtualNode lookupVirtualNode(java.lang.String url, java.lang.String protocol) throws ProActiveException
url
- The url where to perform the lookupprotocol
- The protocol used to perform the lookup(RMI and JINI are supported)
ProActiveException
- If no objects are bound with the given urlpublic static void unregisterVirtualNode(VirtualNode virtualNode) throws ProActiveException
virtualNode
- The VirtualNode to unregister
ProActiveException
- if a problem occurs whle unregistering the VirtualNodepublic static Body getBodyOnThis()
public static StubObject getStubOnThis()
getBodyOnThis()
public static void migrateTo(java.lang.Object activeObject) throws MigrationException
activeObject
- the active object indicating the destination of the migration.
MigrationException
- if the migration failsgetBodyOnThis()
public static void migrateTo(java.lang.String nodeURL) throws MigrationException
nodeURL
- the url of an existing where to migrate to.
MigrationException
- if the migration failsgetBodyOnThis()
public static void migrateTo(Node node) throws MigrationException
node
- an existing node where to migrate to.
MigrationException
- if the migration failsgetBodyOnThis()
public static void migrateTo(Body bodyToMigrate, java.lang.Object activeObject, boolean priority) throws MigrationException
bodyToMigrate
- the body to migrate.activeObject
- the active object indicating the destination of the migration.priority
- a boolean indicating the priority of the migration request sent to the body.
MigrationException
- if the migration failspublic static void migrateTo(Body bodyToMigrate, java.lang.String nodeURL, boolean priority) throws MigrationException
bodyToMigrate
- the body to migrate.nodeURL
- the url of an existing where to migrate to.priority
- a boolean indicating the priority of the migration request sent to the body.
MigrationException
- if the migration failspublic static void migrateTo(Body bodyToMigrate, Node node, boolean priority) throws MigrationException
bodyToMigrate
to the given node.
This method can be called from any object and does not perform the migration.
Instead it generates a migration request that is sent to the targeted body.
Two strategies are possible :
- the request is high priority and is processed before all existing requests
the body may have received (priority = true)
- the request is normal priority and is processed after all existing requests
the body may have received (priority = false)
The object given as destination must be an active object.
bodyToMigrate
- the body to migrate.node
- an existing node where to migrate to.priority
- a boolean indicating the priority of the migration request sent to the body.
MigrationException
- if the migration failspublic static int waitForAny(java.util.Vector futures)
futures
- vector of futures
public static void waitForAll(java.util.Vector futures)
futures
- vector of futurespublic static void waitForTheNth(java.util.Vector futures, int n)
futures
- vector of futurespublic static boolean isAwaited(java.lang.Object future)
future
is available.
This method is recursive, i.e. if result of future is a future too,
isAwaited
is called again on this result, and so on.
public static java.lang.Object getFutureValue(java.lang.Object future)
getFutureValue
is called again on this result, and so on.
public static void enableAC(java.lang.Object obj) throws java.io.IOException
java.io.IOException
public static void disableAC(java.lang.Object obj) throws java.io.IOException
java.io.IOException
public static void setImmediateService(java.lang.Object obj, java.lang.String methodName) throws java.io.IOException
java.io.IOException
public static java.lang.String getJobId()
public static IHandler searchExceptionHandler(NonFunctionalException ex)
ex
- Exception for which we search a handler.
public static IHandler searchExceptionHandler(NonFunctionalException ex, java.util.HashMap level, int levelID)
ex
- Exception for which we search a handler.level
- The level where handlers are searched
public static void setExceptionHandler(int ID_level, java.lang.Object obj, java.lang.Class hName, java.lang.Class exName)
obj
- The object containing a level. It is set to null if the ID_level
represents default or VM level.hName
- The handler associated to a non functional exception.exName
- The class of the non functional exception which require a handler. It must be a subclass of NonFunctionalException
.public static IHandler unsetExceptionHandler(int ID_level, java.lang.Object obj, java.lang.Class exName)
obj
- The object containing a level. It is set to null if the ID_level
represents default or VM level.exName
- A non functional exception whoch does not require handler anymore at the given level.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |