[MOBY-dev] Using CentralDigestCachedImpl....

Paul Gordon gordonp at ucalgary.ca
Fri Dec 7 16:26:52 UTC 2007


Yes.  If you use the default c-tor for anything, e.g.:

new MobyDataObject( "something", "anything")


this is the same as setting the registry to null. Because the null 
registry uses the default registry from RegistriesList, and this still 
points to the defunct server in Vancouver, the default c-tors currently 
fail. It was actually a good opportunity for me to discover the parts of 
my jMOBY code that were not Registry-aware, because they would hang, 
trying to connect to UBC when they should be connecting to Calgary :-)

That being said, if you want to use the default registry in Calgary, I 
will be switching the default action to connect to Calgary in the next 
day or so (as I've found all my multi-registry bugs, I think). You'll 
only need to use c-tors with a registry parameter if you want to use a 
specialized registry.

Andreas Groscurth wrote:
> Hi Paul,
>
> thanks for the message...
>
> So do i understand it correctly ? I create such Registry object and then I 
> pass that instance to any of the org.biomoby.shared.data.*.
>
> e.g. new MobyDataObject( "something", "anything", registry) 
>
> ?
>
> thanks
> andreas
>
> On Wednesday 05 December 2007 18:21, Paul Gordon wrote:
>   
>> Hi Andreas,
>>
>> The concluision we reached a few weeks ago is that
>> CentralDigestCachedImpl and org.biomoby.shared.data.* use different
>> catching schemes,which I will reconcile once Martin has set up some unit
>> tests for the CentralImpls.  Usually there is no  compelling reason to
>> use both caches...if you are using org.biomoby.shared.data.* to create
>> and past data instances, CentralDigestCachedImpl.CACHE_PART_DATATYPES
>> doesn't really do anything for you, and vice versa.  If you are using
>> org.biomoby.shared.data.*, drop the updateCache() calls you had, and use
>> instead:
>>
>> Registry registry = new Registry("calgary",
>> "http://moby.ucalgary.ca/moby/MOBY-Central.pl",
>> "http://moby.ucalgary.ca/MOBY/Central");
>> RegistryCache.cacheOntologyFile(registry,
>> Central.DATA_TYPES_RESOURCE_NAME, allowedAgeMillis);
>> MobyDataType.loadDataTypes(RegistryCache.getOntologyFile(registry,
>> Central.DATA_TYPES_RESOURCE_NAME).toURI().toURL(), registry);
>>
>> I just added the allowedAgeMillis parameter for convenience. You'll want
>> to do a CVS update.  For MobyNamespace it's similar..
>>
>> MobyNamespace.loadNamespaces(RegistryCache.getOntologyFile(registry,
>> Central.NAMESPACES_RESOURCE_NAME).toURI().toURL(), registry);
>>
>> Hopefully, we can reconcile the Central calls cache and this code soon,
>> so you don't need to pick.  I could have also made a
>> MobyNamespace.loadNamespaces(registry) method, but in keeping with the
>> Law of Demeter, it's better for MobyNamespace and MobyDataType to not
>> explicitly know about RegistryCache, hence the
>> MobyNamespace.loadNamespaces(url, registry) signature.
>>
>> Regards,
>>
>> Paul
>>
>> Andreas Groscurth wrote:
>>     
>>> Hi,
>>>
>>> sorry for reasking that - but has anyone an answer ?
>>>
>>> Thanks
>>> andreas
>>>
>>> On Monday 03 December 2007 09:45, Andreas Groscurth wrote:
>>>       
>>>> Hi,
>>>>
>>>> I'm using CentralDigestCachedImpl for caching the datatypes and
>>>> namespaces locally.
>>>>
>>>> CentralDigestCachedImpl cachedImpl = new
>>>> CentralDigestCachedImpl("http://moby.ucalgary.ca/moby/MOBY-Central.pl","
>>>> htt p://moby.ucalgary.ca/MOBY/Central", file.getAbsolutePath() );
>>>> cachedImpl.updateCache( CentralDigestCachedImpl.CACHE_PART_DATATYPES );
>>>> cachedImpl.updateCache( CentralDigestCachedImpl.CACHE_PART_NAMESPACES );
>>>>
>>>> This works fine and re-calls use the local cache.
>>>>
>>>> But when I create a new MobyDataObject, it starts again to fetch the
>>>> datatypes
>>>>
>>>> Fetching data type ontology from
>>>> http://moby.ucalgary.ca/RESOURCES/MOBY-S/Objects
>>>>
>>>> So how do I tell it, that its already has these information ? the
>>>> MobyDataObject can also have a Registry Object - so i guess that can
>>>> help - but how to I link my CachedCentral with a Registry object ?
>>>>
>>>> Or is this otherwise solveable ?
>>>>
>>>> thx
>>>> andreas
>>>> _______________________________________________
>>>> MOBY-dev mailing list
>>>> MOBY-dev at lists.open-bio.org
>>>> http://lists.open-bio.org/mailman/listinfo/moby-dev
>>>>         
>> _______________________________________________
>> MOBY-dev mailing list
>> MOBY-dev at lists.open-bio.org
>> http://lists.open-bio.org/mailman/listinfo/moby-dev
>>     
>
>   



More information about the MOBY-dev mailing list