/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* Platform specific provider implementations extend this
*/
// perf count name for the JVM version
public HotSpotAttachProvider() {
}
public void checkAttachPermission() {
new AttachPermission("attachVirtualMachine")
);
}
}
/*
* This listVirtualMachines implementation is based on jvmstat. Can override
* this in platform implementations when there is a more efficient mechanism
* available.
*/
new ArrayList<VirtualMachineDescriptor>();
try {
} catch (Throwable t) {
if (t instanceof ExceptionInInitializerError) {
t = t.getCause();
}
if (t instanceof ThreadDeath) {
throw (ThreadDeath)t;
}
if (t instanceof SecurityException) {
return result;
}
throw new InternalError(); // shouldn't happen
}
boolean isAttachable = false;
try {
try {
// use the command line as the display name
} catch (Exception e) {
}
if (isAttachable) {
}
} catch (Throwable t) {
if (t instanceof ThreadDeath) {
throw (ThreadDeath)t;
}
} finally {
}
}
}
}
return result;
}
/**
* Test if a VM is attachable. If it's not attachable,
* an AttachNotSupportedException will be thrown. For example,
* 1.4.2 or 5.0 VM are not attachable. There are cases that
* we can't determine if a VM is attachable or not and this method
* will just return.
*
* This method uses the jvmstat counter to determine if a VM
* is attachable. If the target VM does not have a jvmstat
* share memory buffer, this method returns.
*
* @exception AttachNotSupportedException if it's not attachable
*/
try {
// it's attachable; so return false
return;
}
} catch (Throwable t) {
if (t instanceof ThreadDeath) {
throw td;
}
// we do not know what this id is
return;
} finally {
}
}
// we're sure it's not attachable; throw exception
throw new AttachNotSupportedException(
"The VM does not support the attach mechanism");
}
/**
* A virtual machine descriptor to describe a HotSpot virtual machine.
*/
}
public boolean isAttachable() {
return true;
}
}
}