throws BeansException {
if (applicationContext instanceof WebApplicationContext) {
WebApplicationContext webApplicationContext = (WebApplicationContext) applicationContext;
if (ThreadPoolTaskExecutor.class == bean.getClass()) {
ThreadPoolTaskExecutor executor = (ThreadPoolTaskExecutor) bean;
String paramCorePoolSize = webApplicationContext.getServletContext()
.getInitParameter(PORTAL_EXECUTOR_CORE_POOL_SIZE);
if (StringUtils.isNotBlank(paramCorePoolSize)) {
if (logger.isInfoEnabled()) {
logger.info("found param " + PORTAL_EXECUTOR_CORE_POOL_SIZE + "="
+ paramCorePoolSize);
}
executor.setCorePoolSize(Integer.parseInt(paramCorePoolSize));
} else {
throw new IllegalArgumentException(
"please add '<context-param><param-name>portalExecutorCorePoolSize</param-name><param-value>a number here</param-value></context-param>' in your web.xml");
}
String paramMaxPoolSize = webApplicationContext.getServletContext()
.getInitParameter(PORTAL_EXECUTOR_MAX_POOL_SIZE);
if (StringUtils.isNotBlank(paramMaxPoolSize)) {
if (logger.isInfoEnabled()) {
logger.info("found param " + PORTAL_EXECUTOR_MAX_POOL_SIZE + "="
+ paramMaxPoolSize);
}
executor.setMaxPoolSize(Integer.parseInt(paramMaxPoolSize));
}
String paramKeepAliveSeconds = webApplicationContext.getServletContext()
.getInitParameter(PORTAL_EXECUTOR_KEEP_ALIVE_SECONDS);
if (StringUtils.isNotBlank(paramKeepAliveSeconds)) {
if (logger.isInfoEnabled()) {
logger.info("found param " + PORTAL_EXECUTOR_KEEP_ALIVE_SECONDS + "="
+ paramKeepAliveSeconds);
}
executor.setKeepAliveSeconds(Integer.parseInt(paramKeepAliveSeconds));
}
} else if (List.class.isInstance(bean) && "portalListenerList".equals(beanName)) {
String paramListeners = webApplicationContext.getServletContext().getInitParameter(
PORTAL_LISTENERS);
@SuppressWarnings("unchecked")