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

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


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


                                           Bundle bundle,
                                           boolean isEJB)
            throws DeploymentException {
        Deployable deployable = module.getDeployable();
        if (deployable instanceof DeployableJarFile) {
            return discoverWebServices( ((DeployableJarFile) deployable).getJarFile(), isEJB, new BundleClassLoader(bundle));
        } else if (deployable instanceof DeployableBundle) {
            return discoverWebServices( ((DeployableBundle) deployable).getBundle(), isEJB);
        } else {
            throw new DeploymentException("Unsupported deployable: " + deployable.getClass());
        }
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)) {
                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

    @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

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

    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

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.