示例#1
0
  public BshClassManager getClassManager() {
    if (classManager != null) return classManager;
    if (parent != null && parent != JAVACODE) return parent.getClassManager();

    System.out.println("experiment: creating class manager");
    classManager = BshClassManager.createClassManager(null /*interp*/);

    // Interpreter.debug("No class manager namespace:" +this);
    return classManager;
  }
示例#2
0
  /** Used for serialization */
  public void prune() {
    // Cut off from parent, we must have our own class manager.
    // Can't do this in the run() command (needs to resolve stuff)
    // Should we do it by default when we create a namespace will no
    // parent of class manager?

    if (this.classManager == null)
      // XXX if we keep the createClassManager in getClassManager then we can axe
      // this?
      setClassManager(BshClassManager.createClassManager(null /*interp*/));

    setParent(null);
  }