Esempio n. 1
0
  public static ParameterMappingStrategy createParameterMappingStrategy(CamelContext camelContext) {
    // lookup in registry first if there is a user define strategy
    Registry registry = camelContext.getRegistry();
    ParameterMappingStrategy answer =
        registry.lookupByNameAndType(
            BeanConstants.BEAN_PARAMETER_MAPPING_STRATEGY, ParameterMappingStrategy.class);
    if (answer == null) {
      // no then use the default one
      answer = new DefaultParameterMappingStrategy();
    }

    return answer;
  }
 public String withRegistry(String body, Registry registry) {
   assertNotNull(body);
   assertNotNull(registry);
   assertNotNull(registry.lookupByName("foo"));
   assertEquals("Hello", body);
   return "Registry";
 }