use of org.apache.gobblin.runtime.listeners.CompositeJobListener in project incubator-gobblin by apache.
the class AzkabanJobLauncher method initJobListener.
protected JobListener initJobListener() {
CompositeJobListener compositeJobListener = new CompositeJobListener();
List<String> listeners = new State(props).getPropAsList(GOBBLIN_CUSTOM_JOB_LISTENERS, EmailNotificationJobListener.class.getSimpleName());
try {
for (String listenerAlias : listeners) {
ClassAliasResolver<JobListener> conditionClassAliasResolver = new ClassAliasResolver<>(JobListener.class);
compositeJobListener.addJobListener(conditionClassAliasResolver.resolveClass(listenerAlias).newInstance());
}
} catch (IllegalAccessException | InstantiationException | ClassNotFoundException e) {
throw new IllegalArgumentException(e);
}
return compositeJobListener;
}
Aggregations