Package sun.tools.attach
Class BsdVirtualMachine
- java.lang.Object
-
- com.sun.tools.attach.VirtualMachine
-
- sun.tools.attach.HotSpotVirtualMachine
-
- sun.tools.attach.BsdVirtualMachine
-
public class BsdVirtualMachine extends HotSpotVirtualMachine
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classBsdVirtualMachine.SocketInputStream
-
Field Summary
Fields Modifier and Type Field Description private static intATTACH_ERROR_BADVERSION(package private) java.lang.Stringpathprivate static java.lang.StringPROTOCOL_VERSIONprivate static java.lang.Stringtmpdir
-
Constructor Summary
Constructors Constructor Description BsdVirtualMachine(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 voidcheckPermissions(java.lang.String path)(package private) static voidclose(int fd)(package private) static voidconnect(int fd, java.lang.String path)(package private) static voidcreateAttachFile(java.lang.String path)voiddetach()Detach from the target VM(package private) java.io.InputStreamexecute(java.lang.String cmd, java.lang.Object... args)Execute the given command in the target VM.private java.lang.StringfindSocketFile(int pid)(package private) static java.lang.StringgetTempDir()(package private) static intread(int fd, byte[] buf, int off, int bufLen)(package private) static voidsendQuitTo(int pid)(package private) static intsocket()(package private) static voidwrite(int fd, byte[] buf, int off, int bufLen)private voidwriteString(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
-
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
-
BsdVirtualMachine
public BsdVirtualMachine(AttachProvider provider, java.lang.String vmid) throws AttachNotSupportedException, java.io.IOException
Attaches to the target VM- Throws:
AttachNotSupportedExceptionjava.io.IOException
-
-
Method Detail
-
detach
public void detach() throws java.io.IOExceptionDetach from the target VM- Specified by:
detachin 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.IOExceptionExecute the given command in the target VM.- Specified by:
executein classHotSpotVirtualMachine- Throws:
AgentLoadExceptionjava.io.IOException
-
findSocketFile
private java.lang.String findSocketFile(int pid)
-
writeString
private void writeString(int fd, java.lang.String s) 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
-
createAttachFile
static void createAttachFile(java.lang.String path)
-
getTempDir
static java.lang.String getTempDir()
-
-