Map<String, Sink> sinks = new HashMap<String, Sink>();
for (String sinkName : sinkNames) {
ComponentConfiguration comp = compMap.get(sinkName);
if(comp != null) {
SinkConfiguration config = (SinkConfiguration) comp;
Sink sink = getSinkFactory().create(comp.getComponentName(),
comp.getType());
Configurables.configure(sink, config);
sink.setChannel(conf.getChannels().get(config.getChannel()));
sinks.put(comp.getComponentName(), sink);
}
}
Map<String, Context> sinkContexts = agentConf.getSinkContext();
for (String sinkName : sinkNames) {
Context context = sinkContexts.get(sinkName);
if(context != null) {
Sink sink = getSinkFactory().create(sinkName, context.getString(
BasicConfigurationConstants.CONFIG_TYPE));
Configurables.configure(sink, context);
sink.setChannel(conf.getChannels().get(context.getString(
BasicConfigurationConstants.CONFIG_CHANNEL)));
sinks.put(sinkName, sink);
}
}