[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: Bean instantiate order with contextual injection

adrian@jboss.org do-not-reply at jboss.com
Mon Aug 14 09:49:30 EDT 2006


"alesj" wrote : 
  | I must probably put in a 'demand' of my property's class ... and for each context instantiation I supply all implementings classes?
  | 
  | But what if there actually are more then one such matching bean - I would probably get the one that is first instantiated injected, discarting the fact that more matching bean can occur.
  | anonymous wrote : 
  |   | 
  |   | In general that is an unsolvable problem with hot deployment.
  |   | 
  |   | You can solve it to the "first order" by requiring that any bean
  |   | with a contextual injection waits for those without to be deployed.
  |   | 
  |   | But then those beans with contextual injections may 
  |   | introduce extra matches, i.e. "second order".
  |   | 
  |   | Try to solve the "second order" problem like the first leads
  |   | to "third order" problems.
  |   | 
  |   | The best you can do (in general) is remember that a 
  |   | contextual injection was done and if another candidate 
  |   | appears after the fact then issue a warning.
  |   | 
  |   | anonymous wrote : 
  |   |   | What about @Inject meta data?
  |   |   | Where to do the inspection and add dependency items?
  |   |   | 
  |   | 
  |   | AbstractKernelController.preprocessMetaData()
  |   | is where this gets done (assuming you are talking about annotations).
  |   | However when we do classloading dependencies, some of this
  |   | will have to move to the DescribeAction such that we know
  |   | the class exists.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3964972#3964972

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3964972



More information about the jboss-dev-forums mailing list