|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.util.PluginDispatcher<T>
public class PluginDispatcher<T extends ServicePlugin>
Provides convenience functions for dispatching calls through to plugins registered with a class. Classes that wish to provide plugin interfaces should use this class to load the plugin list from the Configuration and to dispatch calls to the loaded instances. Calls dispatched through this class are performed on a second thread so as to not block execution of the plugged service.
Field Summary | |
---|---|
static org.apache.commons.logging.Log |
LOG
|
Method Summary | ||
---|---|---|
static
|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final org.apache.commons.logging.Log LOG
Method Detail |
---|
public static <X extends 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()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |