Exemplo n.º 1
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);
  }
Exemplo n.º 2
0
  public NameSpace(NameSpace parent, BshClassManager classManager, String name) {
    // We might want to do this here rather than explicitly in Interpreter
    // for global (see also prune())
    // if ( classManager == null && (parent == null ) )
    // create our own class manager?

    setName(name);
    setParent(parent);
    setClassManager(classManager);

    // Register for notification of classloader change
    if (classManager != null) classManager.addListener(this);
  }