public class Install extends Object
Modifier and Type | Method | Description |
---|---|---|
static VMInfo[] |
availableVMs() |
|
static String |
getSystemProperty(String id,
String property) |
attach to the virtual machine identified by id and return the value of the named property.
|
static void |
install(String pid,
boolean addToBoot,
boolean setPolicy,
boolean useModuleLoader,
String host,
int port,
String[] properties) |
compatability mode
|
static void |
install(String pid,
boolean addToBoot,
boolean setPolicy,
String host,
int port,
String[] properties) |
compatability mode
|
static void |
install(String pid,
boolean addToBoot,
String host,
int port,
String[] properties) |
compatability mode
|
static boolean |
isAgentAttached(String id) |
attach to the virtual machine identified by id and return
true if a Byteman
agent has already been attached to it. |
String |
locateJarFromClasspath(String libName) |
|
String |
locateJarFromHomeDir(String bmHome,
String baseDir,
String libName) |
|
static void |
main(String[] args) |
main routine for use from command line
Install [-h host] [-p port] [-b] [-s] [-m] [-Dorg.jboss.Byteman.xxx]* pid
see method
usage(int) for details of the command syntax |
public static void main(String[] args)
usage(int)
for details of the command syntaxargs
- the command optionspublic static void install(String pid, boolean addToBoot, String host, int port, String[] properties) throws IllegalArgumentException, FileNotFoundException, IOException, com.sun.tools.attach.AttachNotSupportedException, com.sun.tools.attach.AgentLoadException, com.sun.tools.attach.AgentInitializationException
pid
- the process id of the JVM into which the agent should be installed or 0 for this JVMaddToBoot
- true if the agent jar should be installed into the bootstrap classpathhost
- the hostname to be used by the agent listener or null for localhostport
- the port to be used by the agent listener or 0 for the default portproperties
- an array of System properties to be installed by the agent with optional values e.g.
values such as "org.jboss.byteman.verbose" or "org.jboss.byteman.dump.generated.classes.directory=./dump"IllegalArgumentException
- if any of the arguments is invalidFileNotFoundException
- if the agent jar cannot be found using the environment variable BYTEMAN_HOME
or the System property org.jboss.byteman.home and cannot be located in the current classpathIOException
- if the byteman jar cannot be opened or uploaded to the requested JVMcom.sun.tools.attach.AttachNotSupportedException
- if the requested JVM cannot be attached tocom.sun.tools.attach.AgentLoadException
- if an error occurs during upload of the agent into the JVMcom.sun.tools.attach.AgentInitializationException
- if the agent fails to initialize after loading. this almost always
indicates that the agent is already loaded into the JVMpublic static void install(String pid, boolean addToBoot, boolean setPolicy, String host, int port, String[] properties) throws IllegalArgumentException, FileNotFoundException, IOException, com.sun.tools.attach.AttachNotSupportedException, com.sun.tools.attach.AgentLoadException, com.sun.tools.attach.AgentInitializationException
pid
- the process id of the JVM into which the agent should be installed or 0 for this JVMaddToBoot
- true if the agent jar should be installed into the bootstrap classpathsetPolicy
- true if the agent jar should set an access-all-areas securityPolicyhost
- the hostname to be used by the agent listener or null for localhostport
- the port to be used by the agent listener or 0 for the default portproperties
- an array of System properties to be installed by the agent with optional values e.g.
values such as "org.jboss.byteman.verbose" or "org.jboss.byteman.dump.generated.classes.directory=./dump"IllegalArgumentException
- if any of the arguments is invalidFileNotFoundException
- if the agent jar cannot be found using the environment variable BYTEMAN_HOME
or the System property org.jboss.byteman.home and cannot be located in the current classpathIOException
- if the byteman jar cannot be opened or uploaded to the requested JVMcom.sun.tools.attach.AttachNotSupportedException
- if the requested JVM cannot be attached tocom.sun.tools.attach.AgentLoadException
- if an error occurs during upload of the agent into the JVMcom.sun.tools.attach.AgentInitializationException
- if the agent fails to initialize after loading. this almost always
indicates that the agent is already loaded into the JVMpublic static void install(String pid, boolean addToBoot, boolean setPolicy, boolean useModuleLoader, String host, int port, String[] properties) throws IllegalArgumentException, FileNotFoundException, IOException, com.sun.tools.attach.AttachNotSupportedException, com.sun.tools.attach.AgentLoadException, com.sun.tools.attach.AgentInitializationException
pid
- the process id of the JVM into which the agent should be installed or 0 for this JVMaddToBoot
- true if the agent jar should be installed into the bootstrap classpathsetPolicy
- true if the agent jar should set an access-all-areas securityPolicyuseModuleLoader
- true if the JBoss module loader mode should be configuredhost
- the hostname to be used by the agent listener or null for localhostport
- the port to be used by the agent listener or 0 for the default portproperties
- an array of System properties to be installed by the agent with optional values e.g.
values such as "org.jboss.byteman.verbose" or "org.jboss.byteman.dump.generated.classes.directory=./dump"IllegalArgumentException
- if any of the arguments is invalidFileNotFoundException
- if the agent jar cannot be found using the environment variable BYTEMAN_HOME
or the System property org.jboss.byteman.home and cannot be located in the current classpathIOException
- if the byteman jar cannot be opened or uploaded to the requested JVMcom.sun.tools.attach.AttachNotSupportedException
- if the requested JVM cannot be attached tocom.sun.tools.attach.AgentLoadException
- if an error occurs during upload of the agent into the JVMcom.sun.tools.attach.AgentInitializationException
- if the agent fails to initialize after loading. this almost always
indicates that the agent is already loaded into the JVMpublic static VMInfo[] availableVMs()
public static String getSystemProperty(String id, String property)
id
- the id of the machine to attach toproperty
- the proeprty to be retrievedpublic static boolean isAgentAttached(String id)
true
if a Byteman
agent has already been attached to it. id must be the id of a virtual machine
returned by method availableVMs.id
- the id of the machine to attach totrue
if and only if a Byteman agent has already been attached to the
virtual machine.public String locateJarFromHomeDir(String bmHome, String baseDir, String libName) throws IOException
IOException
public String locateJarFromClasspath(String libName) throws IOException
IOException
Copyright © 2018. All rights reserved.