public InteractionWriter getInteractionWriterWith(Map<String,Object> requiredOptions) {
for (Map.Entry<Class<? extends InteractionWriter>, Map<String, Object>> entry : registeredWriters.entrySet()){
if (areSupportedOptions(entry.getValue(), requiredOptions)){
try {
return instantiateNewWriter(entry.getKey(), requiredOptions);
} catch (IllegalAccessException e) {
logger.log(Level.SEVERE, "We cannot instantiate interaction writer of type " + entry.getKey() + " with the given options.", e);
} catch (InstantiationException e) {
logger.log(Level.SEVERE, "We cannot instantiate interaction writer of type " + entry.getKey() + " with the given options.", e);
} catch (Exception e) {
logger.log(Level.WARNING, "We cannot instantiate interaction writer of type " + entry.getKey() + " with the given options.", e);
}
}
}
return null;
}