"frank.stillford" wrote : ... If not, are there any similar alternatives or
workarounds?
I have not found a way to invalidate entities out-of-the-box, but you can create your own
MBean to accomplish the task. You can get a handle on the CacheManager through JNDI, and
you can obtain a reference to the entity cache thusly:
| public void remove(String jndi, String cacheName, String node) throws Exception
| {
| CacheManager cm = null;
| Cache<?, ?> c = null;
|
| try{
| cm = this.getCacheManager(jndi);
| c = cm.getCache(cacheName, false);
| c.removeNode(node);
| } finally{
| if(c != null){
| try {
| cm.releaseCache(cacheName);
| } catch (NamingException ex) {
| }
| }
| }
| }
|
|
| private CacheManager getCacheManager(String jndi) throws NamingException
| {
| Context ic = null;
|
| try{
| ic = new InitialContext();
| return (CacheManager)ic.lookup(jndi);
| } finally {
| if(ic != null) {
| try {
| ic.close();
| } catch (NamingException ex) {
| }
| }
| }
| }
|
By default, the cache manager is bound to java:/CacheManager.
Regards,
Richard Burnison
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4208811#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...