org.apache.whirr
Class HandlerMapFactory

java.lang.Object
  extended by 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.


Nested Class Summary
protected static class HandlerMapFactory.ReturnHandlerByRoleOrPrefix
           
 
Constructor Summary
HandlerMapFactory()
           
 
Method Summary
static Map<String,ClusterActionHandler> create()
           
static Map<String,ClusterActionHandler> create(Iterable<ClusterActionHandlerFactory> factories, Iterable<ClusterActionHandler> handlers)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HandlerMapFactory

public HandlerMapFactory()
Method Detail

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.