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

Comments 0

No comments for this document

Attachments 0

No attachments for this document

Creator: Olivier Grisel on 2009/06/23 11:30
© 2008-2010 Nuxeo
1.3.8295