/*
* Add a property to identify iPOJO factories
*/
declaration.getPropertyDefinitions().add( new PropertyDefinition(declaration.getReference(), "ipojo.factory","boolean", null));
declaration.getProperties().put("ipojo.factory","true");
declaration.getPropertyDefinitions().add( new PropertyDefinition(declaration.getReference(), "factory.name","string", null));
declaration.getProperties().put("factory.name", factory.getName());
/*
* Add the list of provided interfaces
*/
for (String providedIntereface : factory.getComponentDescription().getprovidedServiceSpecification()) {
declaration.getProvidedResources().add(new InterfaceReference(providedIntereface));
}
/*
* Add the list of factory properties
*/
for(PropertyDescription property : factory.getComponentDescription().getProperties()) {
if (property.isImmutable()) {
declaration.getPropertyDefinitions().add( new PropertyDefinition(declaration.getReference(), property.getName(),"string", null));
declaration.getProperties().put(property.getName(), property.getValue());
}
}
this.factory = factory;