Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Using Spring with ECF Remote Services"

(Host)
(ECF with Spring DM)
Line 32: Line 32:
  
 
=== ECF with Spring DM ===
 
=== ECF with Spring DM ===
 +
 +
[[Image:ECFRemotingServicesWithSpringDM.png]]
  
 
ECF Spring support give you the capability to ...
 
ECF Spring support give you the capability to ...

Revision as of 02:22, 12 February 2010

UNDER CONSTRUCTION by Angelo Zerr and Scott Lewis

Target

Work is underway to support ECF with Spring Dynamic Module to declare your OSGi Services that you want publish (Host aka server side) and retrieve (Consumer aka client side ). See (for the moment) Bug 302113- you can find several bundles that provide  :

  • ...
  • ...

How it works?

ECF with Java code

ECFRemotingServicesWithJavaCode.png

For Host :

  • Create an IContainer with Java code :
  • Publish you services with OSGi services registry :

For Consumer :

  • Create an IContainer with Java code :
  • Retrieve you services with OSGi ServiceTracker :

ECF with Spring DM

ECFRemotingServicesWithSpringDM.png

ECF Spring support give you the capability to ...

Host

  • Create an ECF (server) IContainer with declarative mean by using Spring Dynamic Module :
    <bean class="org.eclipse.ecf.springframework.HostContainerFactoryBean">
    	<property name="containerType" value="ecf.generic.server" />
    </bean>
  • Publish you services with declarative mean :
    <bean id="helloService" class="org.eclipse.ecf.examples.remoteservices.hello.impl.Hello" />
     
    <osgi:service ref="helloService"
    	interface="org.eclipse.ecf.examples.remoteservices.hello.IHello">
    	<osgi:service-properties>
    		<entry key="service.exported.interfaces" value="*" />
    		<entry key="service.exported.configs" value="ecf.generic.server" />
    	</osgi:service-properties>
    </osgi:service>

Here the full XML file spring module-context.xml :

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:osgi="http://www.springframework.org/schema/osgi"
	xsi:schemaLocation="http://www.springframework.org/schema/osgi  
       http://www.springframework.org/schema/osgi/spring-osgi-1.0.xsd
       http://www.springframework.org/schema/beans   
       http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
 
        <!-- 1. Create an ECF (server) IContainer -->
	<bean class="org.eclipse.ecf.springframework.HostContainerFactoryBean">
		<property name="containerType" value="ecf.generic.server" />
	</bean>
 
	<!-- 1. Publish Hello Service implementation -->
	<bean id="helloService" class="org.eclipse.ecf.examples.remoteservices.hello.impl.Hello" />
 
	<osgi:service ref="helloService"
		interface="org.eclipse.ecf.examples.remoteservices.hello.IHello">
		<osgi:service-properties>
			<entry key="service.exported.interfaces" value="*" />
			<entry key="service.exported.configs" value="ecf.generic.server" />
		</osgi:service-properties>
	</osgi:service>
 
</beans>

Consumer

  • Create an ECF (client) IContainer with declarative mean by using Spring Dynamic Module :
    <bean class="org.eclipse.ecf.springframework.ConsumerContainerFactoryBean">
    	<property name="containerType" value="ecf.generic.client" />
    </bean>
  • Retrieve you services with declarative mean :

Examples

Host

TODO

Consumer

TODO

Spring support for ECF

With ECF 3.2 you can NOT use this support.

Back to the top