문제

I have an iPOJO Component Instance that I create like this:

  Dictionary dic = new Hashtable();
  dic.put("target-name", finalHelloInstanceName);
  ComponentInstance x= factory.createComponentInstance(dic);

Inside my component that I am instantiating above, how can I get the Dictionary "dic" values?

Could it be something like?

@Validate
    public void start() throws Exception {

        Dictionary dic= ?????

}

or is it:

@Updated
public void updated(Dictionary conf) {

    dic= conf;


}
도움이 되었습니까?

해결책

I did some experiments, and I found that, when I add the following method to my bundle:

@Updated
public void updated(Dictionary conf) {

    dic= conf;


}

this method will be invoked automatically once the component is instantiated, receiving my instance configuration. I also noticed that this method is invoked before the start() method of the bundle. Nice stuff!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top