See How to use iPOJO Factories
1. Find iPOJO Component Factory reference.
----
import org.apache.felix.ipojo.Factory;
public ServiceReference getComponentFactoryReference(String factoryClassName) {
try {
ServiceReference[] refs = bundleContext.getServiceReferences(
Factory.class.getName(),
"(component.class=" + factoryClassName + ")");
if (refs == null || refs.length == 0)
return null;
return refs[0];
} catch (InvalidSyntaxException e) {
...
}
return null;
}
2. Get iPOJO Component Factory.
ServiceReference factoryReference = getComponentFactoryReference(YOUR_COMPONENT_CLASS_NAME);
Factory factory = (Factory) context.getService(factoryReference);
3. Create iPOJO Component using iPOJO Component Factory.
Properties configuration = new Properties();
// additional component configuration here..
ComponentInstance instance = factory.createComponentInstance(configuration);
instance.start();
1. Find iPOJO Component Factory reference.
----
import org.apache.felix.ipojo.Factory;
public ServiceReference getComponentFactoryReference(String factoryClassName) {
try {
ServiceReference[] refs = bundleContext.getServiceReferences(
Factory.class.getName(),
"(component.class=" + factoryClassName + ")");
if (refs == null || refs.length == 0)
return null;
return refs[0];
} catch (InvalidSyntaxException e) {
...
}
return null;
}
2. Get iPOJO Component Factory.
ServiceReference factoryReference = getComponentFactoryReference(YOUR_COMPONENT_CLASS_NAME);
Factory factory = (Factory) context.getService(factoryReference);
3. Create iPOJO Component using iPOJO Component Factory.
Properties configuration = new Properties();
// additional component configuration here..
ComponentInstance instance = factory.createComponentInstance(configuration);
instance.start();




