/** * Adds a resolved reference * * @param reference the reference to add */ public void addReference(LogicalReference reference) { references.put(reference.getUri().getFragment(), reference); }
private void raiseAmbiguousService(LogicalReference reference, Target target, InstantiationContext context) { String componentName = target.getComponent(); URI referenceUri = reference.getUri(); String msg = "More than one service available on component: " + componentName + ". The wire from the reference " + referenceUri + " must explicitly specify a target service."; AmbiguousService error = new AmbiguousService(msg, reference); context.addError(error); }
private void raiseNoService(LogicalReference reference, Target target, LogicalCompositeComponent parent, InstantiationContext context) { String componentName = target.getComponent(); URI referenceUri = reference.getUri(); String msg = "The reference " + referenceUri + " is wired to component " + componentName + " but the component has no services"; NoServiceOnComponent error = new NoServiceOnComponent(msg, parent); context.addError(error); }
private void raiseAmbiguousService(LogicalReference reference, Target target, InstantiationContext context) { String componentName = target.getComponent(); URI referenceUri = reference.getUri(); String msg = "More than one service available on component: " + componentName + ". The wire from the reference " + referenceUri + " must explicitly specify a target service."; AmbiguousService error = new AmbiguousService(msg, reference); context.addError(error); }
private void raiseIncompatibleBindings(LogicalReference reference, LogicalService service, String name, InstantiationContext context) { BindingNotFound error = new BindingNotFound( "The binding " + name + " for reference " + reference.getUri() + " and service " + service.getUri() + " are not compatible", reference); context.addError(error); }
public WebWireSource generateSource(LogicalReference reference) throws Fabric3Exception { WebWireSource source = new WebWireSource(); source.setUri(reference.getUri()); source.setOptimizable(true); return source; }
private void raiseIncompatibleBindings(LogicalReference reference, LogicalService service, String name, InstantiationContext context) { BindingNotFound error = new BindingNotFound( "The binding " + name + " for reference " + reference.getUri() + " and service " + service.getUri() + " are not compatible", reference); context.addError(error); }
private void raiseNoService(LogicalReference reference, Target target, LogicalCompositeComponent parent, InstantiationContext context) { String componentName = target.getComponent(); URI referenceUri = reference.getUri(); String msg = "The reference " + referenceUri + " is wired to component " + componentName + " but the component has no services"; NoServiceOnComponent error = new NoServiceOnComponent(msg, parent); context.addError(error); }
/** * 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 PhysicalWireSource generateSource(LogicalReference reference) throws Fabric3Exception { SingletonWireSource source = new SingletonWireSource(); URI uri = reference.getUri(); source.setOptimizable(true); source.setUri(uri); source.setInjectable(new Injectable(InjectableType.REFERENCE, uri.getFragment())); return source; }
/** * 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; }
public TargetComponentNotFound(LogicalReference reference, URI targetUri) { super(reference.getParent().getUri(), reference.getParent().getDefinition().getContributionUri(), Collections.singletonList(reference)); this.referenceUri = reference.getUri(); this.targetUri = targetUri; }
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; }
private void raiseServiceNotFound(LogicalReference reference, Target target, InstantiationContext context) { URI referenceUri = reference.getUri(); String componentName = target.getComponent(); String serviceName = target.getBindable(); String msg = "The service " + serviceName + " wired from the reference " + referenceUri + " is not found on component " + componentName; ServiceNotFound error = new ServiceNotFound(msg, reference); context.addError(error); }
private void raiseServiceNotFound(LogicalReference reference, Target target, InstantiationContext context) { URI referenceUri = reference.getUri(); String componentName = target.getComponent(); String serviceName = target.getBindable(); String msg = "The service " + serviceName + " wired from the reference " + referenceUri + " is not found on component " + componentName; ServiceNotFound error = new ServiceNotFound(msg, reference); context.addError(error); }
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); }
public PhysicalSourceDefinition generateSource(LogicalReference reference, EffectivePolicy policy) throws GenerationException { ServiceContract contract = reference.getLeafReference().getServiceContract(); if (!(contract instanceof JavaServiceContract)) { // Spring reference contracts are always defined by Java interfaces throw new GenerationException("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 SpringSourceDefinition(referenceName, interfaze, uri); }