At the moment the most straightforward way to invalidate all VCS caches is to flush the JCA pool using the JMX interface:
public static final String VCS_POOL_JMX_NAME = "jboss.jca:name=NXRepository/default,service=ManagedConnectionPool"; @SuppressWarnings("unchecked") public static void invalidateVcsCache() throws Exception { ObjectName poolName = ObjectName.getInstance(VCS_POOL_JMX_NAME); List<MBeanServer> servers = MBeanServerFactory.findMBeanServer(null); for (MBeanServer server : servers) { if (server.isRegistered(poolName)) { server.invoke(poolName, "flush", new Object[0], new String[0]); return; } } throw new UnsupportedOperationException(String.format( "'%s' pool could not be found through local JMX lookup", poolName)); }
Version 1.1 last modified by Olivier Grisel on 23/06/2009 at 11:33
Document data
Attachments:
No attachments for this document
Comments: 0