Examples of BundleClassLoader


Examples of org.apache.xbean.osgi.bundle.util.BundleClassLoader

        Set<ConfigurationResource> faceletsLibraries = new HashSet<ConfigurationResource>();
        faceletsLibraries.addAll(JSF_FACELET_CONFIG_RESOURCES.get(webModule.getEarContext().getGeneralData()));
        faceletsLibraries.addAll(getContextFaceletsLibraries(webApp, webModule));
        myFacesWebAppContextData.setAttribute("faceletConfigResources", faceletsLibraries);

        ClassLoader deploymentClassLoader = new BundleClassLoader(bundle);
        ClassLoader oldContextClassLoader = Thread.currentThread().getContextClassLoader();
        try {
            Thread.currentThread().setContextClassLoader(deploymentClassLoader);
            StandaloneExternalContext standaloneExternalContext = new StandaloneExternalContext(deploymentClassLoader);
            FacesConfigurationProviderFactory.setFacesConfigurationProviderFactory(standaloneExternalContext, new GeronimoFacesConfigurationProviderFactory(standardFacesConfig, webAppFacesConfig,
View Full Code Here

Examples of org.apache.xbean.osgi.bundle.util.BundleClassLoader

    private AppInfo getAppInfo(EARContext earContext, EjbModule ejbModule, Bundle bundle) throws DeploymentException {
        EarData earData = EarData.KEY.get(earContext.getGeneralData());
        if (earData.getAppInfo() == null) {

            ClassLoader bundleLoader = new BundleClassLoader(bundle);

            // temporary classloader is used for processing ejb annotations and byte code manipulation during ejb load
//            TemporaryClassLoader temporaryClassLoader = new TemporaryClassLoader(new URL[0], bundleLoader);

            // create an openejb app module for the ear containing all ejb modules
View Full Code Here

Examples of org.apache.xbean.osgi.bundle.util.BundleClassLoader

                    log.warn("jar file {} not found in bundle: {}", urlString, bundle.toString());
                }
            }
        }
       
        classLoader = new BundleClassLoader(bundle, BundleResourceHelper.getSearchWiredBundles(false), BundleResourceHelper.getConvertResourceUrls(true));
       
        if (managedClassNames == null) {
            managedClassNames = NO_STRINGS;
        }
        if (properties == null) {
View Full Code Here

Examples of org.apache.xbean.osgi.bundle.util.BundleClassLoader

        /*
         *  jaxrs 1.1 spec section 2.3.2 If an Application subclass is present and there is already a servlet defined that has a servlet initialization
         * ...
         */
        Class<? extends Application> applicationClass;
        BundleClassLoader bundleClassLoader = new BundleClassLoader(bundle);
        for (Servlet servlet : webApp.getServlet()) {
            List<ParamValue> params = servlet.getInitParam();
            for (ParamValue parm : params) {
                if (!parm.getParamName().trim().equals("javax.ws.rs.Application")) {
                    continue;
                }
                for (Class<? extends Application> clazz : applicationClasses) {
                    if (clazz.getName().equalsIgnoreCase(parm.getParamValue().trim())) {
                        applicationClass = clazz;
                        Class<?> servletClass = null;
                        try {
                            servletClass = bundleClassLoader.loadClass(servlet.getServletClass());
                        } catch (ClassNotFoundException e) {
                            log.warn("failed to load servlet class:" + servlet.getServletClass());
                        }
                        if ((servletClass == null) || !servletClass.isAssignableFrom(HttpServlet.class)) {
                            servlet.setServletClass(REST_SERVLET_NAME);
View Full Code Here

Examples of org.apache.xbean.osgi.bundle.util.BundleClassLoader

            this.classLoader = classLoader;
            this.transformers = new ArrayList<TransformerWrapper>();

            // This classloader can only be used during PersistenceProvider.createContainerEntityManagerFactory() calls
            // Possible that it could be cleaned up sooner, but for now it's destroyed when the PUGBean is stopped
            this.tempClassLoader = new TemporaryClassLoader(new BundleClassLoader(bundle,true,false));
            this.bundle = bundle;
        }
View Full Code Here

Examples of org.apache.xbean.osgi.bundle.util.BundleClassLoader

    protected ClassLoader getContextClassLoader() {
        ClassLoader contextCL = Thread.currentThread().getContextClassLoader();
        List<Bundle> bundles = new ArrayList<Bundle>(2);
        bundles.add(BundleUtils.getBundle(contextCL, false));
        bundles.add(BundleUtils.getBundle(RestServlet.class.getClassLoader(), true));
        return new BundleClassLoader(new DelegatingBundle(bundles));
    }
View Full Code Here

Examples of org.apache.xbean.osgi.bundle.util.BundleClassLoader

    @Override
    public void start(BundleContext bundleContext) throws Exception {
        InputStream in = bundleContext.getBundle().getResource(ResourceConfigReader.CONFIG_FILE).openStream();
        ClassLoader tccl = Thread.currentThread().getContextClassLoader();
        Thread.currentThread().setContextClassLoader(new BundleClassLoader(bundleContext.getBundle()));
        ResourceConfig config;
        try {
            config = new ResourceConfigReader(new BundleClassLoader(bundleContext.getBundle())).parse(in);
        } finally {
            Thread.currentThread().setContextClassLoader(tccl);
        }

        ConfigService configService = new ConfigServiceImpl(config);
View Full Code Here

Examples of org.apache.xbean.osgi.bundle.util.BundleClassLoader

        }

        if (FrameworkUtils.useURLClassLoader() && FrameworkUtils.isEquinox()) {
            this.classLoader = new EquinoxBundleClassLoader(bundleContext.getBundle());
        } else {
            this.classLoader = new BundleClassLoader(bundleContext.getBundle());
        }

        name = gbeanInfo.getName();

        // interfaces
View Full Code Here

Examples of org.apache.xbean.osgi.bundle.util.BundleClassLoader

            Callback callback = getPortMethodInterceptor();
            this.methodInterceptors = new Callback[] {NoOp.INSTANCE, callback};

            // create service class
            Enhancer enhancer = new Enhancer();
            enhancer.setClassLoader(new BundleClassLoader(bundle));
            enhancer.setSuperclass(superClass);
            enhancer.setCallbackFilter(new PortMethodFilter());
            enhancer.setCallbackTypes(new Class[] { NoOp.class, MethodInterceptor.class });
            enhancer.setUseFactory(false);
            enhancer.setUseCache(false);
View Full Code Here

Examples of org.apache.xbean.osgi.bundle.util.BundleClassLoader

    protected List<Handler> buildHandlerChain(HandlerChainInfo hc,
                                              Bundle bundle) {
        if (matchServiceName(portInfo, hc)
                && matchPortName(portInfo, hc)
                && matchBinding(portInfo, hc)) {
            return buildHandlerChain(hc, new BundleClassLoader(bundle));
        } else {
            return Collections.emptyList();
        }
    }
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.