diff --git a/org.springframework.context.support/src/main/java/org/springframework/scheduling/quartz/LocalTaskExecutorThreadPool.java b/org.springframework.context.support/src/main/java/org/springframework/scheduling/quartz/LocalTaskExecutorThreadPool.java index bc41625baaf..54f25a4d621 100644 --- a/org.springframework.context.support/src/main/java/org/springframework/scheduling/quartz/LocalTaskExecutorThreadPool.java +++ b/org.springframework.context.support/src/main/java/org/springframework/scheduling/quartz/LocalTaskExecutorThreadPool.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 the original author or authors. + * Copyright 2002-2009 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,14 +16,14 @@ package org.springframework.scheduling.quartz; +import java.util.concurrent.Executor; +import java.util.concurrent.RejectedExecutionException; + import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.quartz.SchedulerConfigException; import org.quartz.spi.ThreadPool; -import org.springframework.core.task.TaskExecutor; -import org.springframework.core.task.TaskRejectedException; - /** * Quartz ThreadPool adapter that delegates to a Spring-managed * TaskExecutor instance, specified on SchedulerFactoryBean. @@ -37,7 +37,7 @@ public class LocalTaskExecutorThreadPool implements ThreadPool { /** Logger available to subclasses */ protected final Log logger = LogFactory.getLog(getClass()); - private TaskExecutor taskExecutor; + private Executor taskExecutor; public void initialize() throws SchedulerConfigException { @@ -66,7 +66,7 @@ public class LocalTaskExecutorThreadPool implements ThreadPool { this.taskExecutor.execute(runnable); return true; } - catch (TaskRejectedException ex) { + catch (RejectedExecutionException ex) { logger.error("Task has been rejected by TaskExecutor", ex); return false; } diff --git a/org.springframework.context.support/src/main/java/org/springframework/scheduling/quartz/SchedulerFactoryBean.java b/org.springframework.context.support/src/main/java/org/springframework/scheduling/quartz/SchedulerFactoryBean.java index 8f881981398..74b0b37dc4d 100644 --- a/org.springframework.context.support/src/main/java/org/springframework/scheduling/quartz/SchedulerFactoryBean.java +++ b/org.springframework.context.support/src/main/java/org/springframework/scheduling/quartz/SchedulerFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2009 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ package org.springframework.scheduling.quartz; import java.io.IOException; import java.util.Map; import java.util.Properties; - +import java.util.concurrent.Executor; import javax.sql.DataSource; import org.quartz.Scheduler; @@ -42,7 +42,6 @@ import org.springframework.context.Lifecycle; import org.springframework.core.io.Resource; import org.springframework.core.io.ResourceLoader; import org.springframework.core.io.support.PropertiesLoaderUtils; -import org.springframework.core.task.TaskExecutor; import org.springframework.scheduling.SchedulingException; import org.springframework.util.CollectionUtils; @@ -88,7 +87,7 @@ import org.springframework.util.CollectionUtils; * @see org.springframework.transaction.interceptor.TransactionProxyFactoryBean */ public class SchedulerFactoryBean extends SchedulerAccessor - implements FactoryBean, BeanNameAware, ApplicationContextAware, InitializingBean, DisposableBean, Lifecycle { + implements FactoryBean, BeanNameAware, ApplicationContextAware, InitializingBean, DisposableBean, Lifecycle { public static final String PROP_THREAD_COUNT = "org.quartz.threadPool.threadCount"; @@ -98,8 +97,8 @@ public class SchedulerFactoryBean extends SchedulerAccessor private static final ThreadLocal configTimeResourceLoaderHolder = new ThreadLocal(); - private static final ThreadLocal configTimeTaskExecutorHolder = - new ThreadLocal(); + private static final ThreadLocal configTimeTaskExecutorHolder = + new ThreadLocal(); private static final ThreadLocal configTimeDataSourceHolder = new ThreadLocal(); @@ -129,7 +128,7 @@ public class SchedulerFactoryBean extends SchedulerAccessor * @see #setTaskExecutor * @see LocalTaskExecutorThreadPool */ - public static TaskExecutor getConfigTimeTaskExecutor() { + public static Executor getConfigTimeTaskExecutor() { return configTimeTaskExecutorHolder.get(); } @@ -169,7 +168,7 @@ public class SchedulerFactoryBean extends SchedulerAccessor private Properties quartzProperties; - private TaskExecutor taskExecutor; + private Executor taskExecutor; private DataSource dataSource; @@ -261,7 +260,7 @@ public class SchedulerFactoryBean extends SchedulerAccessor * @see org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor * @see org.springframework.scheduling.commonj.WorkManagerTaskExecutor */ - public void setTaskExecutor(TaskExecutor taskExecutor) { + public void setTaskExecutor(Executor taskExecutor) { this.taskExecutor = taskExecutor; } @@ -416,14 +415,14 @@ public class SchedulerFactoryBean extends SchedulerAccessor //--------------------------------------------------------------------- public void afterPropertiesSet() throws Exception { - if (this.applicationContext != null && this.resourceLoader == null) { - this.resourceLoader = this.applicationContext; - } - if (this.dataSource == null && this.nonTransactionalDataSource != null) { this.dataSource = this.nonTransactionalDataSource; } + if (this.applicationContext != null && this.resourceLoader == null) { + this.resourceLoader = this.applicationContext; + } + // Create SchedulerFactory instance. SchedulerFactory schedulerFactory = (SchedulerFactory) BeanUtils.instantiateClass(this.schedulerFactoryClass); diff --git a/org.springframework.context/src/main/java/org/springframework/context/event/SimpleApplicationEventMulticaster.java b/org.springframework.context/src/main/java/org/springframework/context/event/SimpleApplicationEventMulticaster.java index a1348bdc880..31c2ec224b0 100644 --- a/org.springframework.context/src/main/java/org/springframework/context/event/SimpleApplicationEventMulticaster.java +++ b/org.springframework.context/src/main/java/org/springframework/context/event/SimpleApplicationEventMulticaster.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2009 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,10 +16,11 @@ package org.springframework.context.event; +import java.util.concurrent.Executor; + import org.springframework.context.ApplicationEvent; import org.springframework.context.ApplicationListener; import org.springframework.core.task.SyncTaskExecutor; -import org.springframework.core.task.TaskExecutor; /** * Simple implementation of the {@link ApplicationEventMulticaster} interface. @@ -41,7 +42,7 @@ import org.springframework.core.task.TaskExecutor; */ public class SimpleApplicationEventMulticaster extends AbstractApplicationEventMulticaster { - private TaskExecutor taskExecutor = new SyncTaskExecutor(); + private Executor taskExecutor = new SyncTaskExecutor(); /** @@ -56,14 +57,14 @@ public class SimpleApplicationEventMulticaster extends AbstractApplicationEventM * @see org.springframework.core.task.SimpleAsyncTaskExecutor * @see org.springframework.scheduling.timer.TimerTaskExecutor */ - public void setTaskExecutor(TaskExecutor taskExecutor) { + public void setTaskExecutor(Executor taskExecutor) { this.taskExecutor = (taskExecutor != null ? taskExecutor : new SyncTaskExecutor()); } /** * Return the current TaskExecutor for this multicaster. */ - protected TaskExecutor getTaskExecutor() { + protected Executor getTaskExecutor() { return this.taskExecutor; } diff --git a/org.springframework.context/src/main/java/org/springframework/remoting/support/SimpleHttpServerFactoryBean.java b/org.springframework.context/src/main/java/org/springframework/remoting/support/SimpleHttpServerFactoryBean.java index 3043fb600ed..8ef46c77983 100644 --- a/org.springframework.context/src/main/java/org/springframework/remoting/support/SimpleHttpServerFactoryBean.java +++ b/org.springframework.context/src/main/java/org/springframework/remoting/support/SimpleHttpServerFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2009 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,7 +33,6 @@ import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.DisposableBean; import org.springframework.beans.factory.FactoryBean; import org.springframework.beans.factory.InitializingBean; -import org.springframework.core.task.TaskExecutor; /** * {@link org.springframework.beans.factory.FactoryBean} that creates a simple @@ -114,14 +113,6 @@ public class SimpleHttpServerFactoryBean implements FactoryBean, InitializingBea this.executor = executor; } - /** - * Set the Spring TaskExecutor to use for dispatching incoming requests. - * @see com.sun.net.httpserver.HttpServer#setExecutor - */ - public void setTaskExecutor(TaskExecutor executor) { - this.executor = executor; - } - /** * Register {@link com.sun.net.httpserver.HttpHandler HttpHandlers} * for specific context paths. diff --git a/org.springframework.jms/src/main/java/org/springframework/jms/listener/DefaultMessageListenerContainer.java b/org.springframework.jms/src/main/java/org/springframework/jms/listener/DefaultMessageListenerContainer.java index 4da11960631..eeb3412e157 100644 --- a/org.springframework.jms/src/main/java/org/springframework/jms/listener/DefaultMessageListenerContainer.java +++ b/org.springframework.jms/src/main/java/org/springframework/jms/listener/DefaultMessageListenerContainer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2009 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,9 +17,8 @@ package org.springframework.jms.listener; import java.util.HashSet; -import java.util.Iterator; import java.util.Set; - +import java.util.concurrent.Executor; import javax.jms.Connection; import javax.jms.JMSException; import javax.jms.MessageConsumer; @@ -165,7 +164,7 @@ public class DefaultMessageListenerContainer extends AbstractPollingMessageListe private static final Constants constants = new Constants(DefaultMessageListenerContainer.class); - private TaskExecutor taskExecutor; + private Executor taskExecutor; private long recoveryInterval = DEFAULT_RECOVERY_INTERVAL; @@ -204,7 +203,7 @@ public class DefaultMessageListenerContainer extends AbstractPollingMessageListe * @see org.springframework.core.task.SimpleAsyncTaskExecutor * @see org.springframework.scheduling.commonj.WorkManagerTaskExecutor */ - public void setTaskExecutor(TaskExecutor taskExecutor) { + public void setTaskExecutor(Executor taskExecutor) { this.taskExecutor = taskExecutor; } diff --git a/org.springframework.jms/src/main/java/org/springframework/jms/listener/SimpleMessageListenerContainer.java b/org.springframework.jms/src/main/java/org/springframework/jms/listener/SimpleMessageListenerContainer.java index 1f9063b76cc..f6a4b926da4 100644 --- a/org.springframework.jms/src/main/java/org/springframework/jms/listener/SimpleMessageListenerContainer.java +++ b/org.springframework.jms/src/main/java/org/springframework/jms/listener/SimpleMessageListenerContainer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2009 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,9 +17,8 @@ package org.springframework.jms.listener; import java.util.HashSet; -import java.util.Iterator; import java.util.Set; - +import java.util.concurrent.Executor; import javax.jms.Connection; import javax.jms.Destination; import javax.jms.ExceptionListener; @@ -30,7 +29,6 @@ import javax.jms.MessageListener; import javax.jms.Session; import javax.jms.Topic; -import org.springframework.core.task.TaskExecutor; import org.springframework.jms.support.JmsUtils; import org.springframework.transaction.support.TransactionSynchronizationManager; import org.springframework.util.Assert; @@ -70,7 +68,7 @@ public class SimpleMessageListenerContainer extends AbstractMessageListenerConta private int concurrentConsumers = 1; - private TaskExecutor taskExecutor; + private Executor taskExecutor; private Set sessions; @@ -134,7 +132,7 @@ public class SimpleMessageListenerContainer extends AbstractMessageListenerConta * @see org.springframework.core.task.SimpleAsyncTaskExecutor * @see org.springframework.scheduling.commonj.WorkManagerTaskExecutor */ - public void setTaskExecutor(TaskExecutor taskExecutor) { + public void setTaskExecutor(Executor taskExecutor) { this.taskExecutor = taskExecutor; } diff --git a/org.springframework.jms/src/main/resources/META-INF/spring.schemas b/org.springframework.jms/src/main/resources/META-INF/spring.schemas index 42fc5f5be5f..cee622f1872 100644 --- a/org.springframework.jms/src/main/resources/META-INF/spring.schemas +++ b/org.springframework.jms/src/main/resources/META-INF/spring.schemas @@ -1,2 +1,3 @@ http\://www.springframework.org/schema/jms/spring-jms-2.5.xsd=org/springframework/jms/config/spring-jms-2.5.xsd -http\://www.springframework.org/schema/jms/spring-jms.xsd=org/springframework/jms/config/spring-jms-2.5.xsd +http\://www.springframework.org/schema/jms/spring-jms-3.0.xsd=org/springframework/jms/config/spring-jms-3.0.xsd +http\://www.springframework.org/schema/jms/spring-jms.xsd=org/springframework/jms/config/spring-jms-3.0.xsd diff --git a/org.springframework.jms/src/main/resources/org/springframework/jms/config/spring-jms-3.0.xsd b/org.springframework.jms/src/main/resources/org/springframework/jms/config/spring-jms-3.0.xsd new file mode 100644 index 00000000000..c619467d1f7 --- /dev/null +++ b/org.springframework.jms/src/main/resources/org/springframework/jms/config/spring-jms-3.0.xsd @@ -0,0 +1,442 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.springframework.web/src/main/java/org/springframework/remoting/jaxws/AbstractJaxWsServiceExporter.java b/org.springframework.web/src/main/java/org/springframework/remoting/jaxws/AbstractJaxWsServiceExporter.java index 2c2b810d752..cc62c79e3ef 100644 --- a/org.springframework.web/src/main/java/org/springframework/remoting/jaxws/AbstractJaxWsServiceExporter.java +++ b/org.springframework.web/src/main/java/org/springframework/remoting/jaxws/AbstractJaxWsServiceExporter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2009 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,7 +28,6 @@ import org.springframework.beans.factory.BeanFactoryAware; import org.springframework.beans.factory.DisposableBean; import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.ListableBeanFactory; -import org.springframework.core.task.TaskExecutor; /** * Abstract exporter for JAX-WS services, autodetecting annotated service beans @@ -74,15 +73,6 @@ public abstract class AbstractJaxWsServiceExporter implements BeanFactoryAware, this.executor = executor; } - /** - * Set the Spring TaskExecutor to use for dispatching incoming requests - * to exported service instances. - * @see javax.xml.ws.Endpoint#setExecutor - */ - public void setTaskExecutor(TaskExecutor executor) { - this.executor = executor; - } - /** * Obtains all web service beans and publishes them as JAX-WS endpoints. */ diff --git a/org.springframework.web/src/main/java/org/springframework/remoting/jaxws/LocalJaxWsServiceFactory.java b/org.springframework.web/src/main/java/org/springframework/remoting/jaxws/LocalJaxWsServiceFactory.java index 7d4df473aa6..36d5562e20f 100644 --- a/org.springframework.web/src/main/java/org/springframework/remoting/jaxws/LocalJaxWsServiceFactory.java +++ b/org.springframework.web/src/main/java/org/springframework/remoting/jaxws/LocalJaxWsServiceFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2009 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,8 +22,6 @@ import javax.xml.namespace.QName; import javax.xml.ws.Service; import javax.xml.ws.handler.HandlerResolver; -import org.springframework.core.task.TaskExecutor; - /** * Factory for locally defined JAX-WS {@link javax.xml.ws.Service} references. * Uses the JAX-WS {@link javax.xml.ws.Service#create} factory API underneath. @@ -104,15 +102,6 @@ public class LocalJaxWsServiceFactory { this.executor = executor; } - /** - * Set the Spring TaskExecutor to use for asynchronous executions - * that require callbacks. - * @see javax.xml.ws.Service#setExecutor - */ - public void setTaskExecutor(TaskExecutor executor) { - this.executor = executor; - } - /** * Set the JAX-WS HandlerResolver to use for all proxies and dispatchers * created through this factory.