[ 
https://issues.apache.org/jira/browse/FELIX-3537?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13295928#comment-13295928
 ] 

Fabio Lattario Fonseca commented on FELIX-3537:
-----------------------------------------------

Hi Guilaume,

I managed to get some information for the instance by its name through the 
Architecture handler. Just configure an aggregate field injection for 
Architecture[] in the component and all architecture handlers are available. 
Though the architecture handler we can make a call to 
arch.getInstanceDescription().getComponentDescription().getFactory() and get 
the IPojoFactory for that instance. So I think if we could add a 
getComponentInstances() method like you suggested, that would be fair enough.

Analyzing the IPojoFactory, I saw there there is already a m_componentInstances 
(HashMap), that holds the instances of that factory. If I am not wrong, and 
aside some synchronization problems, it should only be a matter of adding the 
method that would return the elements of this list, right?

I'll do some tests with the code I have here to see if it works.

Regards,
Fabio
                
> Make ComponentInstance more easily accessible
> ---------------------------------------------
>
>                 Key: FELIX-3537
>                 URL: https://issues.apache.org/jira/browse/FELIX-3537
>             Project: Felix
>          Issue Type: New Feature
>          Components: iPOJO
>            Reporter: Guillaume Sauthier
>
> Currently, ComponentInstance works great with iPOJO's Factory:
> With the Factory, you can create a new ComponentInstance, and using the 
> ComponentInstance returned, you have some control over the instance 
> (start/stop/dispose/reconfigure).
> This is very nice, but the limitation is that the ComponentInstance is only 
> known within your "session" with the Factory, you cannot access it outside.
> That means, for example, that an instance created from the metadata.xml will 
> never be startable, stoppable or reconfigurable.
> So I would like to have a way to obtain ComponentInstance(s) from the iPOJO 
> API.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to