Package org.mozilla.javascript

Examples of org.mozilla.javascript.ContinuationPending


    private static final long serialVersionUID = 4189002778806232070L;

    public int f(int a) {
      Context cx = Context.enter();
      try {
        ContinuationPending pending = cx.captureContinuation();
        pending.setApplicationState(a);
        throw pending;
      } finally {
        Context.exit();
      }
    }
View Full Code Here


    }

    public int g(int a) {
      Context cx = Context.enter();
      try {
        ContinuationPending pending = cx.captureContinuation();
        pending.setApplicationState(2 * a);
        throw pending;
      } finally {
        Context.exit();
      }
    }
View Full Code Here

    }

    public String expr() {
      Context cx = Context.enter();
      try {
        ContinuationPending pending = cx.captureContinuation();
        pending.setApplicationState("2*3");
        throw pending;
      } finally {
        Context.exit();
      }
    }
View Full Code Here

    return until;
   
  }
 
  public void log(Object o) {
        ContinuationPending pending = Context.getCurrentContext().captureContinuation();
        pending.setApplicationState(new Log(o));
        throw pending;
  }
View Full Code Here

        pending.setApplicationState(new Log(o));
        throw pending;
  }

  public Object fork() {
    ContinuationPending pending = Context.getCurrentContext().captureContinuation();
    pending.setApplicationState(new Fork());
    throw pending;
  }
View Full Code Here

    pending.setApplicationState(new Fork());
    throw pending;
  }

  public Object kill(String pid) {
    ContinuationPending pending = Context.getCurrentContext().captureContinuation();
    pending.setApplicationState(new Kill(UUID.fromString(pid)));
    throw pending;
  }
View Full Code Here

    pending.setApplicationState(new Kill(UUID.fromString(pid)));
    throw pending;
  }

  public Object exec(String program, String args) {
    ContinuationPending pending = Context.getCurrentContext().captureContinuation();
    pending.setApplicationState(new Exec(program, args));
    throw pending;
  }
View Full Code Here

    throw pending;
  }

  public Object exit(Object result) {
   
    ContinuationPending pending = Context.getCurrentContext().captureContinuation();
    pending.setApplicationState(new NormalTermination(result));
    throw pending;
  }
View Full Code Here

      throw new ScriptusRuntimeException("no arg presented for sleep");
    }
   
    Calendar until = getDuration(untilArg);
   
    ContinuationPending pending = Context.getCurrentContext().captureContinuation();
    pending.setApplicationState(new Sleep(until, rnd.nextLong()));
    throw pending;
  }
View Full Code Here

   
    if( ! "http".equals(u.getProtocol())  && ! "https".equals(u.getProtocol())) {
      throw new ScriptusRuntimeException("only http and https supported right now");
    }
   
    ContinuationPending pending = Context.getCurrentContext().captureContinuation();
    pending.setApplicationState(new Get(u));
    throw pending;
  }
View Full Code Here

TOP

Related Classes of org.mozilla.javascript.ContinuationPending

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.