/** * If <b>ibm</b> is false, this private method will create a new URLClassLoader and attempt to load the * com.sun.tools.attach.VirtualMachine class from the provided toolsJar file. * * <p> * If <b>ibm</b> is true, this private method will ignore the toolsJar parameter and load the * com.ibm.tools.attach.VirtualMachine class. * * * @return The AttachAPI VirtualMachine class <br> * or null if something unexpected happened. */ private static Class<?> loadVMClass(File toolsJar, Log log, JavaVendors vendor) { try { ClassLoader loader = Thread.currentThread().getContextClassLoader(); String cls = vendor.getVirtualMachineClassName(); if (vendor.isIBM() == false) { loader = new URLClassLoader(new URL[] { toolsJar.toURI().toURL() }, loader); } return loader.loadClass(cls); } catch (Exception e) { if (log.isTraceEnabled()) { log.trace(_name + ".loadVMClass() failed to load the VirtualMachine class"); } } return null; }
/** * If <b>ibm</b> is false, this private method will create a new URLClassLoader and attempt to load the * com.sun.tools.attach.VirtualMachine class from the provided toolsJar file. * * <p> * If <b>ibm</b> is true, this private method will ignore the toolsJar parameter and load the * com.ibm.tools.attach.VirtualMachine class. * * * @return The AttachAPI VirtualMachine class <br> * or null if something unexpected happened. */ private static Class<?> loadVMClass(File toolsJar, Log log, JavaVendors vendor) { try { ClassLoader loader = Thread.currentThread().getContextClassLoader(); String cls = vendor.getVirtualMachineClassName(); if (vendor.isIBM() == false) { loader = new URLClassLoader(new URL[] { toolsJar.toURI().toURL() }, loader); } return loader.loadClass(cls); } catch (Exception e) { if (log.isTraceEnabled()) { log.trace(_name + ".loadVMClass() failed to load the VirtualMachine class"); } } return null; }
/** * If <b>ibm</b> is false, this private method will create a new URLClassLoader and attempt to load the * com.sun.tools.attach.VirtualMachine class from the provided toolsJar file. * * <p> * If <b>ibm</b> is true, this private method will ignore the toolsJar parameter and load the * com.ibm.tools.attach.VirtualMachine class. * * * @return The AttachAPI VirtualMachine class <br> * or null if something unexpected happened. */ private static Class<?> loadVMClass(File toolsJar, Log log, JavaVendors vendor) { try { ClassLoader loader = Thread.currentThread().getContextClassLoader(); String cls = vendor.getVirtualMachineClassName(); if (vendor.isIBM() == false) { loader = new URLClassLoader(new URL[] { toolsJar.toURI().toURL() }, loader); } return loader.loadClass(cls); } catch (Exception e) { if (log.isTraceEnabled()) { log.trace(_name + ".loadVMClass() failed to load the VirtualMachine class"); } } return null; }
/** * If <b>ibm</b> is false, this private method will create a new URLClassLoader and attempt to load the * com.sun.tools.attach.VirtualMachine class from the provided toolsJar file. * * <p> * If <b>ibm</b> is true, this private method will ignore the toolsJar parameter and load the * com.ibm.tools.attach.VirtualMachine class. * * * @return The AttachAPI VirtualMachine class <br> * or null if something unexpected happened. */ private static Class<?> loadVMClass(File toolsJar, Log log, JavaVendors vendor) { try { ClassLoader loader = Thread.currentThread().getContextClassLoader(); String cls = vendor.getVirtualMachineClassName(); if (vendor.isIBM() == false) { loader = new URLClassLoader(new URL[] { toolsJar.toURI().toURL() }, loader); } return loader.loadClass(cls); } catch (Exception e) { if (log.isTraceEnabled()) { log.trace(_name + ".loadVMClass() failed to load the VirtualMachine class"); } } return null; }