org.springframework.beans.factory.BeanCreationNotAllowedException源码实例Demo

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

下面列出了org.springframework.beans.factory.BeanCreationNotAllowedException 类实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: 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());
    }
}
 
源代码2 项目: 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();
   }
 
源代码3 项目: blog_demos   文件: 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);
	}
}
 
如果文章对您有帮助,请点击页面广告。以鼓励作者做出的努力。
 类方法
 同包方法