Package javax.isolate

Examples of javax.isolate.Isolate


    public IsolateCommandThreadImpl(CommandRunner cr) throws IOException {
        this.cr = cr;
        CommandIO[] ios = cr.getIOs();
        Properties properties = System.getProperties();
        StreamBindings streamBindings = createStreamBindings(ios);
        isolate = new Isolate(streamBindings, properties,
                "org.jnode.shell.isolate.IsolateCommandLauncher", new String[0]);
    }
View Full Code Here


        if (listConsoles) {
            conMgr.printConsoles(out);
        } else if (newConsole) {
            if (isolateNewConsole) {
                try {
                    Isolate newIsolate = new Isolate(
                            ConsoleCommand.IsolatedConsole.class.getName(),
                            new String[0]);
                    newIsolate.start();
                    out.println("Started new isolated console");
                } catch (IsolateStartupException ex) {
                    out.println("Failed to start new isolated console");
                    throw ex;
                }
View Full Code Here

    /**
     * Constructor for the root isolate.
     */
    private VmIsolate(VmIsolatedStatics isolatedStatics) {
        this.id = StaticData.nextId();
        this.isolate = new Isolate(this);
        this.mainClass = null;
        this.args = null;
        this.bindings = new VmStreamBindings();
        this.state = State.STARTED;
        this.threadGroup = getRootThreadGroup();
View Full Code Here

        }

        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

        } 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

     * @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

        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

    }

    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

TOP

Related Classes of javax.isolate.Isolate

Copyright © 2018 www.massapicom. 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.