Class DevLoopAgent
Instrumentation handle at JVM startup and publishes it,
so the in-app dev-loop connector can perform atomic class redefinitions
in-process.
The daemon jar carries Premain-Class/Agent-Class pointing
here alongside its own Main-Class, so one artifact is both the
runnable daemon and the javaagent the application JVM loads. Only this class
is ever loaded into the application JVM.
The handle is published two ways, so the connector finds it regardless of
which class loader ends up owning the application classes: as a static field
here (which works when the agent jar is visible to the application loader,
the normal case since agent jars are appended to the system class path), and
as a value in the system properties table, which is a
Hashtable<Object, Object> and can therefore carry an arbitrary object
- that path needs no class visibility at all.
Depends on nothing but java.instrument: it is loaded before the
application, into a JVM whose class path it must not influence.
For internal use only. May be renamed or removed in a future release.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe system properties key theInstrumentationhandle is published under. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidagentmain(String args, Instrumentation inst) Entry point when the agent is attached to a running JVM.static Instrumentationget()The captured instrumentation handle, ornullwhen this class was loaded without the agent having been installed.static voidpremain(String args, Instrumentation inst) Entry point when the agent is loaded at JVM startup with-javaagent:.
-
Field Details
-
PROPERTY
The system properties key theInstrumentationhandle is published under.- See Also:
-
-
Method Details
-
premain
Entry point when the agent is loaded at JVM startup with-javaagent:.- Parameters:
args- the agent arguments, unusedinst- the instrumentation handle to publish
-
agentmain
Entry point when the agent is attached to a running JVM.- Parameters:
args- the agent arguments, unusedinst- the instrumentation handle to publish
-
get
The captured instrumentation handle, ornullwhen this class was loaded without the agent having been installed.- Returns:
- the instrumentation handle, or
null
-