Package org.jrd.agent
Class Main
- java.lang.Object
-
- org.jrd.agent.Main
-
public final class Main extends java.lang.ObjectThis class contains agent's premain and agentmain methods.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringADDRESS_STRINGprivate static booleanfirstTimeprivate static java.lang.Stringhostnamestatic java.lang.StringJRD_AGENT_LOADEDprivate static java.lang.Integerportprivate static java.lang.StringPORT_STRING
-
Constructor Summary
Constructors Modifier Constructor Description privateMain()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidagentmain(java.lang.String args, java.lang.instrument.Instrumentation inst)This method only calls the premain(package private) static java.lang.StringgetHostname()(package private) static java.lang.IntegergetPort()static voidpremain(java.lang.String agentArgs, java.lang.instrument.Instrumentation inst)Premain method is executed when the agent is loaded.static voidsetFirstTime(boolean b)
-
-
-
Field Detail
-
JRD_AGENT_LOADED
public static final java.lang.String JRD_AGENT_LOADED
- See Also:
- Constant Field Values
-
ADDRESS_STRING
private static final java.lang.String ADDRESS_STRING
- See Also:
- Constant Field Values
-
PORT_STRING
private static final java.lang.String PORT_STRING
- See Also:
- Constant Field Values
-
hostname
private static java.lang.String hostname
-
port
private static java.lang.Integer port
-
firstTime
private static boolean firstTime
-
-
Method Detail
-
getHostname
static java.lang.String getHostname()
-
getPort
static java.lang.Integer getPort()
-
premain
public static void premain(java.lang.String agentArgs, java.lang.instrument.Instrumentation inst)Premain method is executed when the agent is loaded. It sets the port and host name from agentArgs and starts the listener thread.- Parameters:
agentArgs- arguments with parameters for listenerinst- instance of instrumentation of given VM
-
agentmain
public static void agentmain(java.lang.String args, java.lang.instrument.Instrumentation inst)This method only calls the premain- Parameters:
args- arguments with parameters for listenerinst- instance of instrumentation of given VM
-
setFirstTime
public static void setFirstTime(boolean b)
-
-