Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changing scope of InstantiateObserver #278

Merged
merged 1 commit into from
Dec 11, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
* @author Guilherme Silveira
* @author Rodrigo Turini
*/
@ApplicationScoped
@RequestScoped
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only way to solve this concurrency problem is really creating an InstantiateObserver
each request? Did you try inject Container on observer method? I'm not sure, but it may work.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is that you can't have a instance of ControllerInstance, because it can be replaced by another thread between the instantiate and getControllerInstance

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure! Now that I realized that InstantiateObserver are not stateless. Ok then, 🍧

public class InstantiateObserver {

private final Container container;
Expand Down