[MOBY-dev] Get services by serviceType in cached central

Martin Senger martin.senger at gmail.com
Mon Aug 6 20:03:23 UTC 2007


Hi,

     How can I look up (in my cached centralimpl) the services for each
>      ServiceType?


You can see this functionality in the Dashboard's panel "Registry Browser"
(by right-click in the "Services" tree and selecting "Sort by service
types"). The code that does it can be found in the file
org.biomoby.service.dashboard.ServicesTree.java - look there for the method
"onUpdateServicesTreeByType". The tree gets data from
RegistryModel.java(that gets it from the
CentralDigestCachedImpl.java). The data are actually in two sets:
getServices() and getServiceTypes() and the ServicesTree.java builds the
tree from these two sets.

This approach works without any addition to the BioMoby's API because you
get *all* data and just rearrange them as needed. This is fast enough
because you are using a cached client. If you, however, insist to use the
"lazy" approach (which means to get a list of corresponding services only
after a user selects a service type) you would need a "findService" method
working on cached objects. Such method, indeed, does not exist in the
CentralDigestCached.java interface. I considered it when the interface had
been created and decided not to have it because it would need a lot of
replicated functionality that are implemented on the registry site. So far,
the memory and performance were not the issues when using the *all* data
approach so I did not bother.

Cheers,
Martin

-- 
Martin Senger
   email: martin.senger at gmail.com
   skype: martinsenger



More information about the MOBY-dev mailing list