Are you clearing your cache manually ?

- Image via Wikipedia
Most probably you have management link that enable you clear cache manually !
Then there is something totally wrong in your software/project
Your software is :
- Not aware of itself
- Do not now what it is under going now
- Do not know how to respond to these operations …
What you should do something very simple. Go Back to your Design Patterns Book.
Simply first thing you should build an observable/event publisher architecture that can notify the listener objects which has already attach to the observable / event publisher object.
you can use Observable or spring ApplicationEventPublisher or an interface you would define for your own requirements.
Than you can manage your cache according to the events.
For applications in distributed environments, A scalable Message queue system like JMS/ActiveMQ can be used. Or more simply a networking API like JGroups to broadcast notifications to the peers via networking
![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=6fe6ec21-3ba4-4693-86c1-5b9046e14ed4)



No comments yet.