Examples of WebappClassLoader


Examples of org.apache.catalina.loader.WebappClassLoader

   * Typically called through ReflectiveLoadTimeWeaver.
   * @see org.springframework.instrument.classloading.LoadTimeWeaver#getThrowawayClassLoader
   * @see org.springframework.instrument.classloading.ReflectiveLoadTimeWeaver
   */
  public ClassLoader getThrowawayClassLoader() {
    WebappClassLoader tempLoader = new WebappClassLoader();
    // Use reflection to copy all the fields since most of them are private
    // on pre-5.5 Tomcat.
    shallowCopyFieldState(this, tempLoader);
    return tempLoader;
  }
View Full Code Here

Examples of org.apache.catalina.loader.WebappClassLoader

   * Typically called through ReflectiveLoadTimeWeaver.
   * @see org.springframework.instrument.classloading.LoadTimeWeaver#getThrowawayClassLoader
   * @see org.springframework.instrument.classloading.ReflectiveLoadTimeWeaver
   */
  public ClassLoader getThrowawayClassLoader() {
    WebappClassLoader tempLoader = new WebappClassLoader();
    // Use reflection to copy all the fields since most of them are private
    // on pre-5.5 Tomcat.
    shallowCopyFieldState(this, tempLoader);
    return tempLoader;
  }
View Full Code Here

Examples of org.apache.catalina.loader.WebappClassLoader

   * Typically called through ReflectiveLoadTimeWeaver.
   * @see org.springframework.instrument.classloading.LoadTimeWeaver#getThrowawayClassLoader
   * @see org.springframework.instrument.classloading.ReflectiveLoadTimeWeaver
   */
  public ClassLoader getThrowawayClassLoader() {
    WebappClassLoader tempLoader = new WebappClassLoader();
    // Use reflection to copy all the fields since most of them are private
    // on pre-5.5 Tomcat.
    shallowCopyFieldState(this, tempLoader);
    return tempLoader;
  }
View Full Code Here

Examples of org.apache.catalina.loader.WebappClassLoader

    }
   

    private Object loadInstance(String className){
        try{
            WebappClassLoader loader = (WebappClassLoader)
                                                getLoader().getClassLoader();
            Class clazz = loader.loadClass(className);
            return clazz.newInstance();
        } catch (Throwable ex){
            String msg = _rb.getString("webcontainer.unableToLoadExtension");
            msg = MessageFormat.format(msg, new Object[] { className,
                                                           getName() });
View Full Code Here

Examples of org.apache.catalina.loader.WebappClassLoader

   * Typically called through ReflectiveLoadTimeWeaver.
   * @see org.springframework.instrument.classloading.LoadTimeWeaver#getThrowawayClassLoader
   * @see org.springframework.instrument.classloading.ReflectiveLoadTimeWeaver
   */
  public ClassLoader getThrowawayClassLoader() {
    WebappClassLoader tempLoader = new WebappClassLoader();
    // Use reflection to copy all the fields since they are not exposed any other way.
    shallowCopyFieldState(this, tempLoader);
    return tempLoader;
  }
View Full Code Here

Examples of org.eclipse.jetty.webapp.WebAppClassLoader

            Server server = new Server();

            SipAppContext context = new SipAppContext();
            context.setServer(server);
            context.getSipMetaData().setAppName("myApp");
            context.setClassLoader(new WebAppClassLoader(Thread.currentThread().getContextClassLoader(), context));
            context.setOverrideSipDescriptors(Arrays.asList(getClass().getResource("/sip.xml").toString()));
            context.setServletHandler(new SipServletHandler());
           
            Thread.currentThread().setContextClassLoader(context.getClassLoader());
           
View Full Code Here

Examples of org.eclipse.jetty.webapp.WebAppClassLoader

    private static WebAppContext buildContext() throws IOException {
        ProtectionDomain protectionDomain = Startup.class.getProtectionDomain();
        URL location = protectionDomain.getCodeSource().getLocation();

        WebAppContext context = new WebAppContext();
        WebAppClassLoader webAppClassLoader = new WebAppClassLoader(Startup.class.getClassLoader(),context);
        context.setClassLoader(webAppClassLoader);
        context.setContextPath(URIUtil.SLASH);
        context.setWar(location.toExternalForm());

        if( tempDir != null ) {
View Full Code Here

Examples of org.eclipse.jetty.webapp.WebAppClassLoader

    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

Examples of org.eclipse.jetty.webapp.WebAppClassLoader

           
            ClassLoader parentLoader = this.getClass().getClassLoader();
            if (parentLoader instanceof AntClassLoader)
                parentLoader = new AntURLClassLoader((AntClassLoader)parentLoader);

            setClassLoader(new WebAppClassLoader(parentLoader, this));
            if (attributes != null && attributes.getAttributes() != null)
            {
                for (Attribute a:attributes.getAttributes())
                    setAttribute(a.getName(), a.getValue());
            }
View Full Code Here

Examples of org.eclipse.jetty.webapp.WebAppClassLoader

     */
    @Before
    public void setUp() throws Exception
    {
        context = new WebAppContext();
        context.setClassLoader(new WebAppClassLoader(Thread.currentThread().getContextClassLoader(), context));
        ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
        Thread.currentThread().setContextClassLoader(context.getClassLoader());
        Context icontext = new InitialContext();
        Context compCtx =  (Context)icontext.lookup ("java:comp");
        compCtx.createSubcontext("env");
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.