Udayanga, may I know some usecases for this cache implementation?? Synapse is not designed for the users to interact with the API directly. It has a configuration language to access the API (in most of the cases, apart from the Class mediator and so forth, and the class mediator has to be your last option).
Can you explain how this cache is being used by the configuration language? Ruwan On Mon, Jan 10, 2011 at 10:11 AM, Udayanga Wickramasinghe <udaya...@wso2.com > wrote: > Hi devs, > i think it is better we do $subject for Synapse . There is already a cache > implementation for synapse which store and manage endpoints, remote entries > ,etc. However the problem is all cache related functions are currently done > in Synapse configuration and Registry,etc modules, which is not scalable > (and difficult to maintain). I suggest , we separate the cache functionality > into a different module.IMO that would allow us to to extend current cache > functionality as well (ie:- prefetch and cache certain entries at startup > for possible performance gain ,etc). > API i am suggesting has the following, > *Cache <Interface>* > #insert(String key,Cacheable cachedObject,CacheConstraint constraint); > #insert(String key,Cacheable cachedObject); > #Cacheable getCachedObject(String key); > #long getGlobalCacheDuration(); > * > Cacheable <interface>* > #Object getValue(); > #String getKey(); > #boolean isExpired(); > #clearCache(); > #long getVersion(); > #long getExpiryTime(); > .... > et*c > *(i think we could easily extend current Synapse Entry class [which is the > object currently used for cache] to implement Cacheable interface ) > * > > CacheConstraint* *<interface>* > boolean evaluate(Cacheable cachedObj) > > We could also include a cache.xml construct to configure this cache at > startup (ie:-cache duration , cache providers , prefetching params , etc) . > Really appreciate thoughts of you all , regarding this. thnx in advance. > > Regards, > Udayanga > > -- > *Udayanga Wickramasinghe* > Software Engineer; WSO2 Inc.; http://wso2.com, > *email: **udaya...@wso2.com* <udayan...@wso2.com>* cell: +94 (77) 983-4365 > blog: **http://udayangawiki.blogspot.com*<http://udayangawiki.blogspot.com/> > * > twitter: **http://twitter.com/udayanga_wick*<http://twitter.com/udayanga_wick> > * > * > -- Ruwan Linton Software Architect & Product Manager WSO2 Inc.; http://wso2.org Lean . Enterprise . Middleware phone: +1 408 754 7388 ext 51789 email: ru...@wso2.com; cell: +94 77 341 3097 blog: http://blog.ruwan.org linkedin: http://www.linkedin.com/in/ruwanlinton google: http://www.google.com/profiles/ruwan.linton tweet: http://twitter.com/ruwanlinton