コード例 #1
0
 @Override
 public void addObserverMethod(ObserverMethod<?> observerMethod) {
   checkWithinObserverNotification();
   Preconditions.checkArgumentNotNull(observerMethod, "observerMethod");
   validateObserverMethod(observerMethod, getBeanManager(), null);
   additionalObservers.add(observerMethod);
   BootstrapLogger.LOG.addObserverMethodCalled(getReceiver(), observerMethod);
 }
コード例 #2
0
 private void processAdditionalObserver(ObserverMethod<?> observer) {
   validateObserverMethod(observer, getBeanManager(), null);
   BeanManagerImpl manager = getOrCreateBeanDeployment(observer.getBeanClass()).getBeanManager();
   if (Observers.isObserverMethodEnabled(observer, manager)) {
     ObserverMethod<?> processedObserver =
         containerLifecycleEvents.fireProcessObserverMethod(manager, observer);
     if (processedObserver != null) {
       manager.addObserver(processedObserver);
     }
   }
 }