< prev index next >

src/jdk.jdi/share/classes/com/sun/tools/jdi/VirtualMachineManagerImpl.java

Print this page

 67             sm.checkPermission(vmmPermission);
 68         }
 69         synchronized (lock) {
 70             if (vmm == null) {
 71                 vmm = new VirtualMachineManagerImpl();
 72             }
 73         }
 74         return vmm;
 75     }
 76 
 77     protected VirtualMachineManagerImpl() {
 78 
 79         /*
 80          * Create a top-level thread group
 81          */
 82         ThreadGroup top = Thread.currentThread().getThreadGroup();
 83         ThreadGroup parent = null;
 84         while ((parent = top.getParent()) != null) {
 85             top = parent;
 86         }
 87         mainGroupForJDI = new ThreadGroup(top, "JDI main");


 88 
 89         /*
 90          * Load the connectors
 91          */
 92         ServiceLoader<Connector> connectorLoader =
 93             ServiceLoader.load(Connector.class, Connector.class.getClassLoader());
 94 
 95         Iterator<Connector> connectors = connectorLoader.iterator();
 96 
 97         while (connectors.hasNext()) {
 98             Connector connector;
 99 
100             try {
101                 connector = connectors.next();
102             } catch (ThreadDeath x) {
103                 throw x;
104             } catch (Exception x) {
105                 System.err.println(x);
106                 continue;
107             } catch (Error x) {

 67             sm.checkPermission(vmmPermission);
 68         }
 69         synchronized (lock) {
 70             if (vmm == null) {
 71                 vmm = new VirtualMachineManagerImpl();
 72             }
 73         }
 74         return vmm;
 75     }
 76 
 77     protected VirtualMachineManagerImpl() {
 78 
 79         /*
 80          * Create a top-level thread group
 81          */
 82         ThreadGroup top = Thread.currentThread().getThreadGroup();
 83         ThreadGroup parent = null;
 84         while ((parent = top.getParent()) != null) {
 85             top = parent;
 86         }
 87         @SuppressWarnings("deprecation")
 88         ThreadGroup group = new ThreadGroup(top, "JDI main");
 89         mainGroupForJDI = group;
 90 
 91         /*
 92          * Load the connectors
 93          */
 94         ServiceLoader<Connector> connectorLoader =
 95             ServiceLoader.load(Connector.class, Connector.class.getClassLoader());
 96 
 97         Iterator<Connector> connectors = connectorLoader.iterator();
 98 
 99         while (connectors.hasNext()) {
100             Connector connector;
101 
102             try {
103                 connector = connectors.next();
104             } catch (ThreadDeath x) {
105                 throw x;
106             } catch (Exception x) {
107                 System.err.println(x);
108                 continue;
109             } catch (Error x) {
< prev index next >