0 Replies Latest reply on Feb 18, 2011 1:40 PM by Christian L.

    Observers for specific isntances

    Christian L. Newbie

      I'm using Weld SE for a simple swing application.
      I have the problem that I cannot force CDI to call an observer method on a specific instance.
      Instead it creates a new instance and calls the observer method on this one.
      Is there any way to get the Observer method called on  a specific instance(without @Singleton)?

      public class Dialog {
        protected Details details = new Details();//no injection
        public void listen(@Observes @Gui Something event) {
          details.handle(event);//details is null as cdi uses a new instance.
      public class Other {
        Event<Something> event;
        public void doIt() {
          event.fire(new Something());