From: Jan S. <st...@us...> - 2002-01-27 22:52:04
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl In directory usw-pr-cvs1:/tmp/cvs-serv1447 Modified Files: VirtualMachineImpl.java Log Message: isShutdowned() and shutdown() methods added. Index: VirtualMachineImpl.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/VirtualMachineImpl.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** VirtualMachineImpl.java 2002/01/15 09:03:41 1.3 --- VirtualMachineImpl.java 2002/01/27 22:51:56 1.4 *************** *** 291,298 **** --- 291,342 ---- } + /** + * Shuts profiled JVM down. When profiled JVM is ending, it sends + * the JVMPI_EVENT_JVM_SHUTDOWN event to profiler dynamic library. + * Then the library waits in JVMPI_EVENT_JVM_SHUTDOWN event handler + * until the client calls this method. The goal is the client can make + * any necessary calls to gain data before profiled JVM really shutdowns + * (so before client's shutdown() call). + * + * Note: this method doesn't stop running JVM, to stop running JVM, + * use exitVM() method instead. + * + * @see isShutdowned(), exitVM() + */ + public void shutdown() { + try { + iprof.shutdown(); + } catch (COMMUN_Exception e) { + throw new VMDisconnectedException(); + } + } + + /** + * Checks if profiled JVM is shutting down. So, it means, the JVM is no + * longer running, the JVMPI_EVENT_JVM_SHUTDOWN event was received and + * profiler dynamic library waits in JVMPI_EVENT_JVM_SHUTDOWN event + * handler. The client can now gain any necessary data before calling + * the shutdown() method which shutdowns JVM definitelly. + * + * @return true (JVM is shutting down); + * false (still running, normal operation) + * + * @see shutdown(), exitVM() + */ + public boolean isShutdowned() { + try { + return iprof.isShutdowned(); + } catch (COMMUN_Exception e) { + throw new VMDisconnectedException(); + } + } + } /* * $Log$ + * Revision 1.4 2002/01/27 22:51:56 stolis + * isShutdowned() and shutdown() methods added. + * * Revision 1.3 2002/01/15 09:03:41 vachis * no message |