org.apache.whirr
Class HandlerMapFactory
java.lang.Object
org.apache.whirr.HandlerMapFactory
public class HandlerMapFactory
- extends Object
HandlerMapFactory used in ScriptBasedClusterAction classes to create a map of action handlers.
This implementation allow reuse of the same handler map by multiple ScriptBasedClusterAction
instances.
Note: Another motivation of extracting this code outside of ScriptBasedClusterAction is that the
same code inside action implementation is not possible to mock by Mockito for JUnit testing
purposes. Without this code the action classes can be plugged with another factory and remain
JUnit testable.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HandlerMapFactory
public HandlerMapFactory()
create
public static Map<String,ClusterActionHandler> create()
create
public static Map<String,ClusterActionHandler> create(Iterable<ClusterActionHandlerFactory> factories,
Iterable<ClusterActionHandler> handlers)
Copyright © 2010-2011 The Apache Software Foundation. All Rights Reserved.