/** * {@inheritDoc} */ @Override public ComponentLocation getComponentLocation() { return component.getLocation(); }
private Optional<TypedComponentIdentifier> getModuleOperationTypeComponentIdentifier(ComponentModel componentModel) { final ComponentIdentifier originalIdentifier = (ComponentIdentifier) componentModel.getCustomAttributes().get(ORIGINAL_IDENTIFIER); final String namespace = originalIdentifier.getNamespace(); final String operationName = originalIdentifier.getName(); final ComponentIdentifier operationIdentifier = ComponentIdentifier.builder().namespace(namespace).name(operationName).build(); return of(builder().identifier(operationIdentifier).type(OPERATION).build()); }
/** * @return the first {@code test:processor} from a flow with the provided name. */ public static FunctionalTestProcessor getFromFlow(ConfigurationComponentLocator locator, String flowName) throws Exception { return locator.find(ComponentIdentifier.builder().namespace("test").name("processor").build()) .stream() .filter(c -> flowName.equals(c.getRootContainerLocation().toString())) .map(c -> (FunctionalTestProcessor) c) .findAny().get(); }
@Override public Action getAction() { if (action == null) { action = new ExtensionAction(component.getLocation().getComponentIdentifier().getIdentifier().getNamespace().toUpperCase(), ((Enum) actionDefinition).name()); } return action; }
private EventMatcher isErrorTypeSourceResponseGenerate() { return hasErrorType(SOURCE_RESPONSE_GENERATE.getNamespace(), SOURCE_RESPONSE_GENERATE.getName()); }
@Override public boolean mustStartMessageSource(Component component) { if (configurationProperties.resolveProperty(DISABLE_SCHEDULER_SOURCES_PROPERTY).isPresent()) { if (component.getLocation().getComponentIdentifier().getIdentifier().equals(SCHEDULER_MESSAGE_SOURCE_IDENTIFIER)) { return !configurationProperties.resolveBooleanProperty(DISABLE_SCHEDULER_SOURCES_PROPERTY).orElse(false); } } return true; }
private static DefaultComponentLocation buildLocation(final String componentIdentifier) { final TypedComponentIdentifier part = builder().identifier(buildFromStringRepresentation(componentIdentifier)).type(OPERATION).build(); return new DefaultComponentLocation(of("flowName"), singletonList(new DefaultLocationPart("0", of(part), empty(), empty(), empty()))); }
private void mockComponent() { component = mock(Component.class, RETURNS_DEEP_STUBS); identifier = mock(ComponentIdentifier.class); when(component.getLocation().getComponentIdentifier().getIdentifier()).thenReturn(identifier); }
private Boolean isLazyInit() { return properties.resolveBooleanProperty(MULE_LAZY_INIT_DEPLOYMENT_PROPERTY).orElse(false); }
private ComponentIdentifier getIdentifier(ErrorModel parent) { return buildFromStringRepresentation(parent.getNamespace() + ":" + parent.getType()); } }
@Override public B createInstance() throws Exception { B annotatedInstance = doCreateInstance(); annotatedInstance.setAnnotations(getAnnotations()); return annotatedInstance; }
private EventMatcher isErrorTypeSourceResponseSend() { return hasErrorType(SOURCE_RESPONSE_SEND.getNamespace(), SOURCE_RESPONSE_SEND.getName()); }
@Override public Supplier<ComponentLocation> resolve(ExecutionContext executionContext) { return () -> ((ExecutionContextAdapter) executionContext).getComponent().getLocation(); } }
private EventMatcher isErrorTypeSourceErrorResponseSend() { return hasErrorType(SOURCE_ERROR_RESPONSE_SEND.getNamespace(), SOURCE_ERROR_RESPONSE_SEND.getName()); }
@Override public Object postProcessAfterInitialization(Object o, String s) throws BeansException { // We check for instanceof Component because this method may be called for spring objects if ((!(o instanceof FactoryBean) || o instanceof ComponentFactory) && o instanceof Component && ((Component) o).getLocation() != null) { componentLocator.addComponent((Component) o); } return o; } }
private ComponentIdentifier createIdentifier() { if (configuration != null) { return configuration.getIdentifier(); } if (!dsl.supportsTopLevelDeclaration() && !dsl.supportsChildDeclaration()) { return null; } return ComponentIdentifier.builder() .name(dsl.getElementName()) .namespace(dsl.getPrefix()) .build(); }
@Override public ComponentLocation getComponentLocation() { return decorated.getComponent().getLocation(); }