Hi all,

I am trying to create a new instance of my class from felix console. Hence,
I'm using Component annotation like this:

@Component(configurationFactory = true, policy =
ConfigurationPolicy.REQUIRE, metatype = true)

and this works well. I can create new instance by using Configuration tab
of felix console. Now I also want to create
new instance of my class inside my java code. Thus, I tried to use

@Component(factory = "org.apache.test.MyClassFactory")

This is also work. However, I want both of these functionalities for my
class. Therefore, I add to top of my class definition

@Component(configurationFactory = true, factory =
"org.apache.test.MyClassFactory", policy = ConfigurationPolicy.REQUIRE,
metatype = true)

and it did not work as I expected. My question is how can achieve to create
my class instances using both felix
console and java code. I cannot succeed it by using
both configurationFactory and factory. Is there any other way?

Thanks.

Reply via email to