Difference between revisions of "IS-Cache"
From Gcube Wiki
(→Usage) |
(→Usage) |
||
Line 54: | Line 54: | ||
* SIMPLE - for all the service's EPRs | * SIMPLE - for all the service's EPRs | ||
* FACTORY - for the service's endpoints that contain the word "Factory" (this means that we need the factory porttypes of this service) | * FACTORY - for the service's endpoints that contain the word "Factory" (this means that we need the factory porttypes of this service) | ||
− | * STATEFULL - for the | + | * STATEFULL - for the EPRs of the WS resources of a statefull service |
Revision as of 13:16, 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");
There are three options for the "srvType" option:
- SIMPLE - for all the service's EPRs
- FACTORY - for the service's endpoints that contain the word "Factory" (this means that we need the factory porttypes of this service)
- STATEFULL - for the EPRs of the WS resources of a statefull service