public InvalidProperty(String name, LogicalComponent component, Throwable cause) { super(component.getUri(), component.getDefinition().getContributionUri(), Collections.singletonList(component)); this.name = name; this.cause = cause; }
public InvalidPropertyFile(String name, LogicalComponent component, Throwable cause, URI file) { super(component.getUri(), component.getDefinition().getContributionUri(), Collections.singletonList(component)); this.name = name; this.cause = cause; this.file = file; }
public InvalidProperty(String name, LogicalComponent component, Throwable cause) { super(component.getUri(), component.getDefinition().getContributionUri(), Collections.singletonList(component)); this.name = name; this.cause = cause; }
public InvalidPropertyFile(String name, LogicalComponent component, Throwable cause, URI file) { super(component.getUri(), component.getDefinition().getContributionUri(), Collections.singletonList(component)); this.name = name; this.cause = cause; this.file = file; }
public NoServiceOnComponent(String message, LogicalComponent component) { super(component.getUri(), component.getDefinition().getContributionUri(), Collections.singletonList(component)); this.message = message; }
private void addTarget(LogicalProducer logicalProducer, URI uri, LogicalComponent<?> logicalComponent) { if (uri.isAbsolute()) { LogicalComponent<?> domain = logicalComponent.getParent(); while (domain.getParent() != null) { domain = domain.getParent(); } logicalProducer.addTarget(URI.create(domain.getUri().toString() + "/" + uri.getAuthority())); } else { logicalProducer.addTarget(URI.create(logicalComponent.getParent().getUri().toString() + "/" + uri.toString())); } }
private void createResourceReferences(LogicalComponent<?> component, ComponentType componentType) { for (ResourceReferenceDefinition resourceReference : componentType.getResourceReferences().values()) { URI resourceUri = component.getUri().resolve('#' + resourceReference.getName()); LogicalResourceReference<ResourceReferenceDefinition> logicalResourceReference = new LogicalResourceReference<ResourceReferenceDefinition>(resourceUri, resourceReference, component); component.addResource(logicalResourceReference); } }
private void createResourceReferences(LogicalComponent<?> logicalComponent, ComponentType componentType) { for (ResourceReference reference : componentType.getResourceReferences().values()) { URI resourceUri = logicalComponent.getUri().resolve('#' + reference.getName()); LogicalResourceReference<ResourceReference> logicalReference = new LogicalResourceReference<>(resourceUri, reference, logicalComponent); logicalComponent.addResource(logicalReference); } }
public BindingNotFound(String message, LogicalBindable bindable) { super(bindable.getParent().getUri(), bindable.getParent().getDefinition().getContributionUri(), Collections.singletonList(bindable)); this.message = message; }
/** * Constructor. * * @param source the reference source * @param promotedComponentUri the promoted component URI. */ public AmbiguousReference(LogicalReference source, URI promotedComponentUri) { super(source.getParent().getUri(), source.getParent().getDefinition().getContributionUri(), Collections.singletonList(source)); this.referenceUri = source.getUri(); this.promotedComponentUri = promotedComponentUri; }
public TargetComponentNotFound(LogicalReference reference, URI targetUri) { super(reference.getParent().getUri(), reference.getParent().getDefinition().getContributionUri(), Collections.singletonList(reference)); this.referenceUri = reference.getUri(); this.targetUri = targetUri; }
/** * Constructor. * * @param source the reference source * @param promotedComponentUri the promoted component URI. */ public AmbiguousReference(LogicalReference source, URI promotedComponentUri) { super(source.getParent().getUri(), source.getParent().getDefinition().getContributionUri(), Collections.singletonList(source)); this.referenceUri = source.getUri(); this.promotedComponentUri = promotedComponentUri; }
public KeyNotFound(LogicalReference reference) { super(reference.getParent().getUri(), reference.getParent().getDefinition().getContributionUri(), Collections.singletonList(reference)); this.referenceUri = reference.getUri(); }
@SuppressWarnings({"unchecked"}) public void generateWireTarget(JavaWireTarget target, LogicalService service) { LogicalComponent<JavaImplementation> component = (LogicalComponent<JavaImplementation>) service.getParent(); URI uri = URI.create(component.getUri().toString() + "#" + service.getUri().getFragment()); target.setUri(uri); // assume only wires to composite scope components can be optimized Component<JavaImplementation> componentDefinition = component.getDefinition(); JavaImplementation implementation = componentDefinition.getImplementation(); InjectingComponentType componentType = implementation.getComponentType(); Scope scope = componentType.getScope(); target.setOptimizable(scope.isSingleton()); }
public PhysicalWireSource generateSource(LogicalReference reference) throws Fabric3Exception { ServiceContract contract = reference.getServiceContract(); if (!(contract instanceof JavaServiceContract)) { // Spring reference contracts are always defined by Java interfaces throw new Fabric3Exception("Unexpected interface type for " + reference.getUri() + ": " + contract.getClass().getName()); } String interfaze = contract.getQualifiedInterfaceName(); URI uri = reference.getParent().getUri(); String referenceName = reference.getDefinition().getName(); return new SpringWireSource(referenceName, interfaze, uri); }
private <I> ScopedComponent createPhysicalComponent(LogicalComponent<?> logicalComponent, I instance) { URI uri = logicalComponent.getUri(); InjectingComponentType type = (InjectingComponentType) logicalComponent.getDefinition().getComponentType(); type.getInjectionSites(); return new SingletonComponent(uri, instance, type.getInjectionSites(), BOOT_CONTRIBUTION); }
@SuppressWarnings({"unchecked"}) public PhysicalConnectionTargetDefinition generateConnectionTarget(LogicalConsumer consumer) throws GenerationException { SpringConsumer springConsumer = (SpringConsumer) consumer.getDefinition(); String beanName = springConsumer.getBeanName(); String methodName = springConsumer.getMethodName(); JavaType<?> type = springConsumer.getType(); URI uri = consumer.getParent().getUri(); return new SpringConnectionTargetDefinition(beanName, methodName, type, uri); }
@SuppressWarnings({"unchecked"}) public PhysicalConnectionTarget generateConnectionTarget(LogicalConsumer consumer) throws Fabric3Exception { SpringConsumer springConsumer = (SpringConsumer) consumer.getDefinition(); String beanName = springConsumer.getBeanName(); String methodName = springConsumer.getMethodName(); JavaType type = springConsumer.getType(); URI uri = consumer.getParent().getUri(); return new SpringConnectionTarget(beanName, methodName, type, uri); }
public PhysicalConnectionSource generateConnectionSource(LogicalProducer producer) throws Fabric3Exception { String producerName = producer.getDefinition().getName(); URI uri = producer.getParent().getUri(); JavaServiceContract serviceContract = (JavaServiceContract) producer.getDefinition().getServiceContract(); return new SpringConnectionSource(producerName, serviceContract.getInterfaceClass(), uri); }
public MonitorTargetDefinition generateWireTarget(LogicalResourceReference<MonitorResourceReference> resourceReference) { LogicalComponent<?> component = resourceReference.getParent(); String type = resourceReference.getDefinition().getServiceContract().getQualifiedInterfaceName(); URI monitorable = component.getUri(); String destination = resourceReference.getDefinition().getDestination(); MonitorTargetDefinition definition = new MonitorTargetDefinition(type, monitorable, destination); definition.setOptimizable(true); return definition; } }