use of org.apache.felix.ipojo.composite.instance.InstanceHandler.ManagedConfiguration in project felix by apache.
the class InstanceHandlerDescription method getHandlerInfo.
/**
* Build handler description.
* @return the handler description
* @see org.apache.felix.ipojo.architecture.HandlerDescription#getHandlerInfo()
*/
public Element getHandlerInfo() {
Element instances = super.getHandlerInfo();
for (int i = 0; i < m_configurations.length; i++) {
ManagedConfiguration inst = m_configurations[i];
Element instance = new Element("Instance", "");
if (inst.getInstance() == null) {
instance.addAttribute(new Attribute("Factory", inst.getConfiguration().get("component").toString()));
instance.addAttribute(new Attribute("State", "Not Available"));
} else {
instance.addAttribute(new Attribute("Factory", inst.getFactory()));
instance.addAttribute(new Attribute("Name", inst.getInstance().getInstanceName()));
String state = null;
switch(inst.getInstance().getState()) {
case ComponentInstance.DISPOSED:
state = "disposed";
break;
case ComponentInstance.STOPPED:
state = "stopped";
break;
case ComponentInstance.VALID:
state = "valid";
break;
case ComponentInstance.INVALID:
state = "invalid";
break;
default:
break;
}
instance.addAttribute(new Attribute("State", state));
// The instance description is already contained inside parent instance description.
// instance.addElement(inst.getInstance().getInstanceDescription().getDescription());
}
instances.addElement(instance);
}
return instances;
}
Aggregations