code: public static synchronized Stack getStack(String className) throws InternalException {
      println(new StringBuilder().append("StackManager.getStack(\"").append(className).append("\")").toString());
      if (!initialized) {
        initialize();
      }
      // Gets the classloader of the code that called this method, may be null.
      ClassLoader callerCL = ClassLoader.getSystemClassLoader();
      // Walk through the loaded stacks attempting to locate someone who understands the given URL.
      for (StackInfo di : stacks) {
        // If the caller does not have permission to load the stack then skip it.
        if (getCallerClass(callerCL, di.stackClassName) != di.stackClass) {
          println(new StringBuilder().append("    skipping: ").append(di).toString());
          continue;
        }
        println(new StringBuilder().append("    trying ").append(di).toString());
        if (di.stackClassName.equals(className)) {
          // Success!
          println("geStack returning " + di);
          return (di.stack);
        }
      }
  
      println("getStack: no suitable stack");
      throw new InternalException("No suitable stack");
    }
docs: Attempts to locate a stack.
  The <code>StackManager</code> attempts to select an appropriate stack from
  the set of registered Diameter stacks.
  @param className class name of stack
  @return stack instance
  @exception InternalException if a manager has internal error