/** * @return the factory's name. */ public String getFactory() { return architecture.getInstanceDescription().getComponentDescription().getName(); }
/** * Creates the Json representation for an invalid controller. * * @param description the instance's description * @param json the json service * @return the json representation */ public static JsonNode from(InstanceDescription description, Json json) { ObjectNode node = json.newObject(); node.put("classname", description.getComponentDescription().getName()) .put("invalid", description.getState() == ComponentInstance.INVALID) .put("reason", extractInvalidityReason(description)); return node; }
/** * Gets the instance list created by the given factory. * @param archs the list of instance architectures * @param factory the factory name * @return the list containing the created instances (name) */ public static List<String> getInstanceList(List<Architecture> archs, String factory) { List<String> list = new ArrayList<String>(); for (Architecture arch : archs) { // Cannot be null, an empty list is returned. String n = arch.getInstanceDescription().getComponentDescription().getName(); if (factory.equals(n)) { list.add(arch.getInstanceDescription().getName()); } } return list; }
throw new ConfigurationException("Malformed service : the specification attribute is mandatory"); String filter = "(&(!(factory.name=" + getCompositeManager().getFactory().getComponentDescription().getName() + "))(factory.state=1))"; // Cannot reinstantiate yourself String givenFilter = service.getAttribute("filter"); if (givenFilter != null) {
throw new ConfigurationException("Malformed service : the specification attribute is mandatory"); String filter = "(&(!(factory.name=" + getCompositeManager().getFactory().getComponentDescription().getName() + "))(factory.state=1))"; // Cannot reinstantiate yourself String givenFilter = service.getAttribute("filter"); if (givenFilter != null) {
instance.addAttribute(new Attribute("component.type", m_type.getName()));
instance.addAttribute(new Attribute("component.type", m_type.getName()));
/** * Writes the JSON object containing the info for all instances. * @param pw the writer where the json object is printed. * @throws IOException the JSON object cannot be written */ private void getAllInstances(JSONWriter pw) throws IOException { pw.object(); // Statline: pw.key("count"); pw.value( m_archs.size()); pw.key("valid_count"); pw.value( StateUtils.getValidInstancesCount(m_archs)); pw.key("invalid_count"); pw.value( StateUtils.getInvalidInstancesCount(m_archs)); // End statline pw.key("data"); pw.array(); for (Architecture arch : m_archs) { pw.object(); pw.key("name"); pw.value(arch.getInstanceDescription().getName()); pw.key("factory"); pw.value(arch.getInstanceDescription().getComponentDescription().getName()); pw.key("state"); pw.value(StateUtils.getInstanceState(arch.getInstanceDescription().getState())); pw.endObject(); } pw.endArray(); pw.endObject(); }
pw.value(StateUtils.getInstanceState(instance.getState())); pw.key("factory"); pw.value(instance.getComponentDescription().getName());