Is there a pattern for this..
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   mohamed_zafer
Posted On:   Wednesday, March 6, 2002 02:15 AM

Hello Guys, I am currently involved in developing a caching component, that will have the following features, 1. During startup load all the config data(from XML files) into memory. 2. There are a few objects which are used by many components, hence I need to cache them... The caching component should hold these components. 3. The cached data should be easily accesible, for example if I want to get address of a resource, I should be able get it as simple as "Cache.get(myresource)" 4. When the system is up and running, there is a possibility that a part of the config data(xml files) are modified. These should be reflected in the cache,   More>>

Hello Guys,



I am currently involved in developing a caching component, that will have the following features,



1. During startup load all the config data(from XML files) into memory.



2. There are a few objects which are used by many components, hence I need to cache them... The caching component should hold these components.



3. The cached data should be easily accesible, for example if I want to get address of a resource, I should be able get it as simple as
"Cache.get(myresource)"



4. When the system is up and running, there is a possibility that a part of the config data(xml files) are modified. These should be reflected in the cache, without involving any restart of the system.



5. It should be independent of any container or appserver



I need inputs on how to develop the above component.



Thanks,

Mohamed Zafer

   <<Less

Re: Is there a pattern for this..

Posted By:   Ashish_Sinha  
Posted On:   Tuesday, March 12, 2002 11:11 AM

I don't claim to be an expert but have the following ideas for ur requirements.



1. Do the loading in static block of code.



2. Make the Cache object a Singleton object.



3. In order to avoid restart, U can keep
on monitoring ur XML file for a change. This may be done in a seperate thread which is normally sleeping but awakes and checks after a given interwal.
About | Sitemap | Contact