public class PluginDispatcher<T extends org.apache.hadoop.util.ServicePlugin> extends Object
| Modifier and Type | Field and Description |
|---|---|
static org.apache.commons.logging.Log |
LOG |
| Modifier and Type | Method and Description |
|---|---|
static <X extends org.apache.hadoop.util.ServicePlugin> |
createFromConfiguration(Configuration conf,
String key,
Class<X> clazz)
Load a PluginDispatcher from the given Configuration.
|
void |
dispatchCall(SingleArgumentRunnable<T> callback)
Dispatch a call to all active plugins.
|
void |
dispatchStart(Object plugPoint)
Dispatches the start(...) hook common to all ServicePlugins.
|
void |
dispatchStop()
Convenience function for dispatching the stop() hook common to all
ServicePlugins.
|
public static final org.apache.commons.logging.Log LOG
public static <X extends org.apache.hadoop.util.ServicePlugin> PluginDispatcher<X> createFromConfiguration(Configuration conf, String key, Class<X> clazz)
conf - the Configuration from which to loadkey - the configuration key that lists class names to instantiateclazz - the class or interface from which plugins must extendpublic void dispatchCall(SingleArgumentRunnable<T> callback)
callback - a function which will run once for each plugin, with
that plugin as the argumentpublic void dispatchStart(Object plugPoint)
plugPoint - passed to ServicePlugin.start()public void dispatchStop()
Copyright © 2014 Apache Software Foundation. All Rights Reserved.