consumerservlet.jar
Description
This bundle provides a org.osgi.service.wireadmin.Consumer to illustrate WireAdmin services (@see chapter 16 in OSGi specification release 3). It updates regulary java.lang.String objects on connected wires
For more details on how to use this bundle, refer to the /doc/readme.html file embedded in the bundle jarfile.
Contributors
Didier Donsez (Didier.Donsez@ieee.org)
License
LGPL
Services
org.osgi.service.wireadmin.Consumer
Properties
- service.pid=fr.imag.adele.osgi.util.StringConsumer
- wireadmin.consumer.flavors=new { class org.osgi.util.position.Position, class org.osgi.util.measurement.Measurement, class java.awt.Image, class java.util.Date, class java.lang.String }
Requirements
- org.osgi.service.wireadmin; specification-version=1.0
- org.osgi.util.measurement; specification-version=1.0
- org.osgi.util.position; specification-version=1.0
- javax.servlet;specification-version=2.3.0
- javax.servlet.http;specification-version=2.3.0
- org.osgi.service.http;specification-version=1.0
- org.ungoverned.gravity.servicebinder;specification-version=1.1
Download
Build
- configure the build properties in build.xml
- then build with ant
Usage
install and start the dependencies
obr -s Http Service
obr -s Service Binder
start http://www-adele.imag.fr/~donsez/dev/osgi/osgi3spec/osgi3spec.jar
start http://www-adele.imag.fr/~donsez/dev/osgi/consumerservlet/consumerservlet.jar
OK, now you can check available producers and create wires between the servlet and them
start http://www-adele.imag.fr/~donsez/dev/osgi/wireadmincmd/wireadmincmd.jar
start http://www-adele.imag.fr/~donsez/dev/osgi/wireadmin/wireadmin.jar
wa
wa -lp
wa -lc
Create wires between the servlet and them
start http://www-adele.imag.fr/~donsez/dev/osgi/dateproducer/dateproducer.jar
wa -c fr.imag.adele.osgi.util.clock fr.imag.adele.osgi.util.consumerservlet
wa -w
Those commands create the following architecture:
Then browse this URL http://localhost/wa/poll?css=style.css
You should see the following document:
For a more complex demo, follows the instruction of the WebCam Producer demo
Servlet parameters
- mimetype: MIME type of the returned document (possible values: text/html, text/xml (TODO), text/vnd.wap.wml (TODO), text/csv(TODO (ie Column Separated Values)), text/plain(TODO) )
- css: CSS stylesheet (only with mimetype=text/html)
- xslt: XSLT stylesheet for the client-side transformation (only with mimetype=text/xml)
- refresh: delay in secondes between document refreshs
Tested gateways
TODO (contributions are welcome)
- use table inside item lists
- automate wire creations/deletions between this servlet and the registered producers (with WireAdminBinder)
- support MIME types : text/xml (TODO), text/vnd.wap.wml (TODO), text/csv(TODO (ie Column Separated Values)), text/plain(TODO)
- customizable bounds in applets and histories
- color range in applets and histories according to values
Links