public void execute() { for( Statement statement : statements) { statement.execute(); BeanConfiguration bd = statement.getBeanConfiguration(); if (bd.isExecuted()) { //bean is fully configured, no more statements to execute for it: //bean configured overrides the 'eventBus' bean - replace the existing eventBus with the one configured: if (bd.getBeanName().equals(EVENT_BUS_NAME)) { EventBus eventBus = (EventBus)bd.getBean(); enableEvents(eventBus); } //ignore global 'shiro.' shortcut mechanism: if (!bd.isGlobalConfig()) { BeanEvent event = new ConfiguredBeanEvent(bd.getBeanName(), bd.getBean(), Collections.unmodifiableMap(objects)); eventBus.publish(event); } //initialize the bean if necessary: LifecycleUtils.init(bd.getBean()); //ignore global 'shiro.' shortcut mechanism: if (!bd.isGlobalConfig()) { BeanEvent event = new InitializedBeanEvent(bd.getBeanName(), bd.getBean(), Collections.unmodifiableMap(objects)); eventBus.publish(event); } } } } }
public void execute() { for( Statement statement : statements) { statement.execute(); BeanConfiguration bd = statement.getBeanConfiguration(); if (bd.isExecuted()) { //bean is fully configured, no more statements to execute for it: //bean configured overrides the 'eventBus' bean - replace the existing eventBus with the one configured: if (bd.getBeanName().equals(EVENT_BUS_NAME)) { EventBus eventBus = (EventBus)bd.getBean(); enableEvents(eventBus); } //ignore global 'shiro.' shortcut mechanism: if (!bd.isGlobalConfig()) { BeanEvent event = new ConfiguredBeanEvent(bd.getBeanName(), bd.getBean(), Collections.unmodifiableMap(objects)); eventBus.publish(event); } //initialize the bean if necessary: LifecycleUtils.init(bd.getBean()); //ignore global 'shiro.' shortcut mechanism: if (!bd.isGlobalConfig()) { BeanEvent event = new InitializedBeanEvent(bd.getBeanName(), bd.getBean(), Collections.unmodifiableMap(objects)); eventBus.publish(event); } } } } }
protected void setBean(Object bean) { this.bean = bean; if (this.beanConfiguration.getBean() == null) { this.beanConfiguration.setBean(bean); } }
protected void setBean(Object bean) { this.bean = bean; if (this.beanConfiguration.getBean() == null) { this.beanConfiguration.setBean(bean); } }