code: public static GeneratedClassLoader createLoader(
          ClassLoader parent, Object staticDomain)
      {
          Context cx = Context.getContext();
          if (parent == null) {
              parent = cx.getApplicationClassLoader();
          }
          SecurityController sc = cx.getSecurityController();
          GeneratedClassLoader loader;
          if (sc == null) {
              loader = cx.createClassLoader(parent);
          } else {
              Object dynamicDomain = sc.getDynamicSecurityDomain(staticDomain);
              loader = sc.createClassLoader(parent, dynamicDomain);
          }
          return loader;
      }
docs: Create {@link GeneratedClassLoader} with restrictions imposed by
  staticDomain and all current stack frames.
  The method uses the SecurityController instance associated with the
  current {@link Context} to construct proper dynamic domain and create
  corresponding class loader.
  <p>
  If no SecurityController is associated with the current {@link Context} ,
  the method calls {@link Context#createClassLoader(ClassLoader parent)}.
  </p>
  @param parent parent class loader. If null,
  {@link Context#getApplicationClassLoader()} will be used.
  @param staticDomain static security domain.