@SuppressWarnings("unchecked") @Override public ScheduledExecutorService decorateExecutorService(String schedulerType, Supplier<? extends ScheduledExecutorService> actual) { ScheduledExecutorService scheduledExecutorService = actual.get(); for (BeanCreatedEventListener schedulerCreateListener : schedulerCreateListeners) { Object newBean = schedulerCreateListener.onCreated(new BeanCreatedEvent(beanContext, beanDefinition, BeanIdentifier.of("reactor-" + schedulerType), scheduledExecutorService)); if (!(newBean instanceof ScheduledExecutorService)) { throw new BeanContextException("Bean creation listener [" + schedulerCreateListener + "] should return ScheduledExecutorService, but returned " + newBean); } scheduledExecutorService = (ScheduledExecutorService) newBean; } return scheduledExecutorService; }
if (CollectionUtils.isEmpty(typeArguments) || typeArguments.get(0).getType().isAssignableFrom(beanDefinition.getBeanType())) { BeanCreatedEventListener listener = registration.getBean(); bean = (T) listener.onCreated(new BeanCreatedEvent(this, beanDefinition, beanKey, bean)); if (bean == null) { throw new BeanInstantiationException(resolutionContext, "Listener [" + listener + "] returned null from onCreated event");
if (CollectionUtils.isEmpty(typeArguments) || typeArguments.get(0).getType().isAssignableFrom(beanDefinition.getBeanType())) { BeanCreatedEventListener listener = registration.getBean(); bean = (T) listener.onCreated(new BeanCreatedEvent(this, beanDefinition, beanKey, bean)); if (bean == null) { throw new BeanInstantiationException(resolutionContext, "Listener [" + listener + "] returned null from onCreated event");