Package org.glassfish.web.loader

Examples of org.glassfish.web.loader.WebappClassLoader


                classLoader = (WebappClassLoader) cl;
            } else {
                classLoader = AccessController.doPrivileged(new PrivilegedAction<WebappClassLoader>() {
                    @Override
                    public WebappClassLoader run() {
                        return new WebappClassLoader(cl);
                    }
                });
            }
            classLoader.setResources(container.getResources());
            classLoader.setDebug(this.debug);
View Full Code Here


     */
    protected ClassLoader createClassLoader()
        throws Exception {

        Class<?> clazz = Class.forName(loaderClass);
        WebappClassLoader classLoader = null;

        if (parentClassLoader == null) {
            parentClassLoader = Thread.currentThread().getContextClassLoader();
        }
        Class<?>[] argTypes = { ClassLoader.class };
        Object[] args = { parentClassLoader };
        Constructor<?> constr = clazz.getConstructor(argTypes);
        classLoader = (WebappClassLoader) constr.newInstance(args);

        classLoader.setUseMyFaces(useMyFaces);

        /*
         * Start the WebappClassLoader here as opposed to in the course of
         * WebappLoader#start, in order to prevent it from being started
         * twice (during normal deployment, the WebappClassLoader is created
         * by the deployment backend without calling
         * WebappLoader#createClassLoader, and will have been started
         * by the time WebappLoader#start is called)
         */
        try {
            classLoader.start();
        } catch (Exception e) {
            throw new LifecycleException(e);
        }

        return classLoader;
View Full Code Here

                    wbd.setName(Constants.DEFAULT_WEB_MODULE_NAME);
                    wbd.setContextRoot(contextRoot);
                    wmInfo.setLocation(docroot);
                    wmInfo.setDescriptor(wbd);
                    wmInfo.setParentLoader(EmbeddedWebContainer.class.getClassLoader());
                    WebappClassLoader cloader = AccessController.doPrivileged(new PrivilegedAction<WebappClassLoader>() {
                        @Override
                        public WebappClassLoader run() {
                            return new WebappClassLoader(EmbeddedWebContainer.class.getClassLoader());
                        }
                    });
                    wmInfo.setAppClassLoader(cloader);
                }
            }
View Full Code Here

            wbd.setContextRoot("");
            wmInfo.setLocation(new File(docroot));
            wmInfo.setDescriptor(wbd);
            wmInfo.setParentLoader(
                serverContext.getCommonClassLoader());
            WebappClassLoader loader = AccessController.doPrivileged(new PrivilegedAction<WebappClassLoader>() {
                @Override
                public WebappClassLoader run() {
                    return new WebappClassLoader(serverContext.getCommonClassLoader());
                }
            });
            loader.start();           
            wmInfo.setAppClassLoader(loader);
            if ( wbd.getApplication() == null ) {
                Application application = Application.createApplication();
                application.setVirtual(true);
                application.setName(Constants.DEFAULT_WEB_MODULE_NAME);
View Full Code Here

                    wbd.setName(moduleID);
                    wbd.setContextRoot(contextRoot);
                    wmInfo.setDescriptor(wbd);
                    wmInfo.setLocation(docroot);
                    wmInfo.setParentLoader(EmbeddedWebContainer.class.getClassLoader());
                    WebappClassLoader cloader = AccessController.doPrivileged(new PrivilegedAction<WebappClassLoader>() {
                        @Override
                        public WebappClassLoader run() {
                            return new WebappClassLoader(EmbeddedWebContainer.class.getClassLoader());
                        }
                    });
                    wmInfo.setAppClassLoader(cloader);

                }
View Full Code Here

            // Try looking up resource in
            // WEB-INF/lib/[*.jar]/META-INF/resources
            ClassLoader cl = Thread.currentThread().getContextClassLoader();
            String metaInfResPath = Globals.META_INF_RESOURCES + path;
            if (cl instanceof WebappClassLoader) {
                WebappClassLoader wcl = (WebappClassLoader)cl;
                final URL resourceUrl = wcl.getResourceFromJars(metaInfResPath);
                if (resourceUrl != null) {
                    // XXX Remove dependency on WebappClassLoader
                    ConcurrentHashMap<String, ResourceEntry> resourceEntries =
                        wcl.getResourceEntries();
                    ResourceEntry resourceEntry = resourceEntries.get(metaInfResPath);
                    if (resourceEntry != null) {
                        // create a CacheEntry to continue the processing
                        cacheEntry = new CacheEntry();
                        try {
View Full Code Here

            // Try looking up resource in
            // WEB-INF/lib/[*.jar]/META-INF/resources
            ClassLoader cl = Thread.currentThread().getContextClassLoader();
            String metaInfResPath = Globals.META_INF_RESOURCES + path;
            if (cl instanceof WebappClassLoader) {
                WebappClassLoader wcl = (WebappClassLoader)cl;
                final URL resourceUrl = wcl.getResourceFromJars(metaInfResPath);
                if (resourceUrl != null) {
                    // XXX Remove dependency on WebappClassLoader
                    ConcurrentHashMap<String, ResourceEntry> resourceEntries =
                        wcl.getResourceEntries();
                    ResourceEntry resourceEntry = resourceEntries.get(metaInfResPath);
                    if (resourceEntry != null) {
                        // create a CacheEntry to continue the processing
                        cacheEntry = new CacheEntry();
                        try {
View Full Code Here

                classLoader = (WebappClassLoader) cl;
            } else {
                classLoader = AccessController.doPrivileged(new PrivilegedAction<WebappClassLoader>() {
                    @Override
                    public WebappClassLoader run() {
                        return new WebappClassLoader(cl);
                    }
                });
            }
            classLoader.setResources(container.getResources());
            classLoader.setDebug(this.debug);
View Full Code Here

     */
    protected ClassLoader createClassLoader()
        throws Exception {

        Class<?> clazz = Class.forName(loaderClass);
        WebappClassLoader classLoader = null;

        if (parentClassLoader == null) {
            parentClassLoader = Thread.currentThread().getContextClassLoader();
        }
        Class<?>[] argTypes = { ClassLoader.class };
        Object[] args = { parentClassLoader };
        Constructor<?> constr = clazz.getConstructor(argTypes);
        classLoader = (WebappClassLoader) constr.newInstance(args);

        classLoader.setUseMyFaces(useMyFaces);

        /*
         * Start the WebappClassLoader here as opposed to in the course of
         * WebappLoader#start, in order to prevent it from being started
         * twice (during normal deployment, the WebappClassLoader is created
         * by the deployment backend without calling
         * WebappLoader#createClassLoader, and will have been started
         * by the time WebappLoader#start is called)
         */
        try {
            classLoader.start();
        } catch (Exception e) {
            throw new LifecycleException(e);
        }

        return classLoader;
View Full Code Here

                    wbd.setName(Constants.DEFAULT_WEB_MODULE_NAME);
                    wbd.setContextRoot(contextRoot);
                    wmInfo.setLocation(docroot);
                    wmInfo.setDescriptor(wbd);
                    wmInfo.setParentLoader(EmbeddedWebContainer.class.getClassLoader());
                    WebappClassLoader cloader = AccessController.doPrivileged(new PrivilegedAction<WebappClassLoader>() {
                        @Override
                        public WebappClassLoader run() {
                            return new WebappClassLoader(EmbeddedWebContainer.class.getClassLoader());
                        }
                    });
                    wmInfo.setAppClassLoader(cloader);
                }
            }
View Full Code Here

TOP

Related Classes of org.glassfish.web.loader.WebappClassLoader

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.