public class PluginDispatcher<T extends org.apache.hadoop.util.ServicePlugin>
extends java.lang.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(org.apache.hadoop.conf.Configuration conf,
java.lang.String key,
java.lang.Class<X> clazz)
Load a PluginDispatcher from the given Configuration.
|
void |
dispatchCall(SingleArgumentRunnable<T> callback)
Dispatch a call to all active plugins.
|
void |
dispatchStart(java.lang.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 <X extends org.apache.hadoop.util.ServicePlugin> PluginDispatcher<X> createFromConfiguration(org.apache.hadoop.conf.Configuration conf, java.lang.String key, java.lang.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(java.lang.Object plugPoint)
plugPoint
- passed to ServicePlugin.start()public void dispatchStop()
Copyright © 2009 The Apache Software Foundation