/** * Process Reference declaration in JavaScript code * Supported ways : * //@Reference * var catalog = new Reference("catalog"); * * //@Reference * catalog = new Reference("catalog"); * * @param scriptContent * @return */ private Reference processReferenceScript(String scriptContent) { Reference reference = null; String referenceName = null; String tokens[] = scriptContent.split("="); // find the string between the quotes tokens = tokens[1].split("\""); referenceName = tokens[1]; if(referenceName != null) { reference = assemblyFactory.createReference(); reference.setName(referenceName); } return reference; } }
/** * Process Reference declaration in JavaScript code * Supported ways : * //@Reference * var catalog = new Reference("catalog"); * * //@Reference * catalog = new Reference("catalog"); * * @param scriptContent * @return */ private Reference processReferenceScript(String scriptContent) { Reference reference = null; String referenceName = null; String tokens[] = scriptContent.split("="); // find the string between the quotes tokens = tokens[1].split("\""); referenceName = tokens[1]; if(referenceName != null) { reference = assemblyFactory.createReference(); reference.setName(referenceName); } return reference; } }
ref.setName(reader.getAttributeValue(null, "name")); String interfaceName = reader.getAttributeValue(null, "interface"); InterfaceContract interfaceContract = javaInterfaceFactory.createJavaInterfaceContract();
ref.setName(reader.getAttributeValue(null, "id")); String interfaceName = reader.getAttributeValue(null, "interface"); InterfaceContract interfaceContract = javaInterfaceFactory.createJavaInterfaceContract();
reference.setName(getString(reader, Constants.NAME)); reference.setWiredByImpl(getBoolean(reader, Constants.WIRED_BY_IMPL)); readMultiplicity(reference, reader);
reference.setName(getString(reader, Constants.NAME)); reference.setWiredByImpl(getBoolean(reader, Constants.WIRED_BY_IMPL)); readMultiplicity(reference, reader);
reference.setName(name); reference.setMultiplicity(Multiplicity.ONE_ONE);
reference.setName(name); reference.setMultiplicity(Multiplicity.ONE_ONE);
refName = "ref" + (index++); reference.setName(refName); reference.setUnresolved(false); ct.getReferences().add(reference);
reference.setName(propertyRef);
reference.setName(name); Class<?> rawType = element.getType(); if (rawType.isArray() || Collection.class.isAssignableFrom(rawType)) {
/** * 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; }
throws IntrospectionException { org.apache.tuscany.sca.assembly.Reference reference = assemblyFactory.createReference(); reference.setName(name); JavaInterfaceContract interfaceContract = javaInterfaceFactory.createJavaInterfaceContract(); reference.setInterfaceContract(interfaceContract);
implReference.setName(implService.getName());
implReference.setName(implService.getName());
implReference.setName(referenceName); implReference.setForCallback(true);