Package org.apache.sling.commons.classloader

Examples of org.apache.sling.commons.classloader.DynamicClassLoaderManager


            // make sure to cleanup any existing class loader
            this.destroyRepositoryClassLoader();

            // get the dynamic class loader for the bundle using this
            // class loader writer
            final DynamicClassLoaderManager dclm = (DynamicClassLoaderManager) this.callerBundle.getBundleContext().getService(
                this.dynamicClassLoaderManager);

            this.repositoryClassLoader = new RepositoryClassLoader(
                    this.classPath,
                    this,
                    dclm.getDynamicClassLoader());
        }
        return this.repositoryClassLoader;
    }
View Full Code Here


   */
  protected ClassLoader getClassLoader() {
    final SlingBindings bindings = (SlingBindings) pageContext.getRequest()
        .getAttribute(SlingBindings.class.getName());
    final SlingScriptHelper scriptHelper = bindings.getSling();
    final DynamicClassLoaderManager dynamicClassLoaderManager = scriptHelper
        .getService(DynamicClassLoaderManager.class);
    final ClassLoader classLoader = dynamicClassLoaderManager
        .getDynamicClassLoader();
    return classLoader;
  }
View Full Code Here

        synchronized ( this ) {
            if ( loader == null || !loader.isLive() ) {
                this.destroyClassLoader();
                // get the dynamic class loader for the bundle using this
                // class loader writer
                final DynamicClassLoaderManager dclm = (DynamicClassLoaderManager) this.callerBundle.getBundleContext().getService(
                    this.dynamicClassLoaderManager);

                loader = new FSDynamicClassLoader(new URL[] {this.rootURL}, dclm.getDynamicClassLoader());
            }
            return this.loader;
        }
    }
View Full Code Here

   */
  protected ClassLoader getClassLoader() {
    final SlingBindings bindings = (SlingBindings) pageContext.getRequest()
        .getAttribute(SlingBindings.class.getName());
    final SlingScriptHelper scriptHelper = bindings.getSling();
    final DynamicClassLoaderManager dynamicClassLoaderManager = scriptHelper
        .getService(DynamicClassLoaderManager.class);
    final ClassLoader classLoader = dynamicClassLoaderManager
        .getDynamicClassLoader();
    return classLoader;
  }
View Full Code Here

        }
    }

    /** Get the dynamic class loader if available */
    public ClassLoader getDynamicClassLoader() {
        final DynamicClassLoaderManager dclm = this.dynamicClassLoaderManager;
        if (dclm != null) {
            return dclm.getDynamicClassLoader();
        }
        return null;
    }
View Full Code Here

        }
    }

    /** Get the dynamic class loader if available */
    ClassLoader getDynamicClassLoader() {
        final DynamicClassLoaderManager dclm = this.dynamicClassLoaderManager;
        if (dclm != null) {
            return dclm.getDynamicClassLoader();
        }
        return null;
    }
View Full Code Here

        final ContextFactory contextFactory = ContextFactory.getGlobal();
        if (contextFactory instanceof SlingContextFactory) {
            ((SlingContextFactory) contextFactory).setDebugging(debugging);
        }
        // set the dynamic class loader as the application class loader
        final DynamicClassLoaderManager dclm = this.dynamicClassLoaderManager;
        if ( dclm != null ) {
            contextFactory.initApplicationClassLoader(dynamicClassLoaderManager.getDynamicClassLoader());
        }
       
        log.info("Activated with optimization level {}", optimizationLevel);
View Full Code Here

        if ( classLoaderManagerReference == null || classLoaderManagerReference.getBundle() == null ) {
            dynamicClassLoader = null;
            classLoaderManagerReference = bundleContext.getServiceReference(DynamicClassLoaderManager.class.getName());
        }
        if ( dynamicClassLoader == null && classLoaderManagerReference != null ) {
            final DynamicClassLoaderManager dclm = (DynamicClassLoaderManager) bundleContext.getService(classLoaderManagerReference);
            if ( dclm != null ) {
                dynamicClassLoader = dclm.getDynamicClassLoader();
            }
        }
        return dynamicClassLoader;
    }
View Full Code Here

TOP

Related Classes of org.apache.sling.commons.classloader.DynamicClassLoaderManager

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.