org.objectweb.proactive.core.mop
Class MOP

java.lang.Object
  |
  +--org.objectweb.proactive.core.mop.MOP

public abstract class MOP
extends java.lang.Object

A place where static methods go


Field Summary
protected static java.lang.Class[] EMPTY_CLASS_ARRAY
          Class array representing no parameters
protected static java.lang.Object[] EMPTY_OBJECT_ARRAY
          Empty object array
protected static java.util.HashMap loadedClass
          As this class is center to the API, its static initializer is a good place to initialize general stuff.
protected static org.apache.log4j.Logger logger
           
protected static java.lang.Class[] PROXY_CONSTRUCTOR_PARAMETERS_TYPES_ARRAY
          Class array representing (Constructor Call, Object[])
protected static java.util.Hashtable proxyTable
          A Hashtable to cache (proxy class, proxy class constructor) couples
protected static java.util.Hashtable secondProxyTable
          A Hashtable to cache (Class name, proxy class name) couples this is meant for class-based reification
protected static MOPClassLoader singleton
           
protected static java.lang.Class STUB_OBJECT_INTERFACE
           
protected static java.lang.String STUB_OBJECT_INTERFACE_NAME
          The name of the interface that caracterizes all stub classes
protected static java.util.Hashtable stubTable
          A Hashtable to cache (reified class, stub class constructor) couples.
 
Constructor Summary
MOP()
           
 
Method Summary
protected static void addClassToCache(java.lang.String name, java.lang.Class cl)
           
static void checkClassIsReifiable(java.lang.Class cl)
           
protected static boolean checkNoArgsConstructor(java.lang.Class cl)
          Checks if class c has a noargs constructor
static java.lang.Class forName(java.lang.String s)
          Loads a class using standard classloader or a hashtable
static boolean isReifiedObject(java.lang.Object o)
          Checks if an object is a stub object Being a stub object is equivalent to implementing the StubObject interface
static java.lang.Class loadClass(java.lang.String name)
           
static java.lang.Object newInstance(java.lang.Class clazz, java.lang.Object[] constructorParameters, java.lang.String nameOfProxy, java.lang.Object[] proxyParameters)
           
static java.lang.Object newInstance(java.lang.Class stubClass, java.lang.String nameOfClass, java.lang.Object[] constructorParameters, java.lang.String nameOfProxy, java.lang.Object[] proxyParameters)
           
static java.lang.Object newInstance(java.lang.String nameOfClass, java.lang.Object[] constructorParameters, java.lang.String nameOfProxy, java.lang.Object[] proxyParameters)
          Creates an instance of an object
static java.lang.Object newInstance(java.lang.String nameOfStubClass, java.lang.String nameOfClass, java.lang.Object[] constructorParameters, java.lang.String nameOfProxy, java.lang.Object[] proxyParameters)
          Creates an instance of an object
static java.lang.Object turnReified(java.lang.String nameOfProxyClass, java.lang.Object[] proxyParameters, java.lang.Object target)
          Reifies an object
static java.lang.Object turnReified(java.lang.String nameOfStubClass, java.lang.String nameOfProxyClass, java.lang.Object[] proxyParameters, java.lang.Object target)
          Reifies an object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STUB_OBJECT_INTERFACE_NAME

protected static java.lang.String STUB_OBJECT_INTERFACE_NAME
The name of the interface that caracterizes all stub classes


STUB_OBJECT_INTERFACE

protected static java.lang.Class STUB_OBJECT_INTERFACE

logger

protected static org.apache.log4j.Logger logger

EMPTY_CLASS_ARRAY

protected static final java.lang.Class[] EMPTY_CLASS_ARRAY
Class array representing no parameters


EMPTY_OBJECT_ARRAY

protected static final java.lang.Object[] EMPTY_OBJECT_ARRAY
Empty object array


PROXY_CONSTRUCTOR_PARAMETERS_TYPES_ARRAY

protected static java.lang.Class[] PROXY_CONSTRUCTOR_PARAMETERS_TYPES_ARRAY
Class array representing (Constructor Call, Object[])


stubTable

protected static java.util.Hashtable stubTable
A Hashtable to cache (reified class, stub class constructor) couples.


proxyTable

protected static java.util.Hashtable proxyTable
A Hashtable to cache (proxy class, proxy class constructor) couples


secondProxyTable

protected static java.util.Hashtable secondProxyTable
A Hashtable to cache (Class name, proxy class name) couples this is meant for class-based reification


singleton

protected static MOPClassLoader singleton

loadedClass

protected static java.util.HashMap loadedClass
As this class is center to the API, its static initializer is a good place to initialize general stuff.

Constructor Detail

MOP

public MOP()
Method Detail

forName

public static java.lang.Class forName(java.lang.String s)
                               throws java.lang.ClassNotFoundException
Loads a class using standard classloader or a hashtable

Parameters:
s - the name of the class to fetch
Returns:
the Class object representing class s
java.lang.ClassNotFoundException

newInstance

public static java.lang.Object newInstance(java.lang.String nameOfClass,
                                           java.lang.Object[] constructorParameters,
                                           java.lang.String nameOfProxy,
                                           java.lang.Object[] proxyParameters)
                                    throws java.lang.ClassNotFoundException,
                                           ClassNotReifiableException,
                                           InvalidProxyClassException,
                                           ConstructionOfProxyObjectFailedException,
                                           ConstructionOfReifiedObjectFailedException
