I created an component instance using Factory like:

class MyClass {
 Factory fact;
 String foo;
 public void  createInstance(){
 Properties props = new Properties()
 props.put("instance.name","MyClassInstance")
 props.put("foo","bar")
   ComponentInstance ins = factory.createComponentInstance(props)
  //So now an instance of MyClass was created with name is MyInstance
contains a field "foo" has value "bar"
 }

}
Now i want to access MyInstance object from another class ,what can i do ?

class MyClass2{
      Fact fact;
      public void accessMyClass(){
        ComponentInstance[] instance = fact.getInstances();
        for (ComponentInstance i : instances) {
         if(i.getInstanceName.equals("MyClassInstance")){
             //How to get an object instance (MyClassInstance) from i
          }
       }

     }
}




--
View this message in context: 
http://apache-felix.18485.x6.nabble.com/Get-object-instance-from-ComponentInstance-tp5006867.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to