try {
Class clazz = Class.forName(persistenceClassname);
PersistenceListener persistenceListener = (PersistenceListener) clazz.newInstance();
cache.setPersistenceListener(persistenceListener.configure(config));
} catch (ClassNotFoundException e) {
log.error("PersistenceListener class '" + persistenceClassname + "' not found. Check your configuration.", e);
} catch (Exception e) {
log.error("Error instantiating class '" + persistenceClassname + "'", e);
}