builderClass = (Class<? extends EventDeserializer.Builder>) c;
} else {
String errMessage = "Unable to instantiate Builder from " +
deserializerType + ": does not appear to implement " +
EventDeserializer.Builder.class.getName();
throw new FlumeException(errMessage);
}
} catch (ClassNotFoundException ex) {
logger.error("Class not found: " + deserializerType, ex);
throw new FlumeException(ex);
}
}
// build the builder
EventDeserializer.Builder builder;
try {
builder = builderClass.newInstance();
} catch (InstantiationException ex) {
String errMessage = "Cannot instantiate builder: " + deserializerType;
logger.error(errMessage, ex);
throw new FlumeException(errMessage, ex);
} catch (IllegalAccessException ex) {
String errMessage = "Cannot instantiate builder: " + deserializerType;
logger.error(errMessage, ex);
throw new FlumeException(errMessage, ex);
}
return builder.build(context, in);
}