[
http://jira.jboss.com/jira/browse/JBMICROCONT-165?page=comments#action_12... ]
Adrian Brock commented on JBMICROCONT-165:
------------------------------------------
This requires changes to the DependecyInfo to a list of InstallItems
not just DependencyItems.
The install items are not necessarily required for the service to start
but they will be updated as the services of that type come and go.
The Microcontainer controller already tracks implementing classes
for the contextual injections, so this code needs updating
to also process the InstallItems.
Add support for Install items
-----------------------------
Key: JBMICROCONT-165
URL:
http://jira.jboss.com/jira/browse/JBMICROCONT-165
Project: JBoss MicroContainer
Issue Type: Task
Components: Dependency
Reporter: Adrian Brock
Assigned To: Ales Justin
We already support contextual dependency injection
(injected based on class)
@Inject
public void setSomething(X x);
and installation into "repositories"
<bean name="Queue1">
<install bean="JMSBroker" method="addQueue"/>
</bean>
There should be additional support for more dynamic injection/installation.
In annotations the three new features are:
1) The injection is dynamic
- the service will start even if the dependency is not satisifed
- the service might get the injection later when it is available
@Inject(optional=true)
public void setSomething(X x);
2) Installation of "services" by type
- Inject all implementors of a particular class
- Keep reinjecting as implementors come and go
- The cardinality specifies the minimum number
that must exist for the service to start
@Install(cardinality=0)
public void setSomethings(Collection<X> x)
3) Like (2) but with add/remove methods
@Install(cardinality=0)
public void addSomething(X x)
@Uninstall
public void removeSomething(X x)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira