/** * @param sd */ public LazyImplementationBuilder(ServiceDeclaration sd) { super(); this.sd = sd; this.qname = ServiceDeclarationParser.getQName(sd.getAttributes().get("qname")); }
public static List<Descriptor> parse(String header) { if (header != null) { if (header.length() == 0) { throw new IllegalArgumentException("A header cannot be an empty string."); } String[] clauseStrings = parseDelimitedString(header, PATH_SEPARATOR); List<Descriptor> completeList = new ArrayList<Descriptor>(); for (int i = 0; (clauseStrings != null) && (i < clauseStrings.length); i++) { completeList.add(parseClause(clauseStrings[i])); } return completeList; } return null; }
for (Map<String, String> attributes : ServiceDeclarationParser.load(url, isPropertyFile)) { String className = attributes.get("class"); ServiceDeclarationImpl descriptor = new ServiceDeclarationImpl(url, className, attributes);
/** * Parse the declaration into a map of name/value pairs. The class name is added under "class" * and directives are added using @<directiveName> as the key. * @param declaration * @return A map of attributes */ public static Map<String, String> parseDeclaration(String declaration) { List<Descriptor> descriptors = parse(declaration); Descriptor descriptor = descriptors.get(0); Map<String, String> map = new HashMap<String, String>(); map.putAll(descriptor.getAttributes()); map.put("class", descriptor.getValue()); for (Map.Entry<String, String> e : descriptor.getDirectives().entrySet()) { // For directives, add @ as the prefix for the key map.put("@" + e.getKey(), e.getValue()); } return map; }
attributes.put("uri", key); attributes.putAll(parseDeclaration(value)); descriptors.add(attributes); String reg = line.trim(); Map<String, String> attributes = parseDeclaration(reg); descriptors.add(attributes);
private static Descriptor parseClause(String clauseString) throws IllegalArgumentException { String[] pieces = parseDelimitedString(clauseString, SEGMENT_SEPARATOR);
for (Map<String, String> attributes : ServiceDeclarationParser.load(url, isPropertyFile)) { String className = attributes.get("class"); ServiceDeclarationImpl descriptor = new ServiceDeclarationImpl(url, className, attributes);
/** * Parse the declaration into a map of name/value pairs. The class name is added under "class" * and directives are added using @<directiveName> as the key. * @param declaration * @return A map of attributes */ public static Map<String, String> parseDeclaration(String declaration) { List<Descriptor> descriptors = parse(declaration); Descriptor descriptor = descriptors.get(0); Map<String, String> map = new HashMap<String, String>(); map.putAll(descriptor.getAttributes()); map.put("class", descriptor.getValue()); for (Map.Entry<String, String> e : descriptor.getDirectives().entrySet()) { // For directives, add @ as the prefix for the key map.put("@" + e.getKey(), e.getValue()); } return map; }
attributes.put("uri", key); attributes.putAll(parseDeclaration(value)); descriptors.add(attributes); String reg = line.trim(); Map<String, String> attributes = parseDeclaration(reg); descriptors.add(attributes);
private static Descriptor parseClause(String clauseString) throws IllegalArgumentException { String[] pieces = parseDelimitedString(clauseString, SEGMENT_SEPARATOR);
/** * @param sd */ public LazyBindingBuilder(ServiceDeclaration sd) { super(); this.sd = sd; this.qname = ServiceDeclarationParser.getQName(sd.getAttributes().get("qname")); }
public static List<Descriptor> parse(String header) { if (header != null) { if (header.length() == 0) { throw new IllegalArgumentException("A header cannot be an empty string."); } String[] clauseStrings = parseDelimitedString(header, PATH_SEPARATOR); List<Descriptor> completeList = new ArrayList<Descriptor>(); for (int i = 0; (clauseStrings != null) && (i < clauseStrings.length); i++) { completeList.add(parseClause(clauseStrings[i])); } return completeList; } return null; }
for (Map<String, String> attributes : ServiceDeclarationParser.load(url, isPropertyFile)) { String className = attributes.get("class"); ServiceDeclarationImpl descriptor =
/** * @param sd */ public LazyBindingBuilder(ServiceDeclaration sd) { super(); this.sd = sd; this.qname = ServiceDeclarationParser.getQName(sd.getAttributes().get("qname")); }
/** * @param sd */ public LazyPolicyBuilder(ServiceDeclaration sd) { super(); this.sd = sd; this.qname = ServiceDeclarationParser.getQName(sd.getAttributes().get("qname")); }
/** * @param sd */ public LazyImplementationBuilder(ServiceDeclaration sd) { super(); this.sd = sd; this.qname = ServiceDeclarationParser.getQName(sd.getAttributes().get("qname")); }
/** * @param sd */ public LazyPolicyBuilder(ServiceDeclaration sd) { super(); this.sd = sd; this.qname = ServiceDeclarationParser.getQName(sd.getAttributes().get("qname")); }
private Object getAttribute(Method method) throws Exception { if (method.getParameterTypes().length != 0) { return null; } String name = method.getName(); if (name.equals("getModelType") && method.getReturnType() == Class.class) { return sd.loadClass(sd.getAttributes().get("model")); } else if (name.equals("getArtifactType")) { return ServiceDeclarationParser.getQName(sd.getAttributes().get("qname")); } return null; }
private Object getAttribute(Method method) throws Exception { if (method.getParameterTypes().length != 0) { return null; } String name = method.getName(); if (name.equals("getModelType") && method.getReturnType() == Class.class) { return sd.loadClass(sd.getAttributes().get("model")); } else if (name.equals("getArtifactType")) { return ServiceDeclarationParser.getQName(sd.getAttributes().get("qname")); } return null; }
protected QName getDefaultMappedBinding(Map<String, String> attributes) { QName defaultMappedBinding = null; if (attributes != null) { String qname = attributes.get("mappedBinding"); if (qname != null) { defaultMappedBinding = ServiceDeclarationParser.getQName(qname); } } if (defaultMappedBinding == null) { String qname = System.getProperty("org.apache.tuscany.sca.binding.sca.provider.SCABindingMapper.mappedBinding"); if (qname != null) { defaultMappedBinding = ServiceDeclarationParser.getQName(qname); } else { // By default, mapping to binding.ws or if thats not available then binding.rmi defaultMappedBinding = new QName(Base.SCA11_TUSCANY_NS, "binding.hazelcast"); if (!isBindingSupported(defaultMappedBinding)) { defaultMappedBinding = new QName(Base.SCA11_NS, "binding.ws"); if (!isBindingSupported(defaultMappedBinding)) { defaultMappedBinding = new QName(Base.SCA11_TUSCANY_NS, "binding.rmi"); } } } } return defaultMappedBinding; }