public <T extends ResourceReference> PhysicalWire generateResource(LogicalResourceReference<T> logicalReference) { T reference = logicalReference.getDefinition(); LogicalComponent<?> component = logicalReference.getParent(); // Generates the wire source metadata ComponentGenerator sourceGenerator = getGenerator(component); @SuppressWarnings("unchecked") PhysicalWireSource source = sourceGenerator.generateResourceSource(logicalReference); URI sourceUri = component.getDefinition().getContributionUri(); source.setClassLoader(classLoaderRegistry.getClassLoader(sourceUri)); // Generates the wire target metadata ResourceReferenceGenerator<T> targetGenerator = getGenerator(reference); PhysicalWireTarget target = targetGenerator.generateWireTarget(logicalReference); URI targetUri = logicalReference.getParent().getDefinition().getContributionUri(); target.setClassLoader(classLoaderRegistry.getClassLoader(targetUri)); boolean optimizable = target.isOptimizable(); // Create the wire from the component to the resource List<LogicalOperation> sourceOperations = logicalReference.getOperations(); Set<PhysicalOperation> operations = operationGenerator.generateOperations(sourceOperations); PhysicalWire physicalWire = new PhysicalWire(source, target, operations); physicalWire.setOptimizable(optimizable); return physicalWire; }
public <T extends ResourceReference> PhysicalWire generateResource(LogicalResourceReference<T> logicalReference) { T reference = logicalReference.getDefinition(); LogicalComponent<?> component = logicalReference.getParent(); // Generates the wire source metadata ComponentGenerator sourceGenerator = getGenerator(component); @SuppressWarnings("unchecked") PhysicalWireSource source = sourceGenerator.generateResourceSource(logicalReference); URI sourceUri = component.getDefinition().getContributionUri(); source.setClassLoader(classLoaderRegistry.getClassLoader(sourceUri)); // Generates the wire target metadata ResourceReferenceGenerator<T> targetGenerator = getGenerator(reference); PhysicalWireTarget target = targetGenerator.generateWireTarget(logicalReference); URI targetUri = logicalReference.getParent().getDefinition().getContributionUri(); target.setClassLoader(classLoaderRegistry.getClassLoader(targetUri)); boolean optimizable = target.isOptimizable(); // Create the wire from the component to the resource List<LogicalOperation> sourceOperations = logicalReference.getOperations(); Set<PhysicalOperation> operations = operationGenerator.generateOperations(sourceOperations); PhysicalWire physicalWire = new PhysicalWire(source, target, operations); physicalWire.setOptimizable(optimizable); return physicalWire; }
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 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; }
boolean optimizable = source.isOptimizable() && target.isOptimizable() && checkOptimization(referenceContract, operations); physicalWire.setOptimizable(optimizable); return physicalWire;
boolean optimizable = source.isOptimizable() && target.isOptimizable() && checkOptimization(referenceContract, operations); physicalWire.setOptimizable(optimizable); return physicalWire;