private <T> LogicalWire createWire(Class<T> interfaze) throws Fabric3Exception { LogicalReference logicalReference = createReference(interfaze); LogicalCompositeComponent domainComponent = lcm.getDomainComposite(); List<LogicalService> services = autowireResolver.resolve(logicalReference, domainComponent); if (services.isEmpty()) { throw new NotFoundException("Service not found for type: " + interfaze.getName()); } LogicalService targetService = services.get(0); return new LogicalWire(domainComponent, logicalReference, targetService, SYNTHETIC_CONTRIBUTION); }
private <T> LogicalWire createWire(Class<T> interfaze) throws Fabric3Exception { LogicalReference logicalReference = createReference(interfaze); LogicalCompositeComponent domainComponent = lcm.getDomainComposite(); List<LogicalService> services = autowireResolver.resolve(logicalReference, domainComponent); if (services.isEmpty()) { throw new NotFoundException("Service not found for type: " + interfaze.getName()); } LogicalService targetService = services.get(0); return new LogicalWire(domainComponent, logicalReference, targetService, SYNTHETIC_CONTRIBUTION); }
private <T> LogicalWire createWire(Class<T> interfaze) throws ResolverException { JavaServiceContract contract = introspector.introspect(interfaze); LogicalReference logicalReference = createReference(contract); LogicalCompositeComponent domainComponent = lcm.getRootComponent(); List<LogicalService> services = autowireResolver.resolve(logicalReference, contract, domainComponent); if (services.isEmpty()) { throw new NotFoundException("Service not found for type: " + interfaze.getName()); } LogicalService targetService = services.get(0); return new LogicalWire(domainComponent, logicalReference, targetService, SYNTHETIC_DEPLOYABLE, true); }
for (LogicalService target : newTargets) { QName deployable = composite.getDeployable(); LogicalWire newWire = new LogicalWire(reference.getParent(), reference, target, deployable); newWires.add(newWire);
/** * Creates a wire by resolving a Target. * * @param target the target * @param reference the source reference * @param bindingName the binding name or null * @param parent the parent component * @param context the instantiation context * @return the wire or null if it could not be created */ private LogicalWire createWire(Target target, LogicalReference reference, String bindingName, LogicalCompositeComponent parent, InstantiationContext context) { LogicalService service = resolveService(reference, target, parent, context); if (service == null) { return null; } QName deployable = service.getParent().getDeployable(); LogicalWire wire = new LogicalWire(parent, reference, service, deployable, true); String serviceBindingName = target.getBinding(); resolveBindings(reference, bindingName, service, wire, serviceBindingName, context); return wire; }
/** * Creates a wire by resolving a Target. * * @param target the target * @param reference the source reference * @param bindingName the binding name or null * @param parent the parent component * @param context the instantiation context * @return the wire or null if it could not be created */ private LogicalWire createWire(Target target, LogicalReference reference, String bindingName, LogicalCompositeComponent parent, InstantiationContext context) { LogicalService service = resolveService(reference, target, parent, context); if (service == null) { return null; } URI contributionUri = service.getParent().getDefinition().getContributionUri(); LogicalWire wire = new LogicalWire(parent, reference, service, contributionUri); String serviceBindingName = target.getBinding(); resolveBindings(reference, bindingName, service, wire, serviceBindingName, context); return wire; }
/** * Creates a wire by resolving a Target. * * @param target the target * @param reference the source reference * @param bindingName the binding name or null * @param parent the parent component * @param context the instantiation context * @return the wire or null if it could not be created */ private LogicalWire createWire(Target target, LogicalReference reference, String bindingName, LogicalCompositeComponent parent, InstantiationContext context) { LogicalService service = resolveService(reference, target, parent, context); if (service == null) { return null; } URI contributionUri = service.getParent().getDefinition().getContributionUri(); LogicalWire wire = new LogicalWire(parent, reference, service, contributionUri); String serviceBindingName = target.getBinding(); resolveBindings(reference, bindingName, service, wire, serviceBindingName, context); return wire; }
LogicalWire wire = new LogicalWire(parentComposite, logicalReference, target, contributionUri); parentComposite.addWire(logicalReference, wire); for (LogicalWire existingWire : existingWires) {
LogicalWire wire = new LogicalWire(parentComposite, logicalReference, target, contributionUri); parentComposite.addWire(logicalReference, wire); for (LogicalWire existingWire : existingWires) {
LogicalWire wire = new LogicalWire(parentComposite, leafReference, target, deployable, true); parentComposite.addWire(leafReference, wire); for (LogicalWire existingWire : existingWires) {
public void instantiateCompositeWires(Composite composite, LogicalCompositeComponent parent, InstantiationContext context) { // instantiate wires held directly in the composite and in included composites for (Wire definition : composite.getWires()) { // resolve the source reference Target referenceTarget = definition.getReferenceTarget(); LogicalReference reference = resolveReference(referenceTarget, parent, context); if (reference == null) { // error resolving, continue processing other targets so all errors are collated continue; } // resolve the target service Target serviceTarget = definition.getServiceTarget(); LogicalService service = resolveService(reference, serviceTarget, parent, context); if (service == null) { // error resolving, continue processing other targets so all errors are collated continue; } // create the wire URI contributionUri = parent.getDefinition().getContributionUri(); LogicalWire wire = new LogicalWire(parent, reference, service, contributionUri); String referenceBindingName = referenceTarget.getBinding(); String serviceBindingName = serviceTarget.getBinding(); resolveBindings(reference, referenceBindingName, service, wire, serviceBindingName, context); parent.addWire(reference, wire); } }
public void instantiateCompositeWires(Composite composite, LogicalCompositeComponent parent, InstantiationContext context) { // instantiate wires held directly in the composite and in included composites for (Wire definition : composite.getWires()) { // resolve the source reference Target referenceTarget = definition.getReferenceTarget(); LogicalReference reference = resolveReference(referenceTarget, parent, context); if (reference == null) { // error resolving, continue processing other targets so all errors are collated continue; } // resolve the target service Target serviceTarget = definition.getServiceTarget(); LogicalService service = resolveService(reference, serviceTarget, parent, context); if (service == null) { // error resolving, continue processing other targets so all errors are collated continue; } // create the wire URI contributionUri = parent.getDefinition().getContributionUri(); LogicalWire wire = new LogicalWire(parent, reference, service, contributionUri); String referenceBindingName = referenceTarget.getBinding(); String serviceBindingName = serviceTarget.getBinding(); resolveBindings(reference, referenceBindingName, service, wire, serviceBindingName, context); parent.addWire(reference, wire); } }
public void instantiateCompositeWires(Composite composite, LogicalCompositeComponent parent, InstantiationContext context) { // instantiate wires held directly in the composite and in included composites for (WireDefinition definition : composite.getWires()) { // resolve the source reference Target referenceTarget = definition.getReferenceTarget(); LogicalReference reference = resolveReference(referenceTarget, parent, context); if (reference == null) { // error resolving, continue processing other targets so all errors are collated continue; } // resolve the target service Target serviceTarget = definition.getServiceTarget(); LogicalService service = resolveService(reference, serviceTarget, parent, context); if (service == null) { // error resolving, continue processing other targets so all errors are collated continue; } // create the wire QName deployable = parent.getDeployable(); LogicalWire wire = new LogicalWire(parent, reference, service, deployable); wire.setReplaces(definition.isReplace()); String referenceBindingName = referenceTarget.getBinding(); String serviceBindingName = serviceTarget.getBinding(); resolveBindings(reference, referenceBindingName, service, wire, serviceBindingName, context); parent.addWire(reference, wire); } }