[MOBY-l] Determine if Central's cache is filled

Martin Senger martin.senger at gmail.com
Thu Aug 9 13:54:12 UTC 2007


Hi,

In jMoby, how can I determine if the cache in my
> CentralDigestCachedImpl is filled with e.g. serviceTypes? I can get
> the age of the registry but that is not what I need.


There are some protected methods that could be made more public if needed.
At the moment, however, you can use method

public Properties getCacheInfo (String id);

where as 'id' you can specify the cache you wish to investigate. For
example, for service types cache, you use:

getCacheInfo (CentralDigestCachedImpl.CACHE_PART_SERVICETYPES);

You get back properties - and some properties are missing if the cache is
empty. You can use as an example class CacheRegistryClient.java. This class
can be invoked by run-cache-client:

If a cache exists, it looks like this:

senger at sherekhan:~/moby-live/Java$ build/run/run-cache-client -info-t
-cachedir myCache/
Cache for Service Types
        Biomoby registry
http://mobycentral.icapture.ubc.ca/cgi-bin/MOBY05/mobycentral.pl
        Number of entities      114
        Oldest entry created    Thu Sep 28 18:58:01 BST 2006
        Oldest entry has age    314 days and 19:45:53.327
        Youngest entry created  Wed Jul 25 19:04:26 BST 2007
        Youngest entry has age  14 days and 19:39:28.347
        Size (in bytes) 28293
        Location
/home/senger/moby-live/Java/myCache/http58.47.47mobycentral46icapture46ubc46ca47cgi45bin47MOBY0547mobycentral46pl/serviceTypes

When a removed the service type cache and run the same script again, I got
only:

senger at sherekhan:~/moby-live/Java$ build/run/run-cache-client -info-t
-cachedir myCache/
Cache for Service Types
        Biomoby registry
http://mobycentral.icapture.ubc.ca/cgi-bin/MOBY05/mobycentral.pl
        Location
/home/senger/moby-live/Java/myCache/http58.47.47mobycentral46icapture46ubc46ca47cgi45bin47MOBY0547mobycentral46pl/serviceTypes

Cheers,
Martin

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



More information about the moby-l mailing list