Difference between revisions of "IS-Cache"
From Gcube Wiki
(→Usage) |
(→Usage) |
||
Line 42: | Line 42: | ||
public EndpointReference[] getEPRsFor(String srvClass, String srvName, String srvType); | public EndpointReference[] getEPRsFor(String srvClass, String srvName, String srvType); | ||
+ | </source> | ||
+ | |||
+ | For example consider the case where a component needs to find the EPRs of the "SearchSystemService": | ||
+ | |||
+ | <source lang="java"> | ||
+ | |||
+ | EndpointReference[] eprs = isCache.getEPRsFor("Search", "SearchSystemService", "SIMPLE"); | ||
</source> | </source> |
Revision as of 13:08, 19 September 2011
The IS-Cache provides simple and flexible methods for retrieving and caching the Endpoint references of gCube web services published in the IS. A component that uses the IS-Cache library, is able to retrieve Endpoint references for:
- services' Running Instances
- factory services' Running Instances
- Web Service statefull resources
Additionally the IS-Cache provides an option for further restricting the final results, by using custom filtering criteria.
Usage
The first step for using the ISCache is to create an instance for a specific scope through the following constructor
/** * Constructor * @param scope scope */ public ISCache(GCUBEScope scope);
Then using this instance a component can find the EPRs for services' RIs by using the following method
/** * Get the running instances (array of URLs) of the specified service * * @param srvClass * service class * @param srvName * service name * @param srvType * service type * @return the running instances (array of URLs) of the specified service * @throws Exception * in case of error; most probably due to the fact that the * specified service is not registered. * @see org.gcube.informationsystem.cache.ISCacheMBean#getEPRsFor(String, String, * String) */ public EndpointReference[] getEPRsFor(String srvClass, String srvName, String srvType);
For example consider the case where a component needs to find the EPRs of the "SearchSystemService":
EndpointReference[] eprs = isCache.getEPRsFor("Search", "SearchSystemService", "SIMPLE");