I've just committed a strawman port to Java of the Feed Aggregator application into my sandbox so that It now runs on the Java runtime.
http://svn.apache.org/repos/asf/incubator/tuscany/sandbox/slaws/feed-aggregator/ It depends on Sebastien's feed binding so you will need that as well http://svn.apache.org/repos/asf/incubator/tuscany/sandbox/sebastien/java/sca/modules/binding-feed/ So if you run mvn in feed-aggregator it should build you a war that you can deploy to tomcat and you are set (I get an exception when deploying that I haven't looked at yet but doesn't stop it running) I've reused the application look and feel so it should look familiar but a lot of the code is new, for example, it's in Java now as opposed to Python. Here's a picture http://svn.apache.org/repos/asf/incubator/tuscany/sandbox/slaws/feed-aggregator/aggregator.png Basically is an example of using the binding infrastructure to support different channels. There are three in this case. 1/ A HTTP based feed that can be read from any RSS/Atom feed reader. The server comes set up to read BBC news and Engadget so you can just point you feed reader at http://localhost:8080/sample-feed-aggregator/services/AlertsFeedServiceRSS And you should get something. This provides the feed using Sebastine's binding.feed service binding. 2/ A Web 2.0 style where you can manage the feed list. Go to localhost://8080/samples-feed-aggregator/ This does all its work by talking JSONRPC to the same services used behind the scenes in 1/ 3/ A rest style app supported by a PHP SCA display component. This is a little more complex to set up. You need this project and you need PHP installed with the latest version of the PHP SCA_SDO extension. http://svn.apache.org/repos/asf/incubator/tuscany/sandbox/slaws/httpserver.php/ This app could do with being a little less Web2.0 and more like a standard PHP app but I already had most of this so I went with what I had for this exercise. In this case it talks to the same services using web services. So, there were a couple of issues along the way: - The JSONRPC biding fails when transforming my SDOs to JSON (Its OK going JSON->SDO) I had to create my own POJOs and do manual transformations. - JSON->SDO can't handle properties called "Type" - We could do with a JSONRPC client. - The runtime go confused when I tried to create a service with two interfaces. - And of course I get that exception when starting Tomcat There are lots of things we could do - include the binding.feed for retrieving the RSS/Atom feed data as well as - Combine AlertFeedService and AlertService - Remove all the manual SDO stuff - Generally have a tidy up to make such we are demonstrating good practice. Looks messy with the work rounds in and the error handling needs sorting out - Make the Web2.0 client more obviously Web2.0 client by cutting down on server interactions - Make the PHP rest client less Web2.0 and decide what to do with this client (would be nice to have a rest rpc binding in Java :-) - Add back a Python component Anyhow I would like to get this in HEAD alongside the other demos. So take a look and see what you think Simon