Creates an instance of an object

Parameters:
nameOfClass - The class to instanciate
constructorParameters - Array of the constructor's parameters [wrapper]
nameOfProxy - The name of its proxy class
proxyParameters - The array holding the proxy parameter
java.lang.ClassNotFoundException
ClassNotReifiableException
InvalidProxyClassException
ConstructionOfProxyObjectFailedException
ConstructionOfReifiedObjectFailedException

newInstance

public static java.lang.Object newInstance(java.lang.Class clazz,
                                           java.lang.Object[] constructorParameters,
                                           java.lang.String nameOfProxy,
                                           java.lang.Object[] proxyParameters)
                                    throws java.lang.ClassNotFoundException,
                                           ClassNotReifiableException,
                                           InvalidProxyClassException,
                                           ConstructionOfProxyObjectFailedException,
                                           ConstructionOfReifiedObjectFailedException
java.lang.ClassNotFoundException
ClassNotReifiableException
InvalidProxyClassException
ConstructionOfProxyObjectFailedException
ConstructionOfReifiedObjectFailedException

newInstance

public static java.lang.Object newInstance(java.lang.String nameOfStubClass,
                                           java.lang.String nameOfClass,
                                           java.lang.Object[] constructorParameters,
                                           java.lang.String nameOfProxy,
                                           java.lang.Object[] proxyParameters)
                                    throws java.lang.ClassNotFoundException,
                                           ClassNotReifiableException,
                                           ReifiedCastException,
                                           InvalidProxyClassException,
                                           ConstructionOfProxyObjectFailedException,
                                           ConstructionOfReifiedObjectFailedException
Creates an instance of an object

Parameters:
nameOfStubClass - The name of the Stub class corresponding to the object
nameOfClass - The class to instanciate
constructorParameters - Array of the constructor's parameters [wrapper]
nameOfProxy - The name of its proxy class
proxyParameters - The array holding the proxy parameter
java.lang.ClassNotFoundException
ClassNotReifiableException
ReifiedCastException
InvalidProxyClassException
ConstructionOfProxyObjectFailedException
ConstructionOfReifiedObjectFailedException

newInstance

public static java.lang.Object newInstance(java.lang.Class stubClass,
                                           java.lang.String nameOfClass,
                                           java.lang.Object[] constructorParameters,
                                           java.lang.String nameOfProxy,
                                           java.lang.Object[] proxyParameters)
                                    throws java.lang.ClassNotFoundException,
                                           ClassNotReifiableException,
                                           ReifiedCastException,
                                           InvalidProxyClassException,
                                           ConstructionOfProxyObjectFailedException,
                                           ConstructionOfReifiedObjectFailedException
java.lang.ClassNotFoundException
ClassNotReifiableException
ReifiedCastException
InvalidProxyClassException
ConstructionOfProxyObjectFailedException
ConstructionOfReifiedObjectFailedException

turnReified

public static java.lang.Object turnReified(java.lang.String nameOfProxyClass,
                                           java.lang.Object[] proxyParameters,
                                           java.lang.Object target)
                                    throws java.lang.ClassNotFoundException,
                                           ClassNotReifiableException,
                                           InvalidProxyClassException,
                                           ConstructionOfProxyObjectFailedException
Reifies an object

Parameters:
nameOfProxyClass - the name of the object's proxy
proxyParameters - Array holding the proxy parameters
target - the object to reify
java.lang.ClassNotFoundException
ClassNotReifiableException
InvalidProxyClassException
ConstructionOfProxyObjectFailedException

turnReified

public static java.lang.Object turnReified(java.lang.String nameOfStubClass,
                                           java.lang.String nameOfProxyClass,
                                           java.lang.Object[] proxyParameters,
                                           java.lang.Object target)
                                    throws java.lang.ClassNotFoundException,
                                           ReifiedCastException,
                                           ClassNotReifiableException,
                                           InvalidProxyClassException,
                                           ConstructionOfProxyObjectFailedException
Reifies an object

Parameters:
nameOfProxyClass - the name of the object's proxy
nameOfStubClass - The name of the object's stub class
proxyParameters - Array holding the proxy parameters
target - the object to reify
java.lang.ClassNotFoundException
ReifiedCastException
ClassNotReifiableException
InvalidProxyClassException
ConstructionOfProxyObjectFailedException

checkClassIsReifiable

public static void checkClassIsReifiable(java.lang.Class cl)
                                  throws ClassNotReifiableException
ClassNotReifiableException

checkNoArgsConstructor

protected static boolean checkNoArgsConstructor(java.lang.Class cl)
Checks if class c has a noargs constructor


isReifiedObject

public static boolean isReifiedObject(java.lang.Object o)
Checks if an object is a stub object Being a stub object is equivalent to implementing the StubObject interface

Parameters:
o - the object to check
Returns:
true if it is a stub object, false otherwise

addClassToCache

protected static void addClassToCache(java.lang.String name,
                                      java.lang.Class cl)

loadClass

public static java.lang.Class loadClass(java.lang.String name)
                                 throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException


Copyright © April 2004 INRIA All Rights Reserved.