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 :
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
Related posts: