Thursday, December 28, 2006

Service Aggregation (In Fada/Servent)

Inspired by one of the examples (Aggregation) available on swallow cvs, the following code example/tutorial shows how we can search for services on the P2P based on their FADA entries. The FADA entries are usually the SMID or Service Manifest ID.

For simplicity, the examples have a simplified HelloWorld service that uses straight POJOs than do not use xmlrpc holders like in the other previous examples.

On the example 2 services are deployed which implement the same interface, and are published with the same SMID.

Once the services are published (done identically to the previous tutorials where we execute the included deploy.sh), we can inspect the Items registered in our local FADA node. The figure above illustrates the Items in our node with the one of the Entries (the SMID) equal to "SampleAggregator".

With this information and the java class interface, we can then lauch an search to find services that interface and that has Entries. This is achieved with the following code:


Our method receives a String Array of SMIDs (only one in our example) and uses that and the class signature to search for suitable services. The search is a boolean search (1 or 0) in the sense that only returns services that exactly match our query*.

In our example, we simple execute a remote method that retrieves the endpoint of the service. The figure below illustrates the output results once the services are deployed and running.



Please download below the Eclipse projects with source code and scripts necessary to run this example. The file contains 3 projects, one for the ClientAggregator and two identical modified HelloWorld sample services that can be used for testing.

AggregationExampleProjects.zip

* This is as far as I can tell, however it might not be

0 Comments:

Post a Comment

<< Home