org.apache.whirr
Class HandlerMapFactory

java.lang.Object
  extended by org.apache.whirr.HandlerMapFactory
Direct Known Subclasses:
DynamicHandlerMapFactory

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
 com.google.common.cache.LoadingCache<String,ClusterActionHandler> create()
           
 com.google.common.cache.LoadingCache<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 com.google.common.cache.LoadingCache<String,ClusterActionHandler> create()

create

public com.google.common.cache.LoadingCache<String,ClusterActionHandler> create(Iterable<ClusterActionHandlerFactory> factories,
                                                                                Iterable<ClusterActionHandler> handlers)


Copyright © 2010-2013 The Apache Software Foundation. All Rights Reserved.