/** * {@inheritDoc} */ @Override public Optional<Component> find(Location location) { if (isTemplateLocationFunction.apply(location.getGlobalName())) { return empty(); } return ofNullable(componentsMap.get(location.toString())); }
protected ComponentModel findRequiredComponentModel(Location location) { final Reference<ComponentModel> foundComponentModelReference = new Reference<>(); Optional<ComponentModel> globalComponent = applicationModel.findTopLevelNamedComponent(location.getGlobalName()); globalComponent.ifPresent(componentModel -> findComponentWithLocation(componentModel, location) .ifPresent(foundComponentModel -> foundComponentModelReference.set(foundComponentModel))); if (foundComponentModelReference.get() == null) { throw new NoSuchComponentModelException(createStaticMessage("No object found at location " + location.toString())); } return foundComponentModelReference.get(); }
/** * {@inheritDoc} */ @Override public Optional<Component> find(Location location) { if (isTemplateLocationFunction.apply(location.getGlobalName())) { return empty(); } return ofNullable(componentsMap.get(location.toString())); }
/** * Utility method that given a {@link Location} creates a new one but ignoring the last part of it. */ public static Location deleteLastPartFromLocation(Location location) { Location.Builder builder = Location.builder(); List<String> parts = location.getParts(); builder = builder.globalName(location.getGlobalName()); for (int i = 0; i < parts.size() - 1; i++) { builder = builder.addPart(parts.get(i)); } return builder.build(); }
/** * Triggers the forced execution of the polling message processor ignoring the configured scheduler. */ private void poll() { boolean execute = false; synchronized (this) { if (disallowConcurrentExecution && executing) { execute = false; } else { execute = true; executing = true; } } if (execute) { Message request = of(null); pollWith(request); } else { LOGGER.info("Flow '{}' is already running and 'disallowConcurrentExecution' is set to 'true'. Execution skipped.", flowConstruct.getRootContainerLocation().getGlobalName()); } }
protected ComponentModel findRequiredComponentModel(Location location) { final Reference<ComponentModel> foundComponentModelReference = new Reference<>(); Optional<ComponentModel> globalComponent = applicationModel.findTopLevelNamedComponent(location.getGlobalName()); globalComponent.ifPresent(componentModel -> findComponentWithLocation(componentModel, location) .ifPresent(foundComponentModel -> foundComponentModelReference.set(foundComponentModel))); if (foundComponentModelReference.get() == null) { throw new NoSuchComponentModelException(createStaticMessage("No object found at location " + location.toString())); } return foundComponentModelReference.get(); }