1 Reply Latest reply on Jun 27, 2018 6:08 AM by Jakob Mayrhofer

    get instance of IOCBeanDef

    Jakob Mayrhofer Newbie

      in errai 4.2.2 there is no method getInstance() in the IOCBeanDef interface,

      but it is used in the documentation.

       

      public MyManagedBean { 
        @Inject SyncBeanManager manager; 
        public void lookupBean() {
          IOCBeanDef<SimpleBean> bean = manager.lookupBean(SimpleBean.class); 
          if (bean != null) {
            // get the instance of the bean
            SimpleBean inst = bean.getInstance();
          }
        }
      }

       

      So how to get an instance of the bean.

      kindly regards.