protected Reference createReference(Reference reference, InterfaceContract interfaze) { Reference newReference; try { newReference = (Reference)reference.clone(); if (newReference.getInterfaceContract() == null) newReference.setInterfaceContract(interfaze); } catch (CloneNotSupportedException e) { throw new AssertionError(e); // should not ever happen } return newReference; }
/** * Use preProcess to validate and map the references and properties dynamically */ public void build(Component component) { for (Reference reference : component.getReferences()) { if (unresolvedBeanRef.containsKey(reference.getName())) { Reference ref = unresolvedBeanRef.get(reference.getName()); componentType.getReferences().add(createReference(reference, ref.getInterfaceContract())); unresolvedBeanRef.remove(reference.getName()); } } for (Property property : component.getProperties()) { if (unresolvedBeanRef.containsKey(property.getName())) { componentType.getProperties().add(createProperty(property)); this.setPropertyClass(property.getName(), property.getClass()); unresolvedBeanRef.remove(property.getName()); } } }
if (ref.getInterfaceContract() != null) { Interface i = ref.getInterfaceContract().getInterface(); if (i instanceof JavaInterface) { Class<?> type = ((JavaInterface)i).getJavaClass();
public WireFormatJMSTextReferenceProvider(ExtensionPointRegistry registry, RuntimeEndpointReference endpointReference) { super(); this.registry = registry; this.endpointReference = endpointReference; this.binding = (JMSBinding)endpointReference.getBinding(); // configure the reference based on this wire format // currently maintaining the message processor structure which // contains the details of jms message processing however override // any message processors specified in the SCDL in this case // this wire format doubles up as the execution logic for user defined // message processors so check the processor name is still set to default // before overwriting if ((this.binding.getRequestWireFormat() instanceof WireFormatJMSText) && (this.binding.getRequestMessageProcessorName().equals(JMSBindingConstants.DEFAULT_MP_CLASSNAME))){ this.binding.setRequestMessageProcessorName(JMSBindingConstants.TEXT_MP_CLASSNAME); } if ((this.binding.getResponseWireFormat() instanceof WireFormatJMSText) && (this.binding.getResponseMessageProcessorName().equals(JMSBindingConstants.DEFAULT_MP_CLASSNAME))){ this.binding.setResponseMessageProcessorName(JMSBindingConstants.TEXT_MP_CLASSNAME); } // just point to the reference interface contract so no // databinding transformation takes place interfaceContract = endpointReference.getReference().getReference().getInterfaceContract(); }
List<Operation> opList = reference.getReference().getInterfaceContract().getInterface().getOperations(); interfaceContract = reference.getReference().getInterfaceContract();
/** * Creates a Reference for the component type based on its name and Java interface */ private org.apache.tuscany.sca.assembly.Reference createReference(Class<?> interfaze, String name) throws InvalidInterfaceException { org.apache.tuscany.sca.assembly.Reference reference = assemblyFactory.createReference(); JavaInterfaceContract interfaceContract = javaFactory.createJavaInterfaceContract(); reference.setInterfaceContract(interfaceContract); // Set the name of the reference to the supplied name and the multiplicity of the reference // to 1..1 - for Spring implementations, this is the only multiplicity supported reference.setName(name); reference.setMultiplicity(Multiplicity.ONE_ONE); // For Spring references, we allow pass-by-reference reference.setAllowsPassByReference(true); // Set the call interface and, if present, the callback interface JavaInterface callInterface = javaFactory.createJavaInterface(interfaze); reference.getInterfaceContract().setInterface(callInterface); if (callInterface.getCallbackClass() != null) { JavaInterface callbackInterface = javaFactory.createJavaInterface(callInterface.getCallbackClass()); reference.getInterfaceContract().setCallbackInterface(callbackInterface); } return reference; }
public WireFormatJMSBytesReferenceProvider(ExtensionPointRegistry registry, RuntimeEndpointReference endpointReference) { super(); this.registry = registry; this.endpointReference = endpointReference; this.binding = (JMSBinding) endpointReference.getBinding(); // configure the reference based on this wire format // currently maintaining the message processor structure which // contains the details of jms message processing however overried // any message processors specied in the SCDL in this case if (this.binding.getRequestWireFormat() instanceof WireFormatJMSBytes){ this.binding.setRequestMessageProcessorName(JMSBindingConstants.BYTES_MP_CLASSNAME); } if (this.binding.getResponseWireFormat() instanceof WireFormatJMSBytes){ this.binding.setResponseMessageProcessorName(JMSBindingConstants.BYTES_MP_CLASSNAME); } // just point to the reference interface contract so no // databinding transformation takes place interfaceContract = endpointReference.getReference().getReference().getInterfaceContract(); }
error(monitor, "NoInterfaceForPortType", theInterfaces, callPT.getQName().toString()); } else reference.getInterfaceContract().setInterface(callInterface); error(monitor, "NoInterfaceForPortType", theInterfaces, callbackPT.getQName().toString()); } else reference.getInterfaceContract().setCallbackInterface(callbackInterface);
error(monitor, "NoInterfaceForPortType", theInterfaces, callPT.getQName().toString()); } else reference.getInterfaceContract().setInterface(callInterface); error(monitor, "NoInterfaceForPortType", theInterfaces, callbackPT.getQName().toString()); } else reference.getInterfaceContract().setCallbackInterface(callbackInterface);
JavaInterface javaInterface = (JavaInterface)reference.getInterfaceContract().getInterface(); requiredType = javaInterface.getJavaClass();
InterfaceContract topInterfaceContract = topContract.getInterfaceContract(); InterfaceContract bottomInterfaceContract = bottomContract.getInterfaceContract();
InterfaceContract topInterfaceContract = topContract.getInterfaceContract(); InterfaceContract bottomInterfaceContract = bottomContract.getInterfaceContract();
JavaInterface callInterface = javaInterfaceFactory.createJavaInterface(baseType); reference.getInterfaceContract().setInterface(callInterface); if (callInterface.getCallbackClass() != null) { JavaInterface callbackInterface = javaInterfaceFactory.createJavaInterface(callInterface.getCallbackClass()); reference.getInterfaceContract().setCallbackInterface(callbackInterface);
List<Operation> opList = reference.getReference().getInterfaceContract().getInterface().getOperations(); interfaceContract = reference.getReference().getInterfaceContract();
reference.getInterfaceContract().setInterface(callInterface); if (callInterface.getCallbackClass() != null) { JavaInterface callbackInterface = javaInterfaceFactory.createJavaInterface(callInterface.getCallbackClass(), forceRemotable); reference.getInterfaceContract().setCallbackInterface(callbackInterface);
Interface interfaze = reference.getInterfaceContract().getInterface(); if (interfaze instanceof JavaInterface) { JavaInterface javaInterface = (JavaInterface)interfaze;
InterfaceContract implContract = (InterfaceContract)implReference.getInterfaceContract().clone(); implContract.setInterface(implContract.getCallbackInterface()); implContract.setCallbackInterface(null);
InterfaceContract topInterfaceContract = topContract.getInterfaceContract(); InterfaceContract bottomInterfaceContract = bottomContract.getInterfaceContract();
reference.getInterfaceContract().getInterface().resetDataBinding(DOMDataBinding.NAME); reference.getInterfaceContract().getInterface().resetDataBinding(DOMDataBinding.NAME); for (EndpointReference endpointReference : reference.getEndpointReferences()) { RuntimeEndpointReference epr = (RuntimeEndpointReference)endpointReference;
InterfaceContract topInterfaceContract = topContract.getInterfaceContract(); InterfaceContract bottomInterfaceContract = bottomContract.getInterfaceContract();