org.clazzes.util.jpa.agent
Class Agent

java.lang.Object
  extended by org.clazzes.util.jpa.agent.Agent

public class Agent
extends java.lang.Object

An agent, which exposes the Instrumentation interface to the public.

Activate this agent using the arguments

  java -javaagent:jpa-util-agent-0.1.0.jar=<key> -cp <classpath> foo.Main
 
when starting your container, wher key is a string with at least 6 characters.


Constructor Summary
Agent()
           
 
Method Summary
static void agentmain(java.lang.String agentArgs, java.lang.instrument.Instrumentation inst)
          Register an instrumentation instance under the given key after calling the main method.
static java.lang.instrument.Instrumentation getInstrumentation(java.lang.String key)
          Get the instrumentation registered at boot time.
static void premain(java.lang.String agentArgs, java.lang.instrument.Instrumentation inst)
          Register an instrumentation instance under the given key before calling the main method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Agent

public Agent()
Method Detail

getInstrumentation

public static final java.lang.instrument.Instrumentation getInstrumentation(java.lang.String key)
Get the instrumentation registered at boot time.

Parameters:
key - The key as specified by the argument to -javaagent JRE option.
Returns:
The instrumentation as specified at boot time.

premain

public static void premain(java.lang.String agentArgs,
                           java.lang.instrument.Instrumentation inst)
Register an instrumentation instance under the given key before calling the main method. For details on when this method is invoked, see the java.lang.instrument package specification.

Parameters:
agentArgs - The key as specified by the argument to the -javaagent JRE option.
inst - The instrumentation instance.

agentmain

public static void agentmain(java.lang.String agentArgs,
                             java.lang.instrument.Instrumentation inst)
Register an instrumentation instance under the given key after calling the main method. For details on when this method is invoked, see the java.lang.instrument package specification.

Parameters:
agentArgs - The key as specified by the argument to javaagent
inst - The instrumentation instance.


Copyright © 2011. All Rights Reserved.