private void removeFromComponentLocator(List<String> locations) { locations.forEach(location -> { componentLocator.removeComponent(builderFromStringRepresentation(location).build()); }); }
@Override public void onStart(SourceCallback<InputStream, Void> sourceCallback) throws MuleException { if (nextOperationReference != null) { Component proc = locator.find(builderFromStringRepresentation(location.getParts().get(0).getPartPath()).addProcessorsPart() .addIndexPart(0).build()) .orElseThrow(() -> new IllegalArgumentException("Missing processor after this source")); Map<String, Object> parameters = (Map<String, Object>) proc.getAnnotation(ANNOTATION_PARAMETERS); if (!parameters.get("name").equals(nextOperationReference)) { throw new IllegalArgumentException(String.format("Next processor %s does not match the expected operation %s", parameters.get("name"), nextOperationReference)); } } scheduler = schedulerService.cpuLightScheduler(); sourceCallbackHandleTask = scheduler.scheduleAtFixedRate(() -> sourceCallback.handle(Result.<InputStream, Void>builder() .output(new ByteArrayInputStream(getSpellBytes(spell))) .build()), 0, castFrequencyInMillis, MILLISECONDS); }
private void assertStrategy(String flowName, BackPressureStrategy expected) { MessageSource source = (MessageSource) componentLocator.find(builderFromStringRepresentation(flowName + "/source").build()).get(); assertThat(source.getBackPressureStrategy(), is(expected)); } }
private void removeFromComponentLocator(List<String> locations) { locations.forEach(location -> { componentLocator.removeComponent(builderFromStringRepresentation(location).build()); }); }
private void assertStrategy(String flowName, BackPressureStrategy expected) { MessageSource source = (MessageSource) componentLocator.find(builderFromStringRepresentation(flowName + "/source").build()).get(); assertThat(source.getBackPressureStrategy(), is(expected)); } }