Package org.eclipse.jetty.webapp

Examples of org.eclipse.jetty.webapp.WebAppClassLoader$Context


        // Is this a webapp or a normal context
        Resource classes=getBaseResource().addPath("WEB-INF/classes/");
        Resource lib=getBaseResource().addPath("WEB-INF/lib/");
        if (classes.exists() && classes.isDirectory() || lib.exists() && lib.isDirectory())
        {
            _webappLoader=new WebAppClassLoader(_libLoader,this);
            _webappLoader.setName(key);
            if (classes.exists())
                _webappLoader.addClassPath(classes);
            if (lib.exists())
                _webappLoader.addJars(lib);           
View Full Code Here


               
                    if (classes.exists()||lib.exists())
                    {
                        final AtomicBoolean locked =new AtomicBoolean(false);
                       
                        WebAppClassLoader webapp_loader=new WebAppClassLoader(loader,webappcontext)
                        {
                            @Override
                            public void addClassPath(Resource resource) throws IOException
                            {
                                if (!locked.get())
                                    super.addClassPath(resource);
                            }

                            @Override
                            public void addClassPath(String classPath) throws IOException
                            {
                                if (!locked.get())
                                    super.addClassPath(classPath);
                            }

                            @Override
                            public void addJars(Resource lib)
                            {
                                if (!locked.get())
                                    super.addJars(lib);
                            }
                        };

                        if (classes.exists())
                            webapp_loader.addClassPath(classes);
                        if (lib.exists())
                            webapp_loader.addJars(lib);
                        locked.set(true);
                       
                        loader=webapp_loader;
                    }
                }
View Full Code Here

        }

        webapp.setWar(war);
        webapp.setExtractWAR(true);
        webapp.setParentLoaderPriority(true);
        webapp.setClassLoader(new WebAppClassLoader(Main.class.getClassLoader(), webapp));

        return webapp;
    }
View Full Code Here

   */
  public void reloadContext() throws Exception {
    System.out.println("Application reloading");
    this.webAppContext.stop();

    WebAppClassLoader classLoader = new WebAppClassLoader(this.webAppContext);
    classLoader.addClassPath("target/classes");
    classLoader.addClassPath("target/test-classes");
    this.webAppContext.setClassLoader(classLoader);

    this.webAppContext.start();

    System.out.println("Application reloaded");
View Full Code Here

    /*
     * Check if user want's to register webapps
     */
    if (webAppDir != null) {
      final WebAppContext webapp = new WebAppContext ();
      final WebAppClassLoader classloader;
      try {
        classloader = new WebAppClassLoader (loader, webapp);
      } catch (final Throwable exception) {
        throw (new Error (exception));
      }
      if (!"embedded".equals (webAppDir)) {
        webapp.setWar (webAppDir);
View Full Code Here

        private void configureClassLoader(WebAppContext context) throws Exception {
            List classPathFiles = createClassPath();

            if (classPathFiles != null) {
                WebAppClassLoader cl = (WebAppClassLoader) context.getClassLoader();

                for (Iterator i = classPathFiles.iterator(); i.hasNext(); ) {
                    cl.addClassPath(((File) i.next()).getCanonicalPath());
                }
            }

            // knock out environmental maven and plexus classes from webAppContext
            String[] existingServerClasses = context.getServerClasses();
View Full Code Here

    WebAppContext context = (WebAppContext) server.getHandler();

    System.out.println("[INFO] Application reloading");
    context.stop();

    WebAppClassLoader classLoader = new WebAppClassLoader(context);
    classLoader.addClassPath("target/classes");
    classLoader.addClassPath("target/test-classes");
    context.setClassLoader(classLoader);

    context.start();

    System.out.println("[INFO] Application reloaded");
View Full Code Here

        private void configureClassLoader(WebAppContext context) throws Exception {
            List classPathFiles = createClassPath();

            if (classPathFiles != null) {
                WebAppClassLoader cl = (WebAppClassLoader) context.getClassLoader();

                for (Iterator i = classPathFiles.iterator(); i.hasNext(); ) {
                    cl.addClassPath(((File) i.next()).getCanonicalPath());
                }
            }

            // knock out environmental maven and plexus classes from webAppContext
            String[] existingServerClasses = context.getServerClasses();
View Full Code Here

TOP

Related Classes of org.eclipse.jetty.webapp.WebAppClassLoader$Context

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.