Package com.caucho.loader

Examples of com.caucho.loader.DynamicClassLoader


      path = _resourceManager.resolvePath(location);

    if (path.exists())
      return path;

    DynamicClassLoader loader;
    loader = (DynamicClassLoader) Thread.currentThread().getContextClassLoader();
    String classPath = loader.getClassPath();
    char sep = CauchoSystem.getPathSeparatorChar();

    int head = 0;
    int tail = 0;
View Full Code Here


      path = _resourceManager.resolvePath(location);

    if (path.exists())
      return path;

    DynamicClassLoader loader;
    loader = (DynamicClassLoader) Thread.currentThread().getContextClassLoader();
    String classPath = loader.getClassPath();
    char sep = CauchoSystem.getPathSeparatorChar();

    int head = 0;
    int tail = 0;
   
View Full Code Here

      WebApp app = getWebApp();
      if (app != null && ! hasConf) {
        Path appDir = app.getRootDirectory();

        DynamicClassLoader dynLoader = app.getEnvironmentClassLoader();
        dynLoader.addLoader(new CompilingLoader(dynLoader, appDir.lookup("WEB-INF/classes")));
        dynLoader.addLoader(new DirectoryLoader(dynLoader, appDir.lookup("WEB-INF/lib")));

        Path webXml = appDir.lookup("WEB-INF/web.xml");

        if (webXml.canRead()) {
          try {
View Full Code Here

    WebApp webApp = req.getWebApp();
    Path appDir = webApp.getRootDirectory();
    Path pwd = appDir.lookupNative(webApp.getRealPath(servletPath));
    pwd = pwd.getParent();

    DynamicClassLoader loader;
    loader = (DynamicClassLoader) webApp.getClassLoader();
   
    MergePath stylePath = new MergePath();
    stylePath.addMergePath(pwd);
    stylePath.addMergePath(appDir);

    String resourcePath = loader.getResourcePathSpecificFirst();
    stylePath.addClassPath(resourcePath);
   
    Path hrefPath = stylePath.lookup(href);

    if (hrefPath.canRead()) {
      DynamicClassLoader owningLoader = getStylesheetLoader(href, hrefPath);

      if (owningLoader != null) {
        loader = owningLoader;

        stylePath = new MergePath();
View Full Code Here

    }
  }

  private DynamicClassLoader getStylesheetLoader(String href, Path sourcePath)
  {
    DynamicClassLoader owningLoader = null;
    ClassLoader loader = Thread.currentThread().getContextClassLoader();

    for (; loader != null; loader = loader.getParent()) {
      if (! (loader instanceof DynamicClassLoader))
        continue;

      DynamicClassLoader dynLoader = (DynamicClassLoader) loader;
     
      MergePath mp = new MergePath();
      String resourcePath = dynLoader.getResourcePathSpecificFirst();
      mp.addClassPath(resourcePath);

      Path loaderPath = mp.lookup(href);

      if (loaderPath.getNativePath().equals(sourcePath.getNativePath()))
View Full Code Here

    Path classPath = getWorkPath().lookup(className.replace('.', '/') + ".class");
    if (! classPath.canRead())
      throw new ClassNotFoundException("can't find compiled XSL `" + className + "'");

    DynamicClassLoader loader;
    loader = SimpleLoader.create(parentLoader, getWorkPath(), className);

    Class cl = null;

    // If the loading fails, remove the class because it may be corrupted
View Full Code Here

               ClassLoader parentLoader,
               Path appDir,
               ServletConfig config)
    throws Exception
  {
    DynamicClassLoader loader;

    String fullClassName = className;
    String mangledName = fullClassName.replace('.', '/');

    Path classPath = getClassDir().lookup(mangledName + ".class");
View Full Code Here

    Path classPath = getWorkPath().lookup(className.replace('.', '/') + ".class");
    if (! classPath.canRead())
      throw new ClassNotFoundException("can't find compiled XSL `" + className + "'");

    DynamicClassLoader loader;
    loader = SimpleLoader.create(parentLoader, getWorkPath(), className);

    Class cl = null;

    // If the loading fails, remove the class because it may be corrupted
View Full Code Here

      WebApp app = getWebApp();
      if (app != null && ! hasConf) {
  Path appDir = app.getAppDir();

  DynamicClassLoader dynLoader = app.getEnvironmentClassLoader();
  dynLoader.addLoader(new CompilingLoader(dynLoader, appDir.lookup("WEB-INF/classes")));
  dynLoader.addLoader(new DirectoryLoader(dynLoader, appDir.lookup("WEB-INF/lib")));

  Path webXml = appDir.lookup("WEB-INF/web.xml");

  if (webXml.canRead()) {
    try {
View Full Code Here

      path = _resourceManager.resolvePath(location);

    if (path.exists())
      return path;

    DynamicClassLoader loader;
    loader = (DynamicClassLoader) Thread.currentThread().getContextClassLoader();
    String classPath = loader.getClassPath();
    char sep = CauchoSystem.getPathSeparatorChar();

    int head = 0;
    int tail = 0;
   
View Full Code Here

TOP

Related Classes of com.caucho.loader.DynamicClassLoader

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.