Issue #2170: Add registration of Router to Notification Framework

Change-Id: Ib2bc29d82395a021cee3a8f98b894010303f06ad

Former-commit-id: 6ea46281b904c99c9b6c9f364293bec96be16f7d
This commit is contained in:
Richard Peter 2013-12-12 13:47:37 -06:00
parent 607b5edb69
commit ded9c782fc

View file

@ -181,9 +181,43 @@ public class PluginNotifier {
*/
public synchronized void register(PluginNotifierConfig config,
boolean rebuildTree) throws InvalidNotificationConfigException {
register(config, null, rebuildTree);
}
/**
* Register the given PluginNotifierConfig.
*
* @param config
* @param router
* The INotificationRouter to use for this config. If null, will
* use the default based on the config format.
* @return
*/
public synchronized void register(PluginNotifierConfig config,
INotificationRouter router)
throws InvalidNotificationConfigException {
register(config, router, true);
}
/**
* Register the given PluginNotifierConfig.
*
* @param config
* @param router
* The INotificationRouter to use for this config. If null, will
* use the default based on the config format.
* @param rebuildTree
* Whether or not to rebuild the internal tree. If many things
* are being registered can improve performance to only build
* tree once at the end.
* @return
*/
public synchronized void register(PluginNotifierConfig config,
INotificationRouter router, boolean rebuildTree)
throws InvalidNotificationConfigException {
validate(config);
INotificationRouter router = null;
if (router == null) {
switch (config.getFormat()) {
case DATAURI:
router = new DataUriRouter(config);
@ -196,6 +230,7 @@ public class PluginNotifier {
"No INotificationRouter registered for format: "
+ config.getFormat());
}
}
Map<String, RequestConstraint>[] metadataMaps = config.getMetadataMap();
boolean receiveAll = (metadataMaps == null)