FileDocCategorySizeDatePackage
JavaSECMPInitializerAgent.javaAPI DocGlassfish v2 API4041Tue May 22 16:54:24 BST 2007oracle.toplink.essentials.internal.ejb.cmp3

JavaSECMPInitializerAgent

public class JavaSECMPInitializerAgent extends Object
This agent is intended to be run prior to start up on a CMP3 JavaSE application. It gets the globalInstrumentation and makes it available to TopLink's initialization code. There are two kinds of initialization. Normally, initialization occurs through reflective creation and invokation of TopLink JavaSECMPInitializer. It is possible to run it with the "main" argument to the agent in which case it will simply try to set the globalInstrumentation field on the JavaSECMPInitializer. This type of initialization is useful when debugging, but imposes some restrictions on the user. One such restriction is that no domain classes that use lazy loading may be references in any way other than reflective in the application

Fields Summary
Constructors Summary
Methods Summary
public static voidinitializeFromAgent(java.lang.instrument.Instrumentation instr)

            Class cls = Class.forName("oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer");
            Method method = cls.getDeclaredMethod("initializeFromAgent", new Class[] { Instrumentation.class });
            method.invoke(null, new Object[] { instr });
    
public static voidinitializeFromMain(java.lang.instrument.Instrumentation instr)

            Class cls = Class.forName("oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer");
            Field field = cls.getField("globalInstrumentation");
            field.set(null, instr);        
    
public static voidpremain(java.lang.String agentArgs, java.lang.instrument.Instrumentation instr)

        // Reflection allows:
        //  JavaSECMPInitializerAgent to be the *ONLY* class is the jar file specified in -javaagent;
        //  Loading JavaSECMPInitializer class using SystemClassLoader.
        if ((agentArgs != null) && agentArgs.equals("main")) {
            initializeFromMain(instr);
        } else {
            initializeFromAgent(instr);
        }