G
Gast2
Gast
Hallo,
ich hab mal ein bischen versucht mich in Spring DM einzulesen
...
1. Mir ist augefallen, dass in der dokumentation immer die Versions nummer hinten fehlen?
Also anstatt http://www.springframework.org/schema/osgi/spring-osgi-1.2.xsd steht nur
http://www.springframework.org/schema/osgi/spring-osgi.xsd
[XML]
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans
xmlns="http://www.springframework.org/schema/osgi"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xsi:schemaLocation="http://www.springframework.org/schema/osgi
http://www.springframework.org/schema/osgi/spring-osgi.xsd
Index of /schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<service id="simpleServiceOsgi" ref="simpleService"
interface="org.xyz.MyService" />
</beans:beans>
[/XML]
hat das einen bestimmten Vorteil?
2. Habe ich mir hier mal angeschaut
Eclipse Magazin 16 - Die Stärke der Drei
wie ich einen Service in die Registry mache!
Also ich habe in meinem Implementation package folgende xml
[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
sgi="http://www.springframework.org/schema/osgi"
xsi:schemaLocation=
"http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
Index of /schema/osgi http://www.springframework.org/schema/osgi/spring-osgi-1.2.xsd">
<bean id="myServiceImpl" class="impl.service.MyServiceImpl" />
<osgi:service ref="myServiceImpl" interface="inter.MyService"/>
</beans>
[/XML]
Und in meinem Client welcher den Service benutzen soll
[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
sgi="http://www.springframework.org/schema/osgi"
xsi:schemaLocation=
"http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
Index of /schema/osgi http://www.springframework.org/schema/osgi/spring-osgi-1.2.xsd">
<bean id="myListener" class="client.MyListener"/>
<osgi:reference id="myService" interface="inter.MyService">
<osgi:listener bind-method="onBind" unbind-method="onUnbind" ref="myListener"/>
</osgi:reference>
</beans>
[/XML]
wie lese ich jetzt den Service aus der registry damit ich ihn in meiner UI benutzen kann?
Und wie implementiere ich den Listener, der soll überwachen wann der Service aktiviert oder deaktiviert wird?Oder?
Danke schon mal=)
ich hab mal ein bischen versucht mich in Spring DM einzulesen
1. Mir ist augefallen, dass in der dokumentation immer die Versions nummer hinten fehlen?
Also anstatt http://www.springframework.org/schema/osgi/spring-osgi-1.2.xsd steht nur
http://www.springframework.org/schema/osgi/spring-osgi.xsd
[XML]
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans
xmlns="http://www.springframework.org/schema/osgi"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xsi:schemaLocation="http://www.springframework.org/schema/osgi
http://www.springframework.org/schema/osgi/spring-osgi.xsd
Index of /schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<service id="simpleServiceOsgi" ref="simpleService"
interface="org.xyz.MyService" />
</beans:beans>
[/XML]
hat das einen bestimmten Vorteil?
2. Habe ich mir hier mal angeschaut
Eclipse Magazin 16 - Die Stärke der Drei
wie ich einen Service in die Registry mache!
Also ich habe in meinem Implementation package folgende xml
[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
xsi:schemaLocation=
"http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
Index of /schema/osgi http://www.springframework.org/schema/osgi/spring-osgi-1.2.xsd">
<bean id="myServiceImpl" class="impl.service.MyServiceImpl" />
<osgi:service ref="myServiceImpl" interface="inter.MyService"/>
</beans>
[/XML]
Und in meinem Client welcher den Service benutzen soll
[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
xsi:schemaLocation=
"http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
Index of /schema/osgi http://www.springframework.org/schema/osgi/spring-osgi-1.2.xsd">
<bean id="myListener" class="client.MyListener"/>
<osgi:reference id="myService" interface="inter.MyService">
<osgi:listener bind-method="onBind" unbind-method="onUnbind" ref="myListener"/>
</osgi:reference>
</beans>
[/XML]
wie lese ich jetzt den Service aus der registry damit ich ihn in meiner UI benutzen kann?
Und wie implementiere ich den Listener, der soll überwachen wann der Service aktiviert oder deaktiviert wird?Oder?
Danke schon mal=)