Difference between revisions of "IS-Cache"
From Gcube Wiki
(→Usage) |
(→Usage) |
||
Line 17: | Line 17: | ||
*/ | */ | ||
public ISCache(GCUBEScope scope); | public ISCache(GCUBEScope scope); | ||
+ | |||
+ | </source> | ||
+ | |||
+ | Then using this instance a component can find the EPRs for services' RIs by using the following method | ||
+ | |||
+ | <source lang="java"> | ||
+ | |||
+ | /** | ||
+ | * 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); | ||
</source> | </source> |
Revision as of 13:03, 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);