Package sun.tools.attach
Class LinuxVirtualMachine
- java.lang.Object
-
- com.sun.tools.attach.VirtualMachine
-
- sun.tools.attach.HotSpotVirtualMachine
-
- sun.tools.attach.LinuxVirtualMachine
-
public class LinuxVirtualMachine extends HotSpotVirtualMachine
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
LinuxVirtualMachine.SocketInputStream
-
Field Summary
Fields Modifier and Type Field Description private static int
ATTACH_ERROR_BADVERSION
(package private) static boolean
isLinuxThreads
(package private) java.lang.String
path
private static java.lang.String
PROTOCOL_VERSION
private static java.lang.String
tmpdir
-
Constructor Summary
Constructors Constructor Description LinuxVirtualMachine(AttachProvider provider, java.lang.String vmid)
Attaches to the target VM
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static void
checkPermissions(java.lang.String path)
(package private) static void
close(int fd)
(package private) static void
connect(int fd, java.lang.String path)
private java.io.File
createAttachFile(int pid)
void
detach()
Detach from the target VM(package private) java.io.InputStream
execute(java.lang.String cmd, java.lang.Object... args)
Execute the given command in the target VM.private java.lang.String
findSocketFile(int pid)
(package private) static int
getLinuxThreadsManager(int pid)
(package private) static boolean
isLinuxThreads()
(package private) static int
read(int fd, byte[] buf, int off, int bufLen)
(package private) static void
sendQuitTo(int pid)
(package private) static void
sendQuitToChildrenOf(int pid)
(package private) static int
socket()
(package private) static void
write(int fd, byte[] buf, int off, int bufLen)
private void
writeString(int fd, java.lang.String s)
-
Methods inherited from class sun.tools.attach.HotSpotVirtualMachine
attachTimeout, dumpHeap, executeJCmd, getAgentProperties, getSystemProperties, heapHisto, loadAgent, loadAgentLibrary, loadAgentPath, localDataDump, printFlag, readInt, remoteDataDump, setFlag
-
Methods inherited from class com.sun.tools.attach.VirtualMachine
attach, attach, equals, hashCode, id, list, loadAgent, loadAgentLibrary, loadAgentPath, provider, toString
-
-
-
-
Field Detail
-
tmpdir
private static final java.lang.String tmpdir
- See Also:
- Constant Field Values
-
isLinuxThreads
static boolean isLinuxThreads
-
path
java.lang.String path
-
PROTOCOL_VERSION
private static final java.lang.String PROTOCOL_VERSION
- See Also:
- Constant Field Values
-
ATTACH_ERROR_BADVERSION
private static final int ATTACH_ERROR_BADVERSION
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
LinuxVirtualMachine
public LinuxVirtualMachine(AttachProvider provider, java.lang.String vmid) throws AttachNotSupportedException, java.io.IOException
Attaches to the target VM- Throws:
AttachNotSupportedException
java.io.IOException
-
-
Method Detail
-
detach
public void detach() throws java.io.IOException
Detach from the target VM- Specified by:
detach
in classVirtualMachine
- Throws:
java.io.IOException
- If an I/O error occurs
-
execute
java.io.InputStream execute(java.lang.String cmd, java.lang.Object... args) throws AgentLoadException, java.io.IOException
Execute the given command in the target VM.- Specified by:
execute
in classHotSpotVirtualMachine
- Throws:
AgentLoadException
java.io.IOException
-
findSocketFile
private java.lang.String findSocketFile(int pid)
-
createAttachFile
private java.io.File createAttachFile(int pid) throws java.io.IOException
- Throws:
java.io.IOException
-
writeString
private void writeString(int fd, java.lang.String s) throws java.io.IOException
- Throws:
java.io.IOException
-
isLinuxThreads
static boolean isLinuxThreads()
-
getLinuxThreadsManager
static int getLinuxThreadsManager(int pid) throws java.io.IOException
- Throws:
java.io.IOException
-
sendQuitToChildrenOf
static void sendQuitToChildrenOf(int pid) throws java.io.IOException
- Throws:
java.io.IOException
-
sendQuitTo
static void sendQuitTo(int pid) throws java.io.IOException
- Throws:
java.io.IOException
-
checkPermissions
static void checkPermissions(java.lang.String path) throws java.io.IOException
- Throws:
java.io.IOException
-
socket
static int socket() throws java.io.IOException
- Throws:
java.io.IOException
-
connect
static void connect(int fd, java.lang.String path) throws java.io.IOException
- Throws:
java.io.IOException
-
close
static void close(int fd) throws java.io.IOException
- Throws:
java.io.IOException
-
read
static int read(int fd, byte[] buf, int off, int bufLen) throws java.io.IOException
- Throws:
java.io.IOException
-
write
static void write(int fd, byte[] buf, int off, int bufLen) throws java.io.IOException
- Throws:
java.io.IOException
-
-