Examples of Isolate


Examples of javax.isolate.Isolate

        }

        if (classArgs == null)
            classArgs = new String[0];

        Isolate newIsolate;
        if (properties != null && properties.size() > 0) {
            newIsolate = new Isolate(properties, mainClass, classArgs);
        } else {
            newIsolate = new Isolate(mainClass, classArgs);
        }

        try {
            classPath.add(0, new File(".").toURI().toURL());
            Field field = newIsolate.getClass().getDeclaredField("impl");
            field.setAccessible(true);
            VmIsolate vmi = (VmIsolate) field.get(newIsolate);
            vmi.setClasspath(classPath.toArray(new URL[classPath.size()]));
        } catch (Exception x) {
            x.printStackTrace();
            return;
        }

        try {
            Link link = newIsolate.newStatusLink();
            newIsolate.start();
            //wait for exit
            for (;;) {
                LinkMessage msg = link.receive();
                if (msg.containsStatus() && IsolateStatus.State.EXITED.equals(msg.extractStatus().getState()))
                    break;
View Full Code Here

Examples of javax.isolate.Isolate

        } else {
            mainClass = "org.jnode.test.core.IsolatedHelloWorld";
            isolateArgs = new String[0];
        }

        Isolate newIsolate = new Isolate(mainClass, isolateArgs);
        try {
            newIsolate.start();
        } catch (IsolateStartupException e) {
            e.printStackTrace();
        }
    }
View Full Code Here

Examples of javax.isolate.Isolate

     * @throws IOException
     * @throws InterruptedIOException
     */
    public static void main(String[] args) throws IsolateStartupException, InterruptedIOException, IOException {
        String clsName = ChildClass.class.getName();
        Isolate child = new Isolate(clsName, new String[0]);

        Link link = Link.newLink(Isolate.currentIsolate(), child);

        child.start(link);

        link.send(LinkMessage.newStringMessage("Hello world"));
    }
View Full Code Here

Examples of javax.isolate.Isolate

        runChild(ChildClass5.class);

        runChild(ChildClass6.class);

        Isolate child = new Isolate(ChildClass7.class.getName());
        new Thread(new StatusMonitor(child.newStatusLink()), "status-monitor").start();
        child.start();

        try {
            Thread.sleep(100);
        } finally {
            child.exit(0);
        }

        child = new Isolate(ChildClass7.class.getName());
        new Thread(new StatusMonitor(child.newStatusLink()), "status-monitor").start();
        child.start();

        try {
            Thread.sleep(100);
        } finally {
            child.halt(0);
        }

    }
View Full Code Here

Examples of javax.isolate.Isolate

    }

    private static Isolate runChild(Class<?> clazz)
        throws ClosedLinkException, IsolateStartupException, InterruptedException {
        Isolate child = new Isolate(clazz.getName());
        Thread moni = new Thread(new StatusMonitor(child.newStatusLink()), "status-monitor");
        moni.start();
        child.start();
        moni.join();
        return child;
    }
View Full Code Here

Examples of org.gridkit.coherence.util.classloader.Isolate

      System.setProperty("gridkit.auto-pof.use-public-cache-config", "true");
   
    System.setProperty("tangosol.coherence.wka", "localhost");
      System.setProperty("tangosol.coherence.localhost", "localhost");
   
    isolate = new Isolate("Remote", "org.gridkit", "com.tangosol");
    isolate.start();
    isolate.submit(NodeActions.Start.class, "auto-pof-cache-config-extend-server.xml");
    isolate.submit(NodeActions.GetService.class, "AUTO_POF_SERVICE");
    isolate.submit(NodeActions.GetService.class, "TcpProxyService");
//    isolate.submit(NodeActions.GetService.class, "TcpAutoPofProxyService");
View Full Code Here

Examples of org.gridkit.coherence.util.classloader.Isolate

    cache.put("123", new Chars("123"));
    cache.put("456", new Chars("456"));
    cache.put("789", new Chars("789"));
    cache.put("111-222-333", new Chars[]{new Chars("111"), new Chars("111"), new Chars("111")});
   
    Isolate node = new Isolate("Remote-2", "org.gridkit", "com.tangosol");
    node.start();
    node.submit(NodeActions.Start.class, "auto-pof-cache-config-extend-server.xml");
    node.submit(GetAll.class);
    node.submit(NodeActions.Stop.class);
    node.stop();   
   
    Assert.assertEquals("ok", cache.get("ok"));
  }
View Full Code Here

Examples of org.gridkit.coherence.util.classloader.Isolate

  @Test
  public void testBackPush() {
   
    cache.remove("dummy");
   
    Isolate node = new Isolate("Remote-2", "org.gridkit", "com.tangosol");
    node.start();
    node.submit(NodeActions.Start.class, "auto-pof-cache-config-extend-server.xml");
    node.submit(PushObject.class);
    node.submit(NodeActions.Stop.class);
    node.stop();   
   
    Dummy dm = (Dummy) cache.get("dummy");
    Assert.assertEquals("ok", dm.dummyOk);
  }
View Full Code Here

Examples of org.gridkit.coherence.util.classloader.Isolate

  @BeforeClass
  public static void init_storage_node() throws SecurityException, IllegalArgumentException, NoSuchFieldException, IllegalAccessException {
      System.setProperty("tangosol.coherence.wka", "localhost");
      System.setProperty("tangosol.coherence.localhost", "localhost");
   
    isolate = new Isolate("Remote", "org.gridkit", "com.tangosol");
    isolate.start();
    isolate.submit(NodeActions.Start.class, "auto-pof-cache-config-server.xml");
    isolate.submit(NodeActions.GetCache.class, "objects");
   
    initCache();
View Full Code Here

Examples of org.gridkit.coherence.util.classloader.Isolate

    cache.put("123", new Chars("123"));
    cache.put("456", new Chars("456"));
    cache.put("789", new Chars("789"));
    cache.put("111-222-333", new Chars[]{new Chars("111"), new Chars("111"), new Chars("111")});
   
    Isolate node = new Isolate("Remote-2", "org.gridkit", "com.tangosol");
    node.start();
    node.submit(NodeActions.Start.class, "auto-pof-cache-config-server.xml");
    node.submit(GetAll.class);
    node.submit(NodeActions.Stop.class);
    node.stop();   
   
    Assert.assertEquals("ok", cache.get("ok"));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.