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,
I resolved the issue I had by programmatically call Contexts.getConversationContext().set("name", value) on Class1 before Calling to Class2.
My questions are still valid though.