Package org.eclipse.gemini.blueprint.service.exporter.support

Examples of org.eclipse.gemini.blueprint.service.exporter.support.OsgiServiceFactoryBean


  private void registerOsgiService(final String beanName, final OsgiService service) {
    final Class<?> type = applicationContext.getType(beanName);
    final Class<?>[] interfaces = getInterfaces(type, service);
        try {
            logger.debug("Registering bean {} as OSGi service using interfaces {}.", beanName, Arrays.asList(interfaces));
            final OsgiServiceFactoryBean factoryBean = new OsgiServiceFactoryBean();
            factoryBean.setServiceProperties(getServiceProperties(service));
            factoryBean.setInterfaces(interfaces);
            factoryBean.setBeanFactory(applicationContext);
            factoryBean.setTargetBeanName(beanName);
            factoryBean.setBundleContext(bundleContext);
            factoryBean.afterPropertiesSet();
        } catch (final Exception e) {
            logger.warn("Error registering bean '{}' as OSGi service.", beanName, e);
        }
    }
View Full Code Here

TOP

Related Classes of org.eclipse.gemini.blueprint.service.exporter.support.OsgiServiceFactoryBean

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.