Package java.net

Examples of java.net.URLClassLoader.loadClass()


       
        try {
            final String callableClass = "org.apache.sling.crankstart.core.CrankstartFileProcessor";
           
            @SuppressWarnings("unchecked")
            final Callable<Object> c = (Callable<Object>)launcherClassloader.loadClass(callableClass).newInstance();
            c.call();
        } finally {
            if(launcherClassloader instanceof Closeable) {
                ((Closeable)launcherClassloader).close();
            }
View Full Code Here


            }
            // Use the class loader of the interface as parent, else
            // compile will fail at using it via an Ant task.
            URLClassLoader ucl = new URLClassLoader(new URL[]{url}, CompilerListener.class
                    .getClassLoader());
            listener = ucl.loadClass(fullName);
        }
        if (listener != null)
        {
            instance = listener.newInstance();
        }
View Full Code Here

        urls[i++] = ((JarURLConnection) conn).getJarFileURL();

        // System.out.println("URLs: " + Arrays.toString(urls));

        try(URLClassLoader loader = new URLClassLoader(urls, null)) {
          Class<?> clazz = loader.loadClass(clsName);

          if(startSymbol == null) {
            // attempt to guess start symbol from available classes
            for(Class<?> f : clazz.getDeclaredClasses()) {
              if(f.getSimpleName().startsWith("start__")) {
View Full Code Here

          }
          if(startSymbol == null)
            fatal("Start symbol required", "--start STARTSYMBOL");


          Class<?> INodeFlattener = loader.loadClass("org.rascalmpl.parser.gtd.result.out.INodeFlattener");
          Class<?> INodeConstructorFactory = loader.loadClass("org.rascalmpl.parser.gtd.result.out.INodeConstructorFactory");
          Class<?> DefaultNodeFlattener = loader.loadClass("org.rascalmpl.parser.gtd.result.out.DefaultNodeFlattener");
          Class<?> UPTRNodeFactory = loader.loadClass("org.rascalmpl.parser.uptr.UPTRNodeFactory");
          Class<?> ParseError = loader.loadClass("org.rascalmpl.parser.gtd.exception.ParseError");
          Class<?> UndeclaredNonTerminalException = loader.loadClass("org.rascalmpl.parser.gtd.exception.UndeclaredNonTerminalException");
View Full Code Here

          if(startSymbol == null)
            fatal("Start symbol required", "--start STARTSYMBOL");


          Class<?> INodeFlattener = loader.loadClass("org.rascalmpl.parser.gtd.result.out.INodeFlattener");
          Class<?> INodeConstructorFactory = loader.loadClass("org.rascalmpl.parser.gtd.result.out.INodeConstructorFactory");
          Class<?> DefaultNodeFlattener = loader.loadClass("org.rascalmpl.parser.gtd.result.out.DefaultNodeFlattener");
          Class<?> UPTRNodeFactory = loader.loadClass("org.rascalmpl.parser.uptr.UPTRNodeFactory");
          Class<?> ParseError = loader.loadClass("org.rascalmpl.parser.gtd.exception.ParseError");
          Class<?> UndeclaredNonTerminalException = loader.loadClass("org.rascalmpl.parser.gtd.exception.UndeclaredNonTerminalException");
         
View Full Code Here

            fatal("Start symbol required", "--start STARTSYMBOL");


          Class<?> INodeFlattener = loader.loadClass("org.rascalmpl.parser.gtd.result.out.INodeFlattener");
          Class<?> INodeConstructorFactory = loader.loadClass("org.rascalmpl.parser.gtd.result.out.INodeConstructorFactory");
          Class<?> DefaultNodeFlattener = loader.loadClass("org.rascalmpl.parser.gtd.result.out.DefaultNodeFlattener");
          Class<?> UPTRNodeFactory = loader.loadClass("org.rascalmpl.parser.uptr.UPTRNodeFactory");
          Class<?> ParseError = loader.loadClass("org.rascalmpl.parser.gtd.exception.ParseError");
          Class<?> UndeclaredNonTerminalException = loader.loadClass("org.rascalmpl.parser.gtd.exception.UndeclaredNonTerminalException");
         
         
View Full Code Here


          Class<?> INodeFlattener = loader.loadClass("org.rascalmpl.parser.gtd.result.out.INodeFlattener");
          Class<?> INodeConstructorFactory = loader.loadClass("org.rascalmpl.parser.gtd.result.out.INodeConstructorFactory");
          Class<?> DefaultNodeFlattener = loader.loadClass("org.rascalmpl.parser.gtd.result.out.DefaultNodeFlattener");
          Class<?> UPTRNodeFactory = loader.loadClass("org.rascalmpl.parser.uptr.UPTRNodeFactory");
          Class<?> ParseError = loader.loadClass("org.rascalmpl.parser.gtd.exception.ParseError");
          Class<?> UndeclaredNonTerminalException = loader.loadClass("org.rascalmpl.parser.gtd.exception.UndeclaredNonTerminalException");
         
         
          Method method = clazz.getMethod("parse", String.class, URI.class, char[].class, INodeFlattener, INodeConstructorFactory);
View Full Code Here

          Class<?> INodeFlattener = loader.loadClass("org.rascalmpl.parser.gtd.result.out.INodeFlattener");
          Class<?> INodeConstructorFactory = loader.loadClass("org.rascalmpl.parser.gtd.result.out.INodeConstructorFactory");
          Class<?> DefaultNodeFlattener = loader.loadClass("org.rascalmpl.parser.gtd.result.out.DefaultNodeFlattener");
          Class<?> UPTRNodeFactory = loader.loadClass("org.rascalmpl.parser.uptr.UPTRNodeFactory");
          Class<?> ParseError = loader.loadClass("org.rascalmpl.parser.gtd.exception.ParseError");
          Class<?> UndeclaredNonTerminalException = loader.loadClass("org.rascalmpl.parser.gtd.exception.UndeclaredNonTerminalException");
         
         
          Method method = clazz.getMethod("parse", String.class, URI.class, char[].class, INodeFlattener, INodeConstructorFactory);
          URI inputURI;
View Full Code Here

          Class<?> INodeFlattener = loader.loadClass("org.rascalmpl.parser.gtd.result.out.INodeFlattener");
          Class<?> INodeConstructorFactory = loader.loadClass("org.rascalmpl.parser.gtd.result.out.INodeConstructorFactory");
          Class<?> DefaultNodeFlattener = loader.loadClass("org.rascalmpl.parser.gtd.result.out.DefaultNodeFlattener");
          Class<?> UPTRNodeFactory = loader.loadClass("org.rascalmpl.parser.uptr.UPTRNodeFactory");
          Class<?> ParseError = loader.loadClass("org.rascalmpl.parser.gtd.exception.ParseError");
          Class<?> UndeclaredNonTerminalException = loader.loadClass("org.rascalmpl.parser.gtd.exception.UndeclaredNonTerminalException");
         
         
          Method method = clazz.getMethod("parse", String.class, URI.class, char[].class, INodeFlattener, INodeConstructorFactory);
          URI inputURI;
          if(input != null)
View Full Code Here

      if(hackedFile.exists()) {
        URL u = hackedFile.toURI().toURL();
        URLClassLoader cl = new URLClassLoader(new URL[]{u}, Main.class.getClassLoader());
       
        @SuppressWarnings("unchecked")
        Class<Frame> launcherFrame = (Class<Frame>) cl.loadClass("net.minecraft.LauncherFrame");
       
        String[] nargs = new String[args.length];
        System.arraycopy(args, 0, nargs, 0, args.length); // Transfer the arguments from the process call so that the launcher gets them
        Method main = launcherFrame.getMethod("main", new Class[]{ String[].class });
        main.invoke(launcherFrame, new Object[]{ nargs });
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.