private void createComponentResource(Map<String, Map<String, String>> components, String name, Map<String, String> info) throws IOException { // We can override the name in the parameters if (info.containsKey(COMPONENT_NAME)) name = info.get(COMPONENT_NAME); // Assume the impl==name, but allow override String impl = name; if (info.containsKey(COMPONENT_IMPLEMENTATION)) impl = info.get(COMPONENT_IMPLEMENTATION); // Check if such a class exists analyzer.referTo(impl); boolean designate = designate(name, info.get(COMPONENT_DESIGNATE), false) || designate(name, info.get(COMPONENT_DESIGNATEFACTORY), true); // If we had a designate, we want a default configuration policy of // require. if (designate && info.get(COMPONENT_CONFIGURATION_POLICY) == null) info.put(COMPONENT_CONFIGURATION_POLICY, "require"); // We have a definition, so make an XML resources Resource resource = createComponentResource(name, impl, info); analyzer.getJar().putResource("OSGI-INF/" + name + ".xml", resource); components.put("OSGI-INF/" + name + ".xml", EMPTY); }
private void createComponentResource(Map<String,Map<String,String>> components, String name, Map<String,String> info) throws Exception { // We can override the name in the parameters if (info.containsKey(COMPONENT_NAME)) name = info.get(COMPONENT_NAME); // Assume the impl==name, but allow override String impl = name; if (info.containsKey(COMPONENT_IMPLEMENTATION)) impl = info.get(COMPONENT_IMPLEMENTATION); TypeRef implRef = analyzer.getTypeRefFromFQN(impl); // Check if such a class exists analyzer.referTo(implRef); boolean designate = designate(name, info.get(COMPONENT_DESIGNATE), false) || designate(name, info.get(COMPONENT_DESIGNATEFACTORY), true); // If we had a designate, we want a default configuration policy of // require. if (designate && info.get(COMPONENT_CONFIGURATION_POLICY) == null) info.put(COMPONENT_CONFIGURATION_POLICY, "require"); // We have a definition, so make an XML resources Resource resource = createComponentResource(name, impl, info); analyzer.getJar().putResource("OSGI-INF/" + name + ".xml", resource); components.put("OSGI-INF/" + name + ".xml", EMPTY); }
private void createComponentResource(Map<String, Map<String, String>> components, String name, Map<String, String> info) throws Exception { // We can override the name in the parameters if (info.containsKey(COMPONENT_NAME)) name = info.get(COMPONENT_NAME); // Assume the impl==name, but allow override String impl = name; if (info.containsKey(COMPONENT_IMPLEMENTATION)) impl = info.get(COMPONENT_IMPLEMENTATION); TypeRef implRef = analyzer.getTypeRefFromFQN(impl); // Check if such a class exists analyzer.referTo(implRef); boolean designate = designate(name, info.get(COMPONENT_DESIGNATE), false) || designate(name, info.get(COMPONENT_DESIGNATEFACTORY), true); // If we had a designate, we want a default configuration policy of // require. if (designate && info.get(COMPONENT_CONFIGURATION_POLICY) == null) info.put(COMPONENT_CONFIGURATION_POLICY, "require"); // We have a definition, so make an XML resources Resource resource = createComponentResource(name, impl, info); String pathSegment = analyzer.validResourcePath(name, "Invalid component name"); analyzer.getJar() .putResource("OSGI-INF/" + pathSegment + ".xml", resource); components.put("OSGI-INF/" + pathSegment + ".xml", EMPTY); }
private void createComponentResource(Map<String, Map<String, String>> components, String name, Map<String, String> info) throws Exception { // We can override the name in the parameters if (info.containsKey(COMPONENT_NAME)) name = info.get(COMPONENT_NAME); // Assume the impl==name, but allow override String impl = name; if (info.containsKey(COMPONENT_IMPLEMENTATION)) impl = info.get(COMPONENT_IMPLEMENTATION); TypeRef implRef = analyzer.getTypeRefFromFQN(impl); // Check if such a class exists analyzer.referTo(implRef); boolean designate = designate(name, info.get(COMPONENT_DESIGNATE), false) || designate(name, info.get(COMPONENT_DESIGNATEFACTORY), true); // If we had a designate, we want a default configuration policy of // require. if (designate && info.get(COMPONENT_CONFIGURATION_POLICY) == null) info.put(COMPONENT_CONFIGURATION_POLICY, "require"); // We have a definition, so make an XML resources Resource resource = createComponentResource(name, impl, info); String pathSegment = analyzer.validResourcePath(name, "Invalid component name"); analyzer.getJar() .putResource("OSGI-INF/" + pathSegment + ".xml", resource); components.put("OSGI-INF/" + pathSegment + ".xml", EMPTY); }
private void createComponentResource(Map<String,Map<String,String>> components, String name, Map<String,String> info) throws Exception { // We can override the name in the parameters if (info.containsKey(COMPONENT_NAME)) name = info.get(COMPONENT_NAME); // Assume the impl==name, but allow override String impl = name; if (info.containsKey(COMPONENT_IMPLEMENTATION)) impl = info.get(COMPONENT_IMPLEMENTATION); TypeRef implRef = analyzer.getTypeRefFromFQN(impl); // Check if such a class exists analyzer.referTo(implRef); boolean designate = designate(name, info.get(COMPONENT_DESIGNATE), false) || designate(name, info.get(COMPONENT_DESIGNATEFACTORY), true); // If we had a designate, we want a default configuration policy of // require. if (designate && info.get(COMPONENT_CONFIGURATION_POLICY) == null) info.put(COMPONENT_CONFIGURATION_POLICY, "require"); // We have a definition, so make an XML resources Resource resource = createComponentResource(name, impl, info); String pathSegment = analyzer.validResourcePath(name, "Invalid component name"); analyzer.getJar().putResource("OSGI-INF/" + pathSegment + ".xml", resource); components.put("OSGI-INF/" + pathSegment + ".xml", EMPTY); }
private void createComponentResource(Map<String,Map<String,String>> components, String name, Map<String,String> info) throws Exception { // We can override the name in the parameters if (info.containsKey(COMPONENT_NAME)) name = info.get(COMPONENT_NAME); // Assume the impl==name, but allow override String impl = name; if (info.containsKey(COMPONENT_IMPLEMENTATION)) impl = info.get(COMPONENT_IMPLEMENTATION); TypeRef implRef = analyzer.getTypeRefFromFQN(impl); // Check if such a class exists analyzer.referTo(implRef); boolean designate = designate(name, info.get(COMPONENT_DESIGNATE), false) || designate(name, info.get(COMPONENT_DESIGNATEFACTORY), true); // If we had a designate, we want a default configuration policy of // require. if (designate && info.get(COMPONENT_CONFIGURATION_POLICY) == null) info.put(COMPONENT_CONFIGURATION_POLICY, "require"); // We have a definition, so make an XML resources Resource resource = createComponentResource(name, impl, info); String pathSegment = analyzer.validResourcePath(name, "Invalid component name"); analyzer.getJar().putResource("OSGI-INF/" + pathSegment + ".xml", resource); components.put("OSGI-INF/" + pathSegment + ".xml", EMPTY); }