From 067806c3167f1958aa4cbc298cf5de59480ee62f Mon Sep 17 00:00:00 2001 From: Ben Hale Date: Fri, 4 May 2007 14:16:06 +0000 Subject: [PATCH] Moved the scope support directory (SWF-163) --- .../EnableScopesBeanDefinitionParser.java | 2 +- .../scope/AbstractWebFlowScope.java | 54 +++++++++---------- .../scope/ConversationScope.java | 4 +- .../{context => config}/scope/FlashScope.java | 4 +- .../{context => config}/scope/FlowScope.java | 2 +- .../scope/ScopeRegistrar.java | 5 +- .../scope/ScopedBeanException.java | 6 +-- .../{context => config}/scope/package.html | 0 .../scope/ConversationScopeTests.java | 5 +- .../scope/FlashScopeTests.java | 2 +- .../scope/FlowScopeTests.java | 2 +- .../scope/StubObjectFactory.java | 6 +-- 12 files changed, 46 insertions(+), 46 deletions(-) rename spring-webflow/src/main/java/org/springframework/webflow/{context => config}/scope/AbstractWebFlowScope.java (78%) rename spring-webflow/src/main/java/org/springframework/webflow/{context => config}/scope/ConversationScope.java (95%) rename spring-webflow/src/main/java/org/springframework/webflow/{context => config}/scope/FlashScope.java (95%) rename spring-webflow/src/main/java/org/springframework/webflow/{context => config}/scope/FlowScope.java (95%) rename spring-webflow/src/main/java/org/springframework/webflow/{context => config}/scope/ScopeRegistrar.java (91%) rename spring-webflow/src/main/java/org/springframework/webflow/{context => config}/scope/ScopedBeanException.java (89%) rename spring-webflow/src/main/java/org/springframework/webflow/{context => config}/scope/package.html (100%) rename spring-webflow/src/test/java/org/springframework/webflow/{context => config}/scope/ConversationScopeTests.java (97%) rename spring-webflow/src/test/java/org/springframework/webflow/{context => config}/scope/FlashScopeTests.java (98%) rename spring-webflow/src/test/java/org/springframework/webflow/{context => config}/scope/FlowScopeTests.java (98%) rename spring-webflow/src/test/java/org/springframework/webflow/{context => config}/scope/StubObjectFactory.java (94%) diff --git a/spring-webflow/src/main/java/org/springframework/webflow/config/EnableScopesBeanDefinitionParser.java b/spring-webflow/src/main/java/org/springframework/webflow/config/EnableScopesBeanDefinitionParser.java index 8f7c44a4..20d926b2 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/config/EnableScopesBeanDefinitionParser.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/config/EnableScopesBeanDefinitionParser.java @@ -17,7 +17,7 @@ package org.springframework.webflow.config; import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser; import org.springframework.beans.factory.xml.BeanDefinitionParser; -import org.springframework.webflow.context.scope.ScopeRegistrar; +import org.springframework.webflow.config.scope.ScopeRegistrar; import org.w3c.dom.Element; /** diff --git a/spring-webflow/src/main/java/org/springframework/webflow/context/scope/AbstractWebFlowScope.java b/spring-webflow/src/main/java/org/springframework/webflow/config/scope/AbstractWebFlowScope.java similarity index 78% rename from spring-webflow/src/main/java/org/springframework/webflow/context/scope/AbstractWebFlowScope.java rename to spring-webflow/src/main/java/org/springframework/webflow/config/scope/AbstractWebFlowScope.java index 93d69469..3c3fb489 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/context/scope/AbstractWebFlowScope.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/config/scope/AbstractWebFlowScope.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.webflow.context.scope; +package org.springframework.webflow.config.scope; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -25,14 +25,17 @@ import org.springframework.webflow.execution.FlowExecutionContextHolder; import org.springframework.webflow.execution.RequestContext; /** - * Abstract {@link Scope} implementation that reads from a particular scope - * in the current thread-bound {@link FlowExecutionContext} object. - * - *

Subclasses simply need to implement {@link #getScope()} to instruct - * this class which {@link FlowExecutionContext} scope to read attributes from. + * Abstract {@link Scope} implementation that reads from a particular scope in + * the current thread-bound {@link FlowExecutionContext} object. * - *

Relies on a thread-bound @{link FlowExecutionContext} instance wich is located - * through a @{link FlowExecutionContextHolder}. + *

+ * Subclasses simply need to implement {@link #getScope()} to instruct this + * class which {@link FlowExecutionContext} scope to read attributes from. + * + *

+ * Relies on a thread-bound + * @{link FlowExecutionContext} instance wich is located through a + * @{link FlowExecutionContextHolder}. * * @see FlowExecutionContext * @see FlowExecutionContextHolder @@ -41,7 +44,7 @@ import org.springframework.webflow.execution.RequestContext; * @since 1.1 */ public abstract class AbstractWebFlowScope implements Scope { - + /** * Logger, usable by subclasses. */ @@ -61,41 +64,37 @@ public abstract class AbstractWebFlowScope implements Scope { MutableAttributeMap scope; try { scope = getScope(); - } - catch(IllegalStateException e) { - throw new ScopedBeanException("Cannot retrieve scoped bean '" - + name + "' before the scope has been populated"); + } catch (IllegalStateException e) { + throw new ScopedBeanException("Cannot retrieve scoped bean '" + name + + "' before the scope has been populated"); } Object scopedObject = scope.get(name); if (scopedObject == null) { - if(logger.isDebugEnabled()) { - logger.debug("Could not find existing scoped instance of '" + - name + "'; creating new instace"); + if (logger.isDebugEnabled()) { + logger.debug("Could not find existing scoped instance of '" + name + "'; creating new instace"); } scopedObject = objectFactory.getObject(); scope.put(name, scopedObject); - } - else { - if(logger.isDebugEnabled()) { + } else { + if (logger.isDebugEnabled()) { logger.debug("Found existing scoped instance of '" + name + "'"); } } return scopedObject; } - + public Object remove(String name) { try { return getScope().remove(name); - } - catch(IllegalStateException e) { - throw new ScopedBeanException("Cannot remove scoped bean '" + - name + "' before the scope has been populated"); + } catch (IllegalStateException e) { + throw new ScopedBeanException("Cannot remove scoped bean '" + name + + "' before the scope has been populated"); } } /** * Always returns null as most Spring Web Flow scopes do not - * have obvious conversation ids. Subclasses should override this method + * have obvious conversation ids. Subclasses should override this method * where conversation ids can be intelligently returned. * @return always returns null */ @@ -111,9 +110,8 @@ public abstract class AbstractWebFlowScope implements Scope { * @param callback the callback to execute */ public void registerDestructionCallback(String name, Runnable callback) { - logger.warn("Destruction callback for '" + name + - "' was not registered. Spring Web Flow does not " + - "support destruction of scoped beans."); + logger.warn("Destruction callback for '" + name + "' was not registered. Spring Web Flow does not " + + "support destruction of scoped beans."); } /** diff --git a/spring-webflow/src/main/java/org/springframework/webflow/context/scope/ConversationScope.java b/spring-webflow/src/main/java/org/springframework/webflow/config/scope/ConversationScope.java similarity index 95% rename from spring-webflow/src/main/java/org/springframework/webflow/context/scope/ConversationScope.java rename to spring-webflow/src/main/java/org/springframework/webflow/config/scope/ConversationScope.java index ad007de7..95c2684f 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/context/scope/ConversationScope.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/config/scope/ConversationScope.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.webflow.context.scope; +package org.springframework.webflow.config.scope; import org.springframework.beans.factory.config.Scope; import org.springframework.webflow.core.collection.MutableAttributeMap; @@ -21,7 +21,7 @@ import org.springframework.webflow.execution.FlowExecution; /** * Conversation-backed {@link Scope} implementation. - * + * * @see FlowExecution#getConversationScope() * * @author Ben Hale diff --git a/spring-webflow/src/main/java/org/springframework/webflow/context/scope/FlashScope.java b/spring-webflow/src/main/java/org/springframework/webflow/config/scope/FlashScope.java similarity index 95% rename from spring-webflow/src/main/java/org/springframework/webflow/context/scope/FlashScope.java rename to spring-webflow/src/main/java/org/springframework/webflow/config/scope/FlashScope.java index 0e5de611..d2c506cb 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/context/scope/FlashScope.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/config/scope/FlashScope.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.webflow.context.scope; +package org.springframework.webflow.config.scope; import org.springframework.beans.factory.config.Scope; import org.springframework.webflow.core.collection.MutableAttributeMap; @@ -21,7 +21,7 @@ import org.springframework.webflow.execution.FlowSession; /** * Flash-backed {@link Scope} implementation. - * + * * @see FlowSession#getFlashMap() * * @author Ben Hale diff --git a/spring-webflow/src/main/java/org/springframework/webflow/context/scope/FlowScope.java b/spring-webflow/src/main/java/org/springframework/webflow/config/scope/FlowScope.java similarity index 95% rename from spring-webflow/src/main/java/org/springframework/webflow/context/scope/FlowScope.java rename to spring-webflow/src/main/java/org/springframework/webflow/config/scope/FlowScope.java index 435007be..32b769b9 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/context/scope/FlowScope.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/config/scope/FlowScope.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.webflow.context.scope; +package org.springframework.webflow.config.scope; import org.springframework.beans.factory.config.Scope; import org.springframework.webflow.core.collection.MutableAttributeMap; diff --git a/spring-webflow/src/main/java/org/springframework/webflow/context/scope/ScopeRegistrar.java b/spring-webflow/src/main/java/org/springframework/webflow/config/scope/ScopeRegistrar.java similarity index 91% rename from spring-webflow/src/main/java/org/springframework/webflow/context/scope/ScopeRegistrar.java rename to spring-webflow/src/main/java/org/springframework/webflow/config/scope/ScopeRegistrar.java index f593237f..ef9a0726 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/context/scope/ScopeRegistrar.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/config/scope/ScopeRegistrar.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.webflow.context.scope; +package org.springframework.webflow.config.scope; import org.springframework.beans.BeansException; import org.springframework.beans.factory.config.BeanFactoryPostProcessor; @@ -23,7 +23,8 @@ import org.springframework.core.Ordered; import org.springframework.webflow.execution.ScopeType; /** - * Registers the Spring Web Flow bean scopes with a @{link ConfigurableListableBeanFactory}. + * Registers the Spring Web Flow bean scopes with a + * @{link ConfigurableListableBeanFactory}. * * @author Ben Hale * @see Scope diff --git a/spring-webflow/src/main/java/org/springframework/webflow/context/scope/ScopedBeanException.java b/spring-webflow/src/main/java/org/springframework/webflow/config/scope/ScopedBeanException.java similarity index 89% rename from spring-webflow/src/main/java/org/springframework/webflow/context/scope/ScopedBeanException.java rename to spring-webflow/src/main/java/org/springframework/webflow/config/scope/ScopedBeanException.java index 0199a74f..3e9cb8ad 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/context/scope/ScopedBeanException.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/config/scope/ScopedBeanException.java @@ -13,13 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.webflow.context.scope; +package org.springframework.webflow.config.scope; import org.springframework.webflow.core.FlowException; /** - * Thrown when a bean cannot be retrieved because the scope it resides in - * has not yet been populated. This might occur if the bean is being referenced + * Thrown when a bean cannot be retrieved because the scope it resides in has + * not yet been populated. This might occur if the bean is being referenced * before the FlowExecution has been retrieved. * * @author Ben Hale diff --git a/spring-webflow/src/main/java/org/springframework/webflow/context/scope/package.html b/spring-webflow/src/main/java/org/springframework/webflow/config/scope/package.html similarity index 100% rename from spring-webflow/src/main/java/org/springframework/webflow/context/scope/package.html rename to spring-webflow/src/main/java/org/springframework/webflow/config/scope/package.html diff --git a/spring-webflow/src/test/java/org/springframework/webflow/context/scope/ConversationScopeTests.java b/spring-webflow/src/test/java/org/springframework/webflow/config/scope/ConversationScopeTests.java similarity index 97% rename from spring-webflow/src/test/java/org/springframework/webflow/context/scope/ConversationScopeTests.java rename to spring-webflow/src/test/java/org/springframework/webflow/config/scope/ConversationScopeTests.java index 4e92ffbc..b4f131a1 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/context/scope/ConversationScopeTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/config/scope/ConversationScopeTests.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.webflow.context.scope; +package org.springframework.webflow.config.scope; import junit.framework.TestCase; @@ -21,7 +21,8 @@ import org.springframework.webflow.execution.FlowExecutionContextHolder; import org.springframework.webflow.test.MockFlowExecutionContext; /** - * Test cases for the @{link ConversationScope} class. + * Test cases for the + * @{link ConversationScope} class. * * @author Ben Hale */ diff --git a/spring-webflow/src/test/java/org/springframework/webflow/context/scope/FlashScopeTests.java b/spring-webflow/src/test/java/org/springframework/webflow/config/scope/FlashScopeTests.java similarity index 98% rename from spring-webflow/src/test/java/org/springframework/webflow/context/scope/FlashScopeTests.java rename to spring-webflow/src/test/java/org/springframework/webflow/config/scope/FlashScopeTests.java index cf4d6318..8bdb07f7 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/context/scope/FlashScopeTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/config/scope/FlashScopeTests.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.webflow.context.scope; +package org.springframework.webflow.config.scope; import junit.framework.TestCase; diff --git a/spring-webflow/src/test/java/org/springframework/webflow/context/scope/FlowScopeTests.java b/spring-webflow/src/test/java/org/springframework/webflow/config/scope/FlowScopeTests.java similarity index 98% rename from spring-webflow/src/test/java/org/springframework/webflow/context/scope/FlowScopeTests.java rename to spring-webflow/src/test/java/org/springframework/webflow/config/scope/FlowScopeTests.java index 77ceb8a1..6fdb8405 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/context/scope/FlowScopeTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/config/scope/FlowScopeTests.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.webflow.context.scope; +package org.springframework.webflow.config.scope; import junit.framework.TestCase; diff --git a/spring-webflow/src/test/java/org/springframework/webflow/context/scope/StubObjectFactory.java b/spring-webflow/src/test/java/org/springframework/webflow/config/scope/StubObjectFactory.java similarity index 94% rename from spring-webflow/src/test/java/org/springframework/webflow/context/scope/StubObjectFactory.java rename to spring-webflow/src/test/java/org/springframework/webflow/config/scope/StubObjectFactory.java index e1926fe2..a091ce0c 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/context/scope/StubObjectFactory.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/config/scope/StubObjectFactory.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.webflow.context.scope; +package org.springframework.webflow.config.scope; import org.springframework.beans.BeansException; import org.springframework.beans.factory.ObjectFactory; @@ -24,13 +24,13 @@ import org.springframework.beans.factory.ObjectFactory; * @author Ben Hale */ public class StubObjectFactory implements ObjectFactory { - + private Object value = new Object(); public Object getObject() throws BeansException { return value; } - + public Object getValue() { return value; }