Simon thank you so much. This really clears things up for me. Your point #2 was my biggest missing link.
Willis C White III IQ Technology Projects IBM CIO Technology & Innovation Poughkeepsie, NY 12601 Home office 845 331-5134 Cell 845 853-3827 "Simon Laws" <[EMAIL PROTECTED]> 07/23/2008 07:04 AM Please respond to [email protected] To [email protected] cc Subject Re: Questions about feed-aggregator sample Hi Willis, Some comments in line. Hope that helps. Simon On Tue, Jul 22, 2008 at 10:28 PM, Willis C White <[EMAIL PROTECTED]> wrote: I don't see any file called AlertsService . I am in theTuscany\apache-tuscany-sca-1.2.1-incubating\tuscany-sca-1.2.1-incubating\samples\feed-aggregator\src\main\java dir. There are only 4 files here and the .composite file seems to be the only other file involved, unless I am missing something. Where is this AlertsService file ? I think Raymond looked at the alert aggregator demo (which does have an AlertsService) rather than the feed aggregator sample. Very similar names! In feed aggregator I see... src main java feed AggregatorImpl.java SampleServer.java Sort.java SortImpl.java resources FeedAggregator.composite I understand the promotion. But I thought to be promoted a service must be declared some place - seems like in this case the service is promoted with out being declared any place. Some notes on the composite file.... <service name="rssSample" promote="RssAggregator"> <tuscany:binding.atom uri="http://localhost:8083/rssAggregator"/> </service> <service name="atomSample" promote="AtomAggregator"> <tuscany:binding.atom uri="http://localhost:8083/atomAggregator "/> </service> <component name="RssAggregator"> <implementation.java class="feed.AggregatorImpl"/> <reference name="rssFeed1"> <tuscany:binding.rss uri=" http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/world/rss.xml"/> </reference> <reference name="rssFeed2"> <tuscany:binding.rss uri="http://www.engadget.com/rss.xml "/> </reference> <reference name="sort" target="Sort"/> <property name="feedTitle">RSS Aggregator Sample</property> </component> <component name="Sort"> <implementation.java class="feed.SortImpl"/> <property name="newFirst">true</property> </component> <component name="AtomAggregator"> <implementation.java class="feed.AggregatorImpl"/> <reference name="sort" target="Sort"/> <reference name="atomFeed1"> <tuscany:binding.atom uri=" http://www.oreillynet.com/pub/feed/1"/> </reference> <reference name="atomFeed2"> <tuscany:binding.atom uri=" http://feeds.feedburner.com/blogspot/Dcni?format=xml"/> </reference> <property name="feedTitle">Atom Aggregator Sample</property> </component> 1. AggregatorImpl is use to implement the two main components here (RSSAggregator & AtomAggregator). The Sort component is a utility 2. AggregatorImpl directly implements the Tuscany Atom Collection interface which you would expect a component that provides an Atom feed to respond to and is marked as @Remotable (see tuscany/modules/binding-atom-abdera) 3. A component that doen't explicity configure services using nested <service> elements provides a default service based on @Service annotation information form the implementation class. If there is no @Service on the implementation class, as is the case here, then the rule in the Java Component Implementation Spec dictate which interfaces are exposed as services. In this case the @Remotable Collection interface will be assumed to define the service interface. 4. When a component provides multiple services then they are referenced usind the ComponentName/ServiceName form. In this case each component only implements one service and hence they are referenced with just the ComponentName form. The ServiceName is assumed. Hence the promotion attributed on the composite level services read, for example, promote="RssAggregator". 5. The net result of this composite file is that two remotely accessible services are exposed. One at http://localhost:8083/rssAggregator and the other at http://localhost:8083/atomAggregator. Also my original questions 2 and 3 are still unclear to me. Sorry, but I still don't see how AggregatorImpl.getFeed and AggregatorImpl.Feed are called when a browser hits "http://localhost:8083/rssAggregator" or " http://localhost:8083/atomAggregator" Based on the two binding.atom entries Tuscany will install two servlets (AtomBindingListenerServlet) at the above addresses. This servlet takes the raw HTTP request and converts in into a request on one of the appropriate methods on the components Collection interface based on the rule for how to treat HTTP requests as Atom requests. Each servlet knows which component to call based on the service promotion configuration. Willis C White III IQ Technology Projects IBM CIO Technology & Innovation Poughkeepsie, NY 12601 Home office 845 331-5134 Cell 845 853-3827 "Raymond Feng" <[EMAIL PROTECTED]> 07/22/2008 01:26 PM Please respond to [email protected] To "tuscany-user" <[email protected]> cc Subject Re: Questions about feed-aggregator sample Resending as the previous message triggered the spam alert and was rejected From: Raymond Feng Sent: Tuesday, July 22, 2008 10:12 AM To: [email protected] Subject: Re: Questions about feed-aggregator sample Hi, 1) This is a service promotion that makes the AtomAggregator component service public and further configure the binding to be ATOM (i.e., expose it as an ATOM service). You can also inline the binidng.atom configuration under the <component> element. There are differences between the two configurations. For the promotion, the composite can be used to implement another SCA component (implementation.composite for recursive composition)and the promoted service becomes a service at the higher level component. For the inline case, you just configure the binding. 2) All operations on the AlertsService interface can be called. 3) The @Remotable applies to the interface instead of the component impl class. Please note AlertsService interface has the @Remotable. Thanks, Raymond From: Willis C White Sent: Tuesday, July 22, 2008 8:41 AM To: [email protected] Subject: Questions about feed-aggregator sample I am trying to understand these lines in the FeedAggregator.composite file <service name="rssSample" promote="RssAggregator"> <tuscany:binding.atom uri="http://localhost:8083/rssAggregator"/> </service> <service name="atomSample" promote="AtomAggregator"> <tuscany:binding.atom uri="http://localhost:8083/atomAggregator"/> </service> These services are not declared in the component stanzas and I don't see an "@Remotable" in the AggregatorImpl.java. 1.How do these lines get wired to the java file? 2.What method to they call? 3.How is it that they talk to code out side of the domain without a "@Remotable" annotation.
<<image/gif>>
<<image/gif>>
