Package javax.isolate

Examples of javax.isolate.Link


    }

    @Override
    public void start(ThreadExitListener listener) throws ShellInvocationException {
        try {
            Link cl = Link.newLink(Isolate.currentIsolate(), isolate);
            sl = isolate.newStatusLink();
            isolate.start(cl);
            ObjectLinkMessage msg = ObjectLinkMessage.newMessage(this.cr);
            cl.send(msg);
        } catch (Exception ex) {
            throw new ShellInvocationException("Error starting isolate", ex);
        }
    }
View Full Code Here


     * in the form of a CommandRunner object.
     *
     * @param args
     */
    public static void main(String[] args) {
        Link cl = Isolate.getLinks()[0];
        CommandRunner cr;
        try {
            ObjectLinkMessage message = (ObjectLinkMessage) cl.receive();
            cr = (CommandRunner) message.extract();
            Map<String, String> env = cr.getEnv();
            int envSize = (env == null) ? 0 : env.size();
            byte[][] binEnv = new byte[envSize * 2][];
            if (envSize > 0) {
View Full Code Here

     *
     * @param receiver the receiver for the link.
     * @return the link.
     */
    public synchronized Link newStatusLink(VmIsolate receiver) {
        Link link = VmLink.newLink(this, receiver);
        VmLink vmLink = VmLink.fromLink(link);
        statusLinks.add(vmLink);
        if (isolateState != null && isolateState.equals(IsolateStatus.State.EXITED)) {
            // The spec says that we should immediately send a link message
            // if the isolate is already 'EXITED'.
View Full Code Here

            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;
            }
        } catch (Exception e) {
            e.printStackTrace();
View Full Code Here

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

    public static class ChildClass {

        public static void main(String[] args)
            throws ClosedLinkException, IllegalStateException, InterruptedIOException, IOException {
            Link link = Isolate.getLinks()[0];
            LinkMessage msg = link.receive();
            System.out.println("Got message: " + msg.extractString());
        }
View Full Code Here

TOP

Related Classes of javax.isolate.Link

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.