< prev index next >

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

Print this page

 62         @SuppressWarnings("removal")
 63         SecurityManager sm = System.getSecurityManager();
 64         if (sm != null) {
 65             JDIPermission vmmPermission =
 66                 new JDIPermission("virtualMachineManager");
 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) {

 62         @SuppressWarnings("removal")
 63         SecurityManager sm = System.getSecurityManager();
 64         if (sm != null) {
 65             JDIPermission vmmPermission =
 66                 new JDIPermission("virtualMachineManager");
 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         @SuppressWarnings("deprecation")
 83         ThreadGroup top = Thread.currentThread().getThreadGroup();
 84         ThreadGroup parent = null;
 85         while ((parent = top.getParent()) != null) {
 86             top = parent;
 87         }
 88         @SuppressWarnings("deprecation")
 89         ThreadGroup group = new ThreadGroup(top, "JDI main");
 90         mainGroupForJDI = group;
 91 
 92         /*
 93          * Load the connectors
 94          */
 95         ServiceLoader<Connector> connectorLoader =
 96             ServiceLoader.load(Connector.class, Connector.class.getClassLoader());
 97 
 98         Iterator<Connector> connectors = connectorLoader.iterator();
 99 
100         while (connectors.hasNext()) {
101             Connector connector;
102 
103             try {
104                 connector = connectors.next();
105             } catch (ThreadDeath x) {
106                 throw x;
107             } catch (Exception x) {
108                 System.err.println(x);
109                 continue;
110             } catch (Error x) {
< prev index next >