Package java.net

Examples of java.net.URLClassLoader$IndexFile


            throw new DeployerException("Cannot get the URL for the deployable '" + earDeployable + "'.", e);
        }

        // Create a Root classloader for this EAR
        // Empty classloader
        ClassLoader earClassLoader = new URLClassLoader(new URL[0], Thread.currentThread().getContextClassLoader());

        // Get EJBs of this EAR
        List<EJB3Deployable> ejb3s = earDeployable.getEJB3Deployables();

        // Get the URLs of EJB, WEB and Clients
View Full Code Here


        final URL tmpDirURL = URLUtils.fileToURL(this.tmpDir);

        PrivilegedAction<URLClassLoader> privilegedAction = new PrivilegedAction<URLClassLoader>() {
            public URLClassLoader run() {
                return new URLClassLoader(new URL[] {tmpDirURL}, Thread.currentThread().getContextClassLoader());
            }
        };
        this.endpointClassLoader = AccessController.doPrivileged(privilegedAction);

        ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
View Full Code Here

     *        URLClassLoader)
     * @param servletContextEvent the servlet context event
     */
    protected void addLib(final ClassLoader cl, final ServletContextEvent servletContextEvent) {
        // Get URL ClassLoader
        URLClassLoader urlCl = null;
        if (cl instanceof URLClassLoader) {
            urlCl = (URLClassLoader) cl;
        } else {
            throw new IllegalStateException("Parent classloader is not an URL classloader. Found '" + cl + "'.");
        }
View Full Code Here

            EZBClassLoader currentCL = (EZBClassLoader) this.classLoader;
            return currentCL.duplicate();
        }
        // else, try to see if it's an URL classLoader
        if (this.classLoader instanceof URLClassLoader) {
            return new URLClassLoader(((URLClassLoader) this.classLoader).getURLs(), this.classLoader.getParent());
        }

        throw new IllegalStateException("Cannot build a new temporary classloader");
    }
View Full Code Here

                    isCompatibleJMX);
            if(!isCompatibleJMX){
                classLoader = new JMXMeFirstClassLoader(classpath,
                        ModuleConfig.class.getClassLoader());
            }else{
                classLoader = new URLClassLoader(classpath,
                        ModuleConfig.class.getClassLoader());
            }
            classLoaders.put(key, classLoader);
        }
        return classLoader;
View Full Code Here

   public static void addFile(File f) throws IOException
   { addURL(f.toURL()); }
   public static void addURL(URL u) throws IOException
   {
    URLClassLoader sysloader = (URLClassLoader) Thread.currentThread().getContextClassLoader();
    Class sysclass = URLClassLoader.class;
    try
     { Method method = sysclass.getDeclaredMethod("addURL", new Class[] {URL.class} );
       method.setAccessible(true);
       method.invoke(sysloader, new Object[]{ u });
View Full Code Here

            {
                m_outDebug.println( WrapperManager.getRes().getString( "    Classpath[0]=" ) + classURLs[0] );
            }
        }
       
        URLClassLoader cl = URLClassLoader.newInstance( classURLs, this.getClass().getClassLoader() );
       
        // Look for the specified class by name
        Class mainClass;
        try
        {
View Full Code Here

            for (int i = 0; i < cld.getCount(); i++) {
                String id = cld.getArchiveNames()[i];
                configData = new ConnectorConfigData(id);

                URLClassLoader cl = new URLClassLoader(new URL[] {cld.getUrls()[i]});
                configData.setClassLoader(cl);

                Document dom = new SAXBuilder().build(cld.getConfigInputStreams()[i]);
                init(dom);
View Full Code Here

   protected void testURLClassLoader(VirtualFile ear) throws Exception
   {
      URL[] cp = getEarClassPath(ear);
      log.error("ear classpath: "+Arrays.asList(cp));
      URLClassLoader loader = new URLClassLoader(cp);
      loader.loadClass("org.jboss.seam.example.booking.Hotel");
      loader.loadClass("org.jboss.seam.debug.Contexts");     
   }
View Full Code Here

    public String toString() {
      return this.name;
    }
   
    public ImportFormat getInstance() throws MalformedURLException, ClassNotFoundException, InstantiationException, IllegalAccessException {
      URLClassLoader cl = new URLClassLoader(new URL[] {getBasePathUrl()});
      Class<?> clazz = Class.forName(className, true, cl);
      ImportFormat importFormat = (ImportFormat)clazz.newInstance();
      importFormat.setIsCustomImporter(true);
      return importFormat;
    }
View Full Code Here

TOP

Related Classes of java.net.URLClassLoader$IndexFile

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.