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

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


    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

    @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

        }

        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

            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

    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

        } catch (URISyntaxException e) {
            throw new DeploymentException("Invalid wsdl URI", e);

        }

        AxisWebServiceContainer axisWebServiceContainer = new AxisWebServiceContainer(location, wsdlURI, service, serviceInfo.getWsdlMap(), new BundleClassLoader(bundle));
        AbstractName webServiceContainerFactoryName = context.getNaming().createChildName(targetGBean.getAbstractName(), "webServiceContainer", GBeanInfoBuilder.DEFAULT_J2EE_TYPE);
        GBeanData webServiceContainerFactoryGBean = new GBeanData(webServiceContainerFactoryName, SerializableWebServiceContainerFactoryGBean.GBEAN_INFO);
        webServiceContainerFactoryGBean.setAttribute("webServiceContainer", axisWebServiceContainer);
        try {
            context.addGBean(webServiceContainerFactoryGBean);
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

        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

    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.