org.objectweb.proactive.core.component.asmgen
Class MetaObjectInterfaceClassGenerator

java.lang.Object
  |
  +--org.objectweb.proactive.core.component.asmgen.AbstractInterfaceClassGenerator
        |
        +--org.objectweb.proactive.core.component.asmgen.MetaObjectInterfaceClassGenerator
All Implemented Interfaces:
org.objectweb.asm.Constants

public class MetaObjectInterfaceClassGenerator
extends AbstractInterfaceClassGenerator

Creates Interface implementations for the functional interfaces of the component metaobject.
The functional calls are delegated to the "impl" field, whose value is set during binding operations.
- In case of a primitive component, the impl field will be the reified object to which the body is attached.
- In case of a composite component, the impl field will be a component representative.
- For a parallel component, the impl field will be a group of component representatives.

Author:
Matthieu Morel

Field Summary
protected  java.lang.Class cl
           
protected  java.lang.String className
           
protected static java.lang.String IMPL_FIELD_NAME
           
protected  boolean isPrimitive
           
protected static org.apache.log4j.Logger logger
           
protected  java.lang.String packageName
           
 
Fields inherited from class org.objectweb.proactive.core.component.asmgen.AbstractInterfaceClassGenerator
classGenerator, FUNCTIONAL_INTERFACE_NAME_FIELD_NAME, FUNCTIONAL_INTERFACE_NAME_TYPE, interfacesToImplement, METHOD_ARRAY_TYPE, METHOD_TYPE, METHODCALL_TYPE, methods, OBJECT_ARRAY_TYPE, OBJECT_TYPE, stubClassFullName, stubClassSimpleName, SUPER_CLASS_NAME
 
Fields inherited from interface org.objectweb.asm.Constants
AALOAD, AASTORE, ACC_ABSTRACT, ACC_BRIDGE, ACC_DEPRECATED, ACC_ENUM, ACC_FINAL, ACC_INTERFACE, ACC_NATIVE, ACC_PRIVATE, ACC_PROTECTED, ACC_PUBLIC, ACC_STATIC, ACC_STRICT, ACC_SUPER, ACC_SYNCHRONIZED, ACC_SYNTHETIC, ACC_TRANSIENT, ACC_VARARGS, ACC_VOLATILE, ACONST_NULL, ALOAD, ANEWARRAY, ARETURN, ARRAYLENGTH, ASTORE, ATHROW, BALOAD, BASTORE, BIPUSH, CALOAD, CASTORE, CHECKCAST, D2F, D2I, D2L, DADD, DALOAD, DASTORE, DCMPG, DCMPL, DCONST_0, DCONST_1, DDIV, DLOAD, DMUL, DNEG, DREM, DRETURN, DSTORE, DSUB, DUP, DUP_X1, DUP_X2, DUP2, DUP2_X1, DUP2_X2, F2D, F2I, F2L, FADD, FALOAD, FASTORE, FCMPG, FCMPL, FCONST_0, FCONST_1, FCONST_2, FDIV, FLOAD, FMUL, FNEG, FREM, FRETURN, FSTORE, FSUB, GETFIELD, GETSTATIC, GOTO, I2B, I2C, I2D, I2F, I2L, I2S, IADD, IALOAD, IAND, IASTORE, ICONST_0, ICONST_1, ICONST_2, ICONST_3, ICONST_4, ICONST_5, ICONST_M1, IDIV, IF_ACMPEQ, IF_ACMPNE, IF_ICMPEQ, IF_ICMPGE, IF_ICMPGT, IF_ICMPLE, IF_ICMPLT, IF_ICMPNE, IFEQ, IFGE, IFGT, IFLE, IFLT, IFNE, IFNONNULL, IFNULL, IINC, ILOAD, IMUL, INEG, INSTANCEOF, INVOKEINTERFACE, INVOKESPECIAL, INVOKESTATIC, INVOKEVIRTUAL, IOR, IREM, IRETURN, ISHL, ISHR, ISTORE, ISUB, IUSHR, IXOR, JSR, L2D, L2F, L2I, LADD, LALOAD, LAND, LASTORE, LCMP, LCONST_0, LCONST_1, LDC, LDIV, LLOAD, LMUL, LNEG, LOOKUPSWITCH, LOR, LREM, LRETURN, LSHL, LSHR, LSTORE, LSUB, LUSHR, LXOR, MONITORENTER, MONITOREXIT, MULTIANEWARRAY, NEW, NEWARRAY, NOP, POP, POP2, PUTFIELD, PUTSTATIC, RET, RETURN, SALOAD, SASTORE, SIPUSH, SWAP, T_BOOLEAN, T_BYTE, T_CHAR, T_DOUBLE, T_FLOAT, T_INT, T_LONG, T_SHORT, TABLESWITCH
 
Constructor Summary
MetaObjectInterfaceClassGenerator()
           
 
Method Summary
protected  void createDefaultMethods()
          implementation of abstract method from superclass
protected  void createFields()
          Method createFields.
protected  void createGetAndSetFcItfImplMethods()
           
protected  org.objectweb.asm.CodeVisitor createMethod(int methodIndex, java.lang.reflect.Method m)
          Method createMethod.
protected  void createStaticInitializer()
          Method createStaticInitializer.
protected  void createStaticVariables()
          Method createStaticVariables.
 ProActiveInterface generateInterface(java.lang.String fcInterfaceName, Component owner, InterfaceType interfaceType, boolean isInternal, boolean isPrimitive)
           
static byte[] getClassData(java.lang.String classname)
          retreives the bytecode associated to the generated class of the given name
static java.util.Hashtable getGeneratedClassesCache()
          Returns the generatedClassesCache.
static MetaObjectInterfaceClassGenerator instance()
           
 
Methods inherited from class org.objectweb.proactive.core.component.asmgen.AbstractInterfaceClassGenerator
convertJavaModifierToASM, create, createClassGenerator, createConstructor, createMethodGenerator, createReturnCode, createUnwrappingCode, defineClass, getOpcodeOffset, getSize, getStubClassFullName, loadClass, removeNativeAndAbstractModifiers, setInfos
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static org.apache.log4j.Logger logger

IMPL_FIELD_NAME

protected static final java.lang.String IMPL_FIELD_NAME
See Also:
Constant Field Values

cl

protected java.lang.Class cl

className

protected java.lang.String className

packageName

protected java.lang.String packageName

isPrimitive

protected boolean isPrimitive
Constructor Detail

MetaObjectInterfaceClassGenerator

public MetaObjectInterfaceClassGenerator()
Method Detail

instance

public static MetaObjectInterfaceClassGenerator instance()

getClassData

public static byte[] getClassData(java.lang.String classname)
retreives the bytecode associated to the generated class of the given name


getGeneratedClassesCache

public static java.util.Hashtable getGeneratedClassesCache()
Returns the generatedClassesCache.

Returns:
Hashtable

generateInterface

public ProActiveInterface generateInterface(java.lang.String fcInterfaceName,
                                            Component owner,
                                            InterfaceType interfaceType,
                                            boolean isInternal,
                                            boolean isPrimitive)
                                     throws InterfaceGenerationFailedException
InterfaceGenerationFailedException

createGetAndSetFcItfImplMethods

protected void createGetAndSetFcItfImplMethods()

createMethod

protected org.objectweb.asm.CodeVisitor createMethod(int methodIndex,
                                                     java.lang.reflect.Method m)
Description copied from class: AbstractInterfaceClassGenerator
Method createMethod.

Specified by:
createMethod in class AbstractInterfaceClassGenerator
Parameters:
methodIndex -
m -
Returns:
CodeVisitor

createFields

protected void createFields()
Description copied from class: AbstractInterfaceClassGenerator
Method createFields.

Specified by:
createFields in class AbstractInterfaceClassGenerator

createStaticVariables

protected void createStaticVariables()
Description copied from class: AbstractInterfaceClassGenerator
Method createStaticVariables.

Specified by:
createStaticVariables in class AbstractInterfaceClassGenerator

createStaticInitializer

protected void createStaticInitializer()
                                throws java.lang.ClassNotFoundException
Description copied from class: AbstractInterfaceClassGenerator
Method createStaticInitializer.

Specified by:
createStaticInitializer in class AbstractInterfaceClassGenerator
java.lang.ClassNotFoundException

createDefaultMethods

protected void createDefaultMethods()
implementation of abstract method from superclass

Specified by:
createDefaultMethods in class AbstractInterfaceClassGenerator


Copyright © April 2004 INRIA All Rights Reserved.