Examples of DynamicClassLoader


Examples of com.caucho.loader.DynamicClassLoader

                                        boolean isLocal)
  {
    ArrayList<T> services = new ArrayList<T>();

    try {
      DynamicClassLoader loader = _classLoader;

      if (loader == null)
        return services;
     
      String serviceName = "META-INF/services/" + serviceApiClass.getName();
     
      Enumeration<URL> e;
     
      if (isLocal)
        e = loader.findResources(serviceName);
      else
        e = loader.getResources(serviceName);

      while (e.hasMoreElements()) {
        URL url = e.nextElement();

        if (serviceSet.contains(url))
View Full Code Here

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

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

Examples of com.caucho.loader.DynamicClassLoader

      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

Examples of com.caucho.loader.DynamicClassLoader

    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

Examples of com.caucho.loader.DynamicClassLoader

    }
  }

  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

Examples of com.caucho.loader.DynamicClassLoader

    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

Examples of com.facebook.presto.byteCode.DynamicClassLoader

    private static final AtomicLong CLASS_ID = new AtomicLong();

    private DynamicClassLoader createClassLoader()
    {
        return new DynamicClassLoader(getClass().getClassLoader());
    }
View Full Code Here

Examples of com.sandwich.util.io.DynamicClassLoader

 
  protected Path stubAllKoans(String packageName, List<String> path){
    Path oldKoans = PathToEnlightenment.getPathToEnlightenment();
    Map<String, Map<String, KoanElementAttributes>> tempSuitesAndMethods =
      new LinkedHashMap<String, Map<String, KoanElementAttributes>>();
    DynamicClassLoader loader = new DynamicClassLoader();
    for(String suite : path){
      Map<String, KoanElementAttributes> methodsByName = new LinkedHashMap<String, KoanElementAttributes>();
      for(Method m : loader.loadClass(suite).getMethods()){
        if(m.getAnnotation(Koan.class) != null){
          methodsByName.put(m.getName(), new KoanElementAttributes("", m.getName(), "", m.getDeclaringClass().getName()));
        }
      }
      tempSuitesAndMethods.put(suite, methodsByName);
View Full Code Here

Examples of com.sandwich.util.io.classloader.DynamicClassLoader

 
  protected Path stubAllKoans(String packageName, List<String> path){
    Path oldKoans = PathToEnlightenment.getPathToEnlightenment();
    Map<String, Map<String, KoanElementAttributes>> tempSuitesAndMethods =
      new LinkedHashMap<String, Map<String, KoanElementAttributes>>();
    DynamicClassLoader loader = KoanClassLoader.getInstance();
    for(String suite : path){
      Map<String, KoanElementAttributes> methodsByName = new LinkedHashMap<String, KoanElementAttributes>();
      KoanSuiteCompilationListener listener = new KoanSuiteCompilationListener();
      for(Method m : loader.loadClass(suite, listener).getMethods()){
        if(m.getAnnotation(Koan.class) != null){
          methodsByName.put(m.getName(), new KoanElementAttributes(m.getName(), "", m.getDeclaringClass().getName()));
        }
      }
      tempSuitesAndMethods.put(suite, methodsByName);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.