for (LogicalOperation operation : service.getOperations()) { if (operation.getDefinition().getName().equals(operationName)) { operations.add(operation);
callbackOperations = operationGenerator.generateOperations(operations, false, policyResult); } else { List<LogicalOperation> targetOperations = callbackService.getOperations(); List<LogicalOperation> sourceOperations = service.getCallbackOperations(); callbackOperations = operationGenerator.generateOperations(targetOperations, sourceOperations, false, policyResult);
for (LogicalOperation operation : service.getOperations()) { if (containsTransactionIntent(operation.getIntents())) { return true;
physicalOperations = operationGenerator.generateOperations(sourceOperations, true, policyResult); } else { List<LogicalOperation> targetOperations = service.getOperations(); physicalOperations = operationGenerator.generateOperations(sourceOperations, targetOperations, true, policyResult);
} else { List<LogicalOperation> sourceOperations = reference.getOperations(); List<LogicalOperation> targetOperations = service.getOperations(); operations = operationGenerator.generateOperations(sourceOperations, targetOperations, false, policyResult);
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; }
private PhysicalWire generateLocalWireCallback(LogicalWire wire) { LogicalReference reference = wire.getSource(); LogicalService service = wire.getTarget(); LogicalComponent<?> targetComponent = reference.getParent(); ServiceContract referenceCallbackContract = reference.getServiceContract().getCallbackContract(); LogicalService callbackService = targetComponent.getService(referenceCallbackContract.getInterfaceName()); LogicalComponent sourceComponent = service.getParent(); List<LogicalOperation> targetOperations = callbackService.getOperations(); List<LogicalOperation> sourceOperations = service.getCallbackOperations(); Set<PhysicalOperation> callbackOperations = operationGenerator.generateOperations(targetOperations, sourceOperations, false); // generate the metadata used to attach the physical callback wire to the source component (the component providing the forward service) ComponentGenerator sourceGenerator = getGenerator(sourceComponent); PhysicalWireSource source = sourceGenerator.generateCallbackSource(service); URI sourceUri = sourceComponent.getDefinition().getContributionUri(); source.setClassLoader(classLoaderRegistry.getClassLoader(sourceUri)); // generate the metadata used to attach the physical callback wire to the target component (the client of the forward service) ComponentGenerator targetGenerator = getGenerator(targetComponent); PhysicalWireTarget target = targetGenerator.generateTarget(callbackService); URI targetUri = targetComponent.getDefinition().getContributionUri(); target.setClassLoader(classLoaderRegistry.getClassLoader(targetUri)); target.setCallback(true); PhysicalWire physicalWire = new PhysicalWire(source, target, callbackOperations); physicalWire.setOptimizable(false); return physicalWire; }
private PhysicalWire generateLocalWireCallback(LogicalWire wire) { LogicalReference reference = wire.getSource(); LogicalService service = wire.getTarget(); LogicalComponent<?> targetComponent = reference.getParent(); ServiceContract referenceCallbackContract = reference.getServiceContract().getCallbackContract(); LogicalService callbackService = targetComponent.getService(referenceCallbackContract.getInterfaceName()); LogicalComponent sourceComponent = service.getParent(); List<LogicalOperation> targetOperations = callbackService.getOperations(); List<LogicalOperation> sourceOperations = service.getCallbackOperations(); Set<PhysicalOperation> callbackOperations = operationGenerator.generateOperations(targetOperations, sourceOperations, false); // generate the metadata used to attach the physical callback wire to the source component (the component providing the forward service) ComponentGenerator sourceGenerator = getGenerator(sourceComponent); PhysicalWireSource source = sourceGenerator.generateCallbackSource(service); URI sourceUri = sourceComponent.getDefinition().getContributionUri(); source.setClassLoader(classLoaderRegistry.getClassLoader(sourceUri)); // generate the metadata used to attach the physical callback wire to the target component (the client of the forward service) ComponentGenerator targetGenerator = getGenerator(targetComponent); PhysicalWireTarget target = targetGenerator.generateTarget(callbackService); URI targetUri = targetComponent.getDefinition().getContributionUri(); target.setClassLoader(classLoaderRegistry.getClassLoader(targetUri)); target.setCallback(true); PhysicalWire physicalWire = new PhysicalWire(source, target, callbackOperations); physicalWire.setOptimizable(false); 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; }
List<LogicalOperation> operations = service.getOperations();
List<LogicalOperation> targetOperations = service.getOperations(); Set<PhysicalOperation> operations = operationGenerator.generateOperations(sourceOperations, targetOperations, false);
List<LogicalOperation> targetOperations = service.getOperations(); Set<PhysicalOperation> operations = operationGenerator.generateOperations(sourceOperations, targetOperations, false);