Java 类org.springframework.beans.factory.BeanCreationNotAllowedException 实例源码

项目:iotplatform    文件:PluginWebSocketHandler.java   
private void processInActorService(SessionEventPluginWebSocketMsg msg) {
    try {
        actorService.process(msg);
    } catch (BeanCreationNotAllowedException e) {
        log.warn("[{}] Failed to close session due to possible shutdown state", msg.getSessionRef().getSessionId());
    }
}
项目:thingsboard    文件:PluginWebSocketHandler.java   
private void processInActorService(SessionEventPluginWebSocketMsg msg) {
    try {
        actorService.process(msg);
    } catch (BeanCreationNotAllowedException e) {
        log.warn("[{}] Failed to close session due to possible shutdown state", msg.getSessionRef().getSessionId());
    }
}
项目:kc-rice    文件:RiceTestCase.java   
@Override
@After
   public void tearDown() throws Exception {
    // wait for outstanding threads to complete for 1 minute
    ThreadMonitor.tearDown(60000);
       try {
           stopLifecycles(this.perTestLifeCycles);
       // Avoid failing test for creation of bean in destroy.
       } catch (BeanCreationNotAllowedException bcnae) {
           LOG.warn("BeanCreationNotAllowedException during stopLifecycles during tearDown " + bcnae.getMessage());
       }
       testEnd = System.currentTimeMillis();
       report("Total time to run test: " + (testEnd - testStart));
       logAfterRun();
   }
项目:rice    文件:RiceTestCase.java   
@Override
@After
   public void tearDown() throws Exception {
    // wait for outstanding threads to complete for 1 minute
    ThreadMonitor.tearDown(60000);
       try {
           stopLifecycles(this.perTestLifeCycles);
       // Avoid failing test for creation of bean in destroy.
       } catch (BeanCreationNotAllowedException bcnae) {
           LOG.warn("BeanCreationNotAllowedException during stopLifecycles during tearDown " + bcnae.getMessage());
       }
       testEnd = System.currentTimeMillis();
       report("Total time to run test: " + (testEnd - testStart));
       logAfterRun();
   }
项目:kuali_rice    文件:RiceTestCase.java   
@Override
@After
   public void tearDown() throws Exception {
    // wait for outstanding threads to complete for 1 minute
    ThreadMonitor.tearDown(60000);
       try {
           stopLifecycles(this.perTestLifeCycles);
       // Avoid failing test for creation of bean in destroy.
       } catch (BeanCreationNotAllowedException bcnae) {
           LOG.warn("BeanCreationNotAllowedException during stopLifecycles during tearDown " + bcnae.getMessage());
       }
       logAfterRun();
   }
项目:lams    文件:DefaultSingletonBeanRegistry.java   
/**
 * Return the (raw) singleton object registered under the given name,
 * creating and registering a new one if none registered yet.
 * @param beanName the name of the bean
 * @param singletonFactory the ObjectFactory to lazily create the singleton
 * with, if necessary
 * @return the registered singleton object
 */
public Object getSingleton(String beanName, ObjectFactory<?> singletonFactory) {
    Assert.notNull(beanName, "'beanName' must not be null");
    synchronized (this.singletonObjects) {
        Object singletonObject = this.singletonObjects.get(beanName);
        if (singletonObject == null) {
            if (this.singletonsCurrentlyInDestruction) {
                throw new BeanCreationNotAllowedException(beanName,
                        "Singleton bean creation not allowed while the singletons of this factory are in destruction " +
                        "(Do not request a bean from a BeanFactory in a destroy method implementation!)");
            }
            if (logger.isDebugEnabled()) {
                logger.debug("Creating shared instance of singleton bean '" + beanName + "'");
            }
            beforeSingletonCreation(beanName);
            boolean recordSuppressedExceptions = (this.suppressedExceptions == null);
            if (recordSuppressedExceptions) {
                this.suppressedExceptions = new LinkedHashSet<Exception>();
            }
            try {
                singletonObject = singletonFactory.getObject();
            }
            catch (BeanCreationException ex) {
                if (recordSuppressedExceptions) {
                    for (Exception suppressedException : this.suppressedExceptions) {
                        ex.addRelatedCause(suppressedException);
                    }
                }
                throw ex;
            }
            finally {
                if (recordSuppressedExceptions) {
                    this.suppressedExceptions = null;
                }
                afterSingletonCreation(beanName);
            }
            addSingleton(beanName, singletonObject);
        }
        return (singletonObject != NULL_OBJECT ? singletonObject : null);
    }
}
项目:class-guard    文件:DefaultSingletonBeanRegistry.java   
/**
 * Return the (raw) singleton object registered under the given name,
 * creating and registering a new one if none registered yet.
 * @param beanName the name of the bean
 * @param singletonFactory the ObjectFactory to lazily create the singleton
 * with, if necessary
 * @return the registered singleton object
 */
public Object getSingleton(String beanName, ObjectFactory<?> singletonFactory) {
    Assert.notNull(beanName, "'beanName' must not be null");
    synchronized (this.singletonObjects) {
        Object singletonObject = this.singletonObjects.get(beanName);
        if (singletonObject == null) {
            if (this.singletonsCurrentlyInDestruction) {
                throw new BeanCreationNotAllowedException(beanName,
                        "Singleton bean creation not allowed while the singletons of this factory are in destruction " +
                        "(Do not request a bean from a BeanFactory in a destroy method implementation!)");
            }
            if (logger.isDebugEnabled()) {
                logger.debug("Creating shared instance of singleton bean '" + beanName + "'");
            }
            beforeSingletonCreation(beanName);
            boolean recordSuppressedExceptions = (this.suppressedExceptions == null);
            if (recordSuppressedExceptions) {
                this.suppressedExceptions = new LinkedHashSet<Exception>();
            }
            try {
                singletonObject = singletonFactory.getObject();
            }
            catch (BeanCreationException ex) {
                if (recordSuppressedExceptions) {
                    for (Exception suppressedException : this.suppressedExceptions) {
                        ex.addRelatedCause(suppressedException);
                    }
                }
                throw ex;
            }
            finally {
                if (recordSuppressedExceptions) {
                    this.suppressedExceptions = null;
                }
                afterSingletonCreation(beanName);
            }
            addSingleton(beanName, singletonObject);
        }
        return (singletonObject != NULL_OBJECT ? singletonObject : null);
    }
}