Package org.apache.whirr.service

Examples of org.apache.whirr.service.ClusterActionHandlerFactory


    nn.add("puppet:module::manifest");
    nn.add("something-else");    

    TestNodeStarterFactory nodeStarterFactory = null;
   
    ClusterActionHandlerFactory puppetHandlerFactory = mock(ClusterActionHandlerFactory.class);
    ClusterActionHandler handler = mock(ClusterActionHandler.class);
    when(puppetHandlerFactory.getRolePrefix()).thenReturn("puppet:");
    when(puppetHandlerFactory.create("module::manifest")).thenReturn(handler);
    when(handler.getRole()).thenReturn("something-else");

    LoadingCache<String, ClusterActionHandler> handlerMap = new HandlerMapFactory().create(ImmutableSet.of(puppetHandlerFactory),
          ImmutableSet.of(handler));
View Full Code Here


    nn.add("puppet:module::manifest");
    nn.add("something-else");    

    TestNodeStarterFactory nodeStarterFactory = null;
   
    ClusterActionHandlerFactory puppetHandlerFactory = mock(ClusterActionHandlerFactory.class);
    ClusterActionHandler handler = mock(ClusterActionHandler.class);
    when(puppetHandlerFactory.getRolePrefix()).thenReturn("puppet");
    when(handler.getRole()).thenReturn("something-else");

    LoadingCache<String, ClusterActionHandler> handlerMap = new HandlerMapFactory().create(
      ImmutableSet.of(puppetHandlerFactory), ImmutableSet.of(handler));
View Full Code Here

            return role.startsWith(prefix);
          }

        });
        LOG.debug("role {} starts with a configured prefix {}", role, prefix);
        ClusterActionHandlerFactory factory = factoryMap.get(prefix);
        checkArgument(factory != null, "could not create action handler factory %s", prefix);
        String subrole = role.substring(prefix.length());
        ClusterActionHandler returnVal = factory.create(subrole);
        checkArgument(returnVal != null, "action handler factory %s could not create action handler for role %s",
            prefix, subrole);
        return returnVal;
      } catch (NoSuchElementException e) {
        LOG.debug("role {} didn't start with any of the configured prefixes {}", role, prefixes);
View Full Code Here

    nn.add("puppet:module::manifest");
    nn.add("something-else");    

    TestNodeStarterFactory nodeStarterFactory = null;
   
    ClusterActionHandlerFactory puppetHandlerFactory = mock(ClusterActionHandlerFactory.class);
    ClusterActionHandler handler = mock(ClusterActionHandler.class);
    when(puppetHandlerFactory.getRolePrefix()).thenReturn("puppet:");
    when(puppetHandlerFactory.create("module::manifest")).thenReturn(handler);
    when(handler.getRole()).thenReturn("something-else");

    LoadingCache<String, ClusterActionHandler> handlerMap = new HandlerMapFactory().create(ImmutableSet.of(puppetHandlerFactory),
          ImmutableSet.of(handler));
View Full Code Here

    nn.add("puppet:module::manifest");
    nn.add("something-else");    

    TestNodeStarterFactory nodeStarterFactory = null;
   
    ClusterActionHandlerFactory puppetHandlerFactory = mock(ClusterActionHandlerFactory.class);
    ClusterActionHandler handler = mock(ClusterActionHandler.class);
    when(puppetHandlerFactory.getRolePrefix()).thenReturn("puppet");
    when(handler.getRole()).thenReturn("something-else");

    LoadingCache<String, ClusterActionHandler> handlerMap = new HandlerMapFactory().create(
      ImmutableSet.of(puppetHandlerFactory), ImmutableSet.of(handler));
View Full Code Here

    nn.add("puppet:module::manifest");
    nn.add("something-else");    

    TestNodeStarterFactory nodeStarterFactory = null;
   
    ClusterActionHandlerFactory puppetHandlerFactory = mock(ClusterActionHandlerFactory.class);
    ClusterActionHandler handler = mock(ClusterActionHandler.class);
    when(puppetHandlerFactory.getRolePrefix()).thenReturn("puppet");
    when(handler.getRole()).thenReturn("something-else");

    Map<String, ClusterActionHandler> handlerMap = HandlerMapFactory.create(
      ImmutableSet.of(puppetHandlerFactory), ImmutableSet.of(handler));
View Full Code Here

    nn.add("puppet:module::manifest");
    nn.add("something-else");    

    TestNodeStarterFactory nodeStarterFactory = null;
   
    ClusterActionHandlerFactory puppetHandlerFactory = mock(ClusterActionHandlerFactory.class);
    ClusterActionHandler handler = mock(ClusterActionHandler.class);
    when(puppetHandlerFactory.getRolePrefix()).thenReturn("puppet:");
    when(puppetHandlerFactory.create("module::manifest")).thenReturn(handler);
    when(handler.getRole()).thenReturn("something-else");

    Map<String, ClusterActionHandler> handlerMap = HandlerMapFactory.create(ImmutableSet.of(puppetHandlerFactory),
          ImmutableSet.of(handler));
View Full Code Here

TOP

Related Classes of org.apache.whirr.service.ClusterActionHandlerFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.