import org.apache.tuscany.sca.host.embedded.SCADomain;
public class SampleServer {
public static void main(String[] args) throws Exception {
SCADomain scaDomain = SCADomain.newInstance("FeedAggregator.composite");
try {
System.out.println("Sample Feed server started (press enter to shutdown)");
System.out.println();
System.out.println("To read the aggregated feeds, point your Web browser to the following addresses:");
System.out.println("http://localhost:8083/atomAggregator");
System.out.println("http://localhost:8083/rssAggregator");
System.out.println("http://localhost:8083/atomAggregator?feedType=rss_2.0");
System.out.println("http://localhost:8083/rssAggregator?feedType=atom_1.0");
System.out.println();
System.in.read();
} catch (IOException e) {
e.printStackTrace();
}
// RssFeed feedService = scaDomain.getService(RssFeed.class,
// "RssAggregatorComponent");
// SyndFeed syndFeed = feedService.get();
// SyndFeedOutput output = new SyndFeedOutput();
// output.output(syndFeed,new PrintWriter(System.out));
scaDomain.close();
System.out.println("Sample Feed server stopped");
}