Package tcl.lang

Examples of tcl.lang.Interp


*/
public class JaclInterpreter implements org.apache.batik.script.Interpreter {
    private Interp interpreter = null;

    public JaclInterpreter() {
        interpreter = new Interp();
        try {
            interpreter.eval("package require java", 0);
        } catch (TclException e) {
        }
    }
View Full Code Here


  public void initialize (BSFManager mgr, String lang,
        Vector declaredBeans) throws BSFException {
  super.initialize (mgr, lang, declaredBeans);

  // create interpreter
  interp = new Interp();

  // register the extension that user's can use to get at objects
  // registered by the app
  interp.createCommand ("bsf", new BSFCommand (mgr, this));
View Full Code Here

*/
public class JaclInterpreter implements org.apache.flex.forks.batik.script.Interpreter {
    private Interp interpreter = null;

    public JaclInterpreter() {
        interpreter = new Interp();
        try {
            interpreter.eval("package require java", 0);
        } catch (TclException e) {
        }
    }
View Full Code Here

*/
public class JaclInterpreter implements org.apache.batik.script.Interpreter {
    private Interp interpreter = null;

    public JaclInterpreter() {
        interpreter = new Interp();
        try {
            interpreter.eval("package require java", 0);
        } catch (TclException e) {
        }
    }
View Full Code Here

    public boolean
    setup(RewriteContext hr) {
  Properties props = hr.request.props;

  if (interp == null) {
      interp = new Interp();

      String script = props.getProperty(hr.prefix + SCRIPT);
      String session = (hr.sessionId == null) ? "none" : hr.sessionId;
      try {
    interp.eval("package require java");
View Full Code Here

   */

  // request.props.list(System.out);
  String sessionId = request.props.getProperty("SessionID","common");
  request.log(Server.LOG_DIAGNOSTIC, "  Using session: " + sessionId);
  Interp interp = (Interp) SessionManager.getSession(sessionId, "TCL",
    Interp.class);
  setupInterp(interp, sessionId);

      int code = 0;
  String result = interp.getResult().toString();
      synchronized (interp) {
      try {
    interp.eval(callback + " " +
      ReflectObject.newInstance(interp, Request.class, request));
      } catch (TclException e) {
    code = e.getCompletionCode();
    String trace = e.toString();
    System.out.println("Tcl Oops: "  + code + " " + e);
    if (code == 1) {
        try {
      trace = interp.getVar("errorInfo", TCL.GLOBAL_ONLY).toString();
        } catch (Exception e1) {}
    }
    request.log(Server.LOG_WARNING, propsPrefix + trace);
      }
      result = interp.getResult().toString();
  // end sync block
  if ((code==0 || code==2) && (result.equalsIgnoreCase("true") ||
    result.equals("1"))) {
      return true;
  } else {
View Full Code Here

   * (or if no SessionID variable was found) - initialize the interp
   */

  String sessionId = request.props.getProperty("SessionID","common");
  request.log(Server.LOG_DIAGNOSTIC, "  Using session: " + sessionId);
  Interp interp = (Interp) SessionManager.getSession(sessionId,
    propsPrefix + "TCL", Interp.class);

      int code = 0;
      synchronized (interp) {
      setupInterp(interp, sessionId);
      try {
    // System.out.println("running eval");
    TclUtil.setVar(interp, "content", new String(content),
      TCL.GLOBAL_ONLY);
    interp.eval("filter" + " " +
        ReflectObject.newInstance(interp, Request.class, request) +
        " " + ReflectObject.newInstance(interp, MimeHeaders.class,
      headers)
        );
    TclObject res = interp.getVar("content", TCL.GLOBAL_ONLY);
    content =  res.toString().getBytes();
      } catch (TclException e) {
    code = e.getCompletionCode();
    String trace = e.toString();
    // System.out.println("Tcl Oops: "  + code + " " + e);
    if (code == 1) {
        try {
      trace = interp.getVar("errorInfo", TCL.GLOBAL_ONLY).toString();
        } catch (Exception e1) {}
    }
    request.log(Server.LOG_WARNING, propsPrefix + trace);
      }
  }  // end sync block
View Full Code Here

          FileHandler.ROOT,"."), scriptName);
  }
  scriptName = scriptFile.getAbsolutePath();
  server.log(Server.LOG_DIAGNOSTIC, prefix, "Using: " + scriptName);
  try {
      interp = new Interp();
      TclUtil.setVar(interp, "tcl_interactive", "0", TCL.GLOBAL_ONLY);
      TclUtil.setVar(interp, "argv0", scriptName, TCL.GLOBAL_ONLY);
      TclUtil.setVar(interp, "prefix", prefix, TCL.GLOBAL_ONLY);
      TclUtil.setVar(interp, "logLevel", "" + server.logLevel,
        TCL.GLOBAL_ONLY);
View Full Code Here

*/
public class JaclInterpreter implements org.apache.flex.forks.batik.script.Interpreter {
    private Interp interpreter = null;

    public JaclInterpreter() {
        interpreter = new Interp();
        try {
            interpreter.eval("package require java", 0);
        } catch (TclException e) {
        }
    }
View Full Code Here

*/
public class JaclInterpreter implements org.apache.batik.script.Interpreter {
    private Interp interpreter = null;

    public JaclInterpreter() {
        interpreter = new Interp();
        try {
            interpreter.eval("package require java", 0);
        } catch (TclException e) {
        }
    }
View Full Code Here

TOP

Related Classes of tcl.lang.Interp

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.