1 11 package org.eclipse.jdi; 12 13 import org.eclipse.core.runtime.IExtensionRegistry; 14 import org.eclipse.core.runtime.Platform; 15 import org.eclipse.jdt.internal.debug.core.JDIDebugPlugin; 16 17 18 public class Bootstrap 19 { 20 private static com.sun.jdi.VirtualMachineManager fVirtualMachineManager; 21 22 public Bootstrap() { } 23 24 public static synchronized com.sun.jdi.VirtualMachineManager virtualMachineManager() { 25 if (fVirtualMachineManager != null) 26 return fVirtualMachineManager; 27 28 try { 29 IExtensionRegistry extensionRegistry= Platform.getExtensionRegistry(); 30 String className= null; 31 if (extensionRegistry != null) { className= extensionRegistry.getExtensionPoint(JDIDebugPlugin.getUniqueIdentifier(), "jdiclient").getLabel(); } 34 Class clazz= null; 35 if (className != null) { 36 clazz= Class.forName(className); 37 } 38 if (clazz != null) { 39 fVirtualMachineManager = (com.sun.jdi.VirtualMachineManager)clazz.newInstance(); 40 } 41 } catch (ClassNotFoundException e) { 42 } catch (NoClassDefFoundError e) { 43 } catch (InstantiationException e) { 44 } catch (IllegalAccessException e) { 45 } 46 47 if (fVirtualMachineManager == null) { 48 fVirtualMachineManager= new org.eclipse.jdi.internal.VirtualMachineManagerImpl(); 50 } 51 52 return fVirtualMachineManager; 53 } 54 } 55 | Popular Tags |