[jboss-user] [JBoss Seam] - How to deal with this outjection scenario.

xigua do-not-reply at jboss.com
Wed Mar 14 13:28:47 EDT 2007


Class1 instantiates Class2 then calls a init() method on Class2.
Both Class1 and Class2 need access to an object. Ideally, Class1 will instantiate the object and outject to the coversation, the Class2 just inject it and use it. However, it doesn't seem to work and my understanding is that they are in the same request and the outjection happens at the end of invoke application phase. So my questions are:
1. When does outjection happen? (end of invoke app?)
2. If two classes outjects the same object, which order will the outjection happen so that one will overwrite the other?
3. Any suggestions on how to deal with this scenario? (Certainly I can initialize the object in class1 then pass to class2 as a parameter, however, the idea is that class1 doesn't know what class2 can do. Class1 actually might initialize multiple classes.)

Thanks in advance,
xigua

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

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



More information about the jboss-user mailing list