Package org.apache.xbean.osgi.bundle.util

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


    }

    public ClassLoader getClassLoaderFor(ObjectName objectName) throws InstanceNotFoundException {
        AbstractName abstractName = toAbstractName(objectName);
        try {
            return new BundleClassLoader(kernel.getBundleFor(abstractName));
        } catch (GBeanNotFoundException e) {
            throw (InstanceNotFoundException)new InstanceNotFoundException(objectName.getCanonicalName()).initCause(e);
        }
    }
View Full Code Here


    }

    public Object getObject(AbstractName objectName) {
        ClassLoader cl = null;
        try {
            cl = new BundleClassLoader(kernel.getBundleFor(objectName));
        } catch(GBeanNotFoundException e) {
            cl = KernelManagementHelper.class.getClassLoader();
        }
        return kernel.getProxyManager().createProxy(objectName, cl);
    }
View Full Code Here

            } else if (type.equals(ConfigurationModuleType.WAR)||type.equals(ConfigurationModuleType.WAB)) {
                result = config.findGBean(new AbstractNameQuery(WebModule.class.getName()));
            } else {
                return null;
            }
            ClassLoader classLoader = new BundleClassLoader(kernel.getBundleFor(result));
            return (J2EEDeployedObject) kernel.getProxyManager().createProxy(result, classLoader);
        } catch (GBeanNotFoundException e) {
            throw new IllegalStateException("Bad config ID: " + e.getMessage(), e);
        }
    }
View Full Code Here

        FactoryRegistry.setFactory(EndpointLifecycleManagerFactory.class, new GeronimoEndpointLifecycleManagerFactory());

        configureAddressing();

        this.service.addParameter(new Parameter(org.apache.axis2.jaxws.spi.Constants.CACHE_CLASSLOADER, new BundleClassLoader(bundle)));
    }
View Full Code Here

        addGBeanToConfiguration(configuration, gbean, start);
    }

    private void addGBeanToConfiguration(Configuration configuration, GBeanData gbean, boolean start) throws InvalidConfigException {
        ClassLoader configurationClassLoader = new BundleClassLoader(configuration.getBundle());
        ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
        try {
            Thread.currentThread().setContextClassLoader(configurationClassLoader);

            log.trace("Registering GBean " + gbean.getAbstractName());
View Full Code Here

        // ( a TCCL that is consistent with what is set when the same
        // classes are loaded when the configuration is started.
        Thread thread = Thread.currentThread();
        ClassLoader oldCl = thread.getContextClassLoader();
        //TODO OSGI fixme
        thread.setContextClassLoader(new BundleClassLoader(context.getConfiguration().getBundle()));
        try {
            try {
                configurationDatas.add(context.getConfigurationData());
            } catch (DeploymentException e) {
                Configuration configuration = context.getConfiguration();
View Full Code Here

        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

    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

                    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

        /*
         *  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

TOP

Related Classes of org.apache.xbean.osgi.bundle.util.BundleClassLoader

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.