public <T extends Binding> PhysicalWire generateReferenceCallback(LogicalBinding<T> binding) { checkReference(binding); LogicalReference reference = (LogicalReference) binding.getParent(); LogicalComponent<?> component = reference.getParent(); ServiceContract contract = reference.getServiceContract(); ServiceContract callbackContract = contract.getCallbackContract(); LogicalService callbackService = component.getService(callbackContract.getInterfaceName()); List<LogicalOperation> operations = reference.getCallbackOperations(); // generate the metadata used to attach the physical callback wire to the source transport WireBindingGenerator<T> sourceGenerator = getGenerator(binding); PhysicalWireSource source = sourceGenerator.generateSource(binding, callbackContract, operations); URI sourceUri = binding.getParent().getParent().getDefinition().getContributionUri(); source.setClassLoader(classLoaderRegistry.getClassLoader(sourceUri)); // generate the metadata used to attach the physical callback wire to the target component ComponentGenerator targetGenerator = getGenerator(component); PhysicalWireTarget target = targetGenerator.generateTarget(callbackService); URI targetUri = callbackService.getParent().getDefinition().getContributionUri(); target.setClassLoader(classLoaderRegistry.getClassLoader(targetUri)); target.setCallback(true); Set<PhysicalOperation> operation = operationGenerator.generateOperations(operations); return new PhysicalWire(source, target, operation); }
public <T extends Binding> PhysicalWire generateServiceCallback(LogicalBinding<T> binding) { checkService(binding); LogicalService service = (LogicalService) binding.getParent(); LogicalComponent<?> component = service.getParent(); ServiceContract contract = service.getServiceContract(); ServiceContract callbackContract = contract.getCallbackContract(); List<LogicalOperation> operations = service.getCallbackOperations(); // generate the metadata used to attach the physical callback wire to the source component ComponentGenerator sourceGenerator = getGenerator(component); PhysicalWireSource source = sourceGenerator.generateCallbackSource(service); URI sourceUri = component.getDefinition().getContributionUri(); source.setClassLoader(classLoaderRegistry.getClassLoader(sourceUri)); // generate the metadata used to attach the physical callback wire to the target transport WireBindingGenerator<T> bindingGenerator = getGenerator(binding); PhysicalWireTarget target = bindingGenerator.generateTarget(binding, callbackContract, operations); target.setCallback(true); URI targetUri = binding.getParent().getParent().getDefinition().getContributionUri(); target.setClassLoader(classLoaderRegistry.getClassLoader(targetUri)); // generate the metadata for interceptors that are attached to wire invocation chains, e.g. policy implemented by an interceptor Set<PhysicalOperation> physicalOperations = operationGenerator.generateOperations(operations); return new PhysicalWire(source, target, physicalOperations); }
public <T extends Binding> PhysicalWire generateService(LogicalBinding<T> binding, URI callbackUri) { checkService(binding); LogicalService service = (LogicalService) binding.getParent(); LogicalComponent<?> component = service.getParent(); ServiceContract contract = service.getServiceContract(); List<LogicalOperation> operations = service.getOperations(); // generate the metadata used to attach the physical wire to the target component ComponentGenerator targetGenerator = getGenerator(component); PhysicalWireTarget target = targetGenerator.generateTarget(service); URI targetUri = service.getParent().getDefinition().getContributionUri(); target.setClassLoader(classLoaderRegistry.getClassLoader(targetUri)); target.setCallbackUri(callbackUri); // generate the metadata used to attach the physical wire to the source transport WireBindingGenerator<T> sourceGenerator = getGenerator(binding); PhysicalWireSource source = sourceGenerator.generateSource(binding, contract, operations); URI sourceUri = service.getParent().getDefinition().getContributionUri(); source.setClassLoader(classLoaderRegistry.getClassLoader(sourceUri)); // generate the metadata for interceptors that are attached to wire invocation chains, e.g. policy implemented by an interceptor Set<PhysicalOperation> physicalOperations = operationGenerator.generateOperations(operations); PhysicalWire physicalWire = new PhysicalWire(source, target, physicalOperations); boolean optimizable = source.isOptimizable() && target.isOptimizable() && checkOptimization(contract, physicalOperations); physicalWire.setOptimizable(optimizable); return physicalWire; }
public <T extends Binding> PhysicalWire generateServiceCallback(LogicalBinding<T> binding) { checkService(binding); LogicalService service = (LogicalService) binding.getParent(); LogicalComponent<?> component = service.getParent(); ServiceContract contract = service.getServiceContract(); ServiceContract callbackContract = contract.getCallbackContract(); List<LogicalOperation> operations = service.getCallbackOperations(); // generate the metadata used to attach the physical callback wire to the source component ComponentGenerator sourceGenerator = getGenerator(component); PhysicalWireSource source = sourceGenerator.generateCallbackSource(service); URI sourceUri = component.getDefinition().getContributionUri(); source.setClassLoader(classLoaderRegistry.getClassLoader(sourceUri)); // generate the metadata used to attach the physical callback wire to the target transport WireBindingGenerator<T> bindingGenerator = getGenerator(binding); PhysicalWireTarget target = bindingGenerator.generateTarget(binding, callbackContract, operations); target.setCallback(true); URI targetUri = binding.getParent().getParent().getDefinition().getContributionUri(); target.setClassLoader(classLoaderRegistry.getClassLoader(targetUri)); // generate the metadata for interceptors that are attached to wire invocation chains, e.g. policy implemented by an interceptor Set<PhysicalOperation> physicalOperations = operationGenerator.generateOperations(operations); return new PhysicalWire(source, target, physicalOperations); }
public <T extends Binding> PhysicalWire generateReferenceCallback(LogicalBinding<T> binding) { checkReference(binding); LogicalReference reference = (LogicalReference) binding.getParent(); LogicalComponent<?> component = reference.getParent(); ServiceContract contract = reference.getServiceContract(); ServiceContract callbackContract = contract.getCallbackContract(); LogicalService callbackService = component.getService(callbackContract.getInterfaceName()); List<LogicalOperation> operations = reference.getCallbackOperations(); // generate the metadata used to attach the physical callback wire to the source transport WireBindingGenerator<T> sourceGenerator = getGenerator(binding); PhysicalWireSource source = sourceGenerator.generateSource(binding, callbackContract, operations); URI sourceUri = binding.getParent().getParent().getDefinition().getContributionUri(); source.setClassLoader(classLoaderRegistry.getClassLoader(sourceUri)); // generate the metadata used to attach the physical callback wire to the target component ComponentGenerator targetGenerator = getGenerator(component); PhysicalWireTarget target = targetGenerator.generateTarget(callbackService); URI targetUri = callbackService.getParent().getDefinition().getContributionUri(); target.setClassLoader(classLoaderRegistry.getClassLoader(targetUri)); target.setCallback(true); Set<PhysicalOperation> operation = operationGenerator.generateOperations(operations); return new PhysicalWire(source, target, operation); }
PhysicalWireTarget target = targetGenerator.generateTarget(binding, contract, operations); if (callbackContract != null) {
public <T extends Binding> PhysicalWire generateService(LogicalBinding<T> binding, URI callbackUri) { checkService(binding); LogicalService service = (LogicalService) binding.getParent(); LogicalComponent<?> component = service.getParent(); ServiceContract contract = service.getServiceContract(); List<LogicalOperation> operations = service.getOperations(); // generate the metadata used to attach the physical wire to the target component ComponentGenerator targetGenerator = getGenerator(component); PhysicalWireTarget target = targetGenerator.generateTarget(service); URI targetUri = service.getParent().getDefinition().getContributionUri(); target.setClassLoader(classLoaderRegistry.getClassLoader(targetUri)); target.setCallbackUri(callbackUri); // generate the metadata used to attach the physical wire to the source transport WireBindingGenerator<T> sourceGenerator = getGenerator(binding); PhysicalWireSource source = sourceGenerator.generateSource(binding, contract, operations); URI sourceUri = service.getParent().getDefinition().getContributionUri(); source.setClassLoader(classLoaderRegistry.getClassLoader(sourceUri)); // generate the metadata for interceptors that are attached to wire invocation chains, e.g. policy implemented by an interceptor Set<PhysicalOperation> physicalOperations = operationGenerator.generateOperations(operations); PhysicalWire physicalWire = new PhysicalWire(source, target, physicalOperations); boolean optimizable = source.isOptimizable() && target.isOptimizable() && checkOptimization(contract, physicalOperations); physicalWire.setOptimizable(optimizable); return physicalWire; }
PhysicalWireTarget target = targetGenerator.generateTarget(binding, contract, operations); if (callbackContract != null) {