private void registerMBean( Cache cache )
{
final Agent agent = AgentFactory.getInstance();
try {
agent.addMBean( instanceName, "org.exist.management." + instanceName + ":type=CacheManager.Cache,name=" + cache.getFileName() + ",cache-type=" + cache.getType(), new org.exist.management.Cache( cache ) );
}
catch( final DatabaseConfigurationException e ) {
LOG.warn( "Exception while registering cache mbean.", e );
}
}