-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.core.execution.xml;\r
-\r
-import org.springframework.aop.scope.ScopedProxyUtils;\r
-import org.springframework.beans.factory.config.BeanDefinitionHolder;\r
-import org.springframework.beans.factory.parsing.BeanComponentDefinition;\r
-import org.springframework.beans.factory.xml.BeanDefinitionDecorator;\r
-import org.springframework.beans.factory.xml.ParserContext;\r
-import org.w3c.dom.Element;\r
-import org.w3c.dom.Node;\r
-\r
-/**\r
- * Inspired by org.springframework.aop.config.ScopedProxyBeanDefinitionDecorator\r
- */\r
-public class ExecutionScopeDecorator implements BeanDefinitionDecorator { \r
- private static final String PROXY_TARGET_CLASS = "proxy-target-class"; \r
- \r
- public BeanDefinitionHolder decorate(Node node,\r
- BeanDefinitionHolder definition, ParserContext parserContext) {\r
- \r
- definition.getBeanDefinition().setScope("execution");\r
- \r
- // Default: CGLib not used\r
- boolean proxyTargetClass = false;\r
- if (node instanceof Element) {\r
- Element ele = (Element) node;\r
- if (ele.hasAttribute(PROXY_TARGET_CLASS)) {\r
- proxyTargetClass = Boolean.valueOf(ele.getAttribute(PROXY_TARGET_CLASS)).booleanValue();\r
- }\r
- }\r
- \r
- // Register the original bean definition as it will be referenced by the scoped proxy and is relevant for tooling (validation, navigation).\r
- String targetBeanName = ScopedProxyUtils.getTargetBeanName(definition.getBeanName());\r
- parserContext.getReaderContext().fireComponentRegistered(new BeanComponentDefinition(definition.getBeanDefinition(), targetBeanName));\r
- \r
- return ScopedProxyUtils.createScopedProxy(definition, parserContext.getRegistry(), proxyTargetClass); \r
- }\r
-}\r
+package org.argeo.slc.core.execution.xml;
+
+import org.springframework.aop.scope.ScopedProxyUtils;
+import org.springframework.beans.factory.config.BeanDefinitionHolder;
+import org.springframework.beans.factory.parsing.BeanComponentDefinition;
+import org.springframework.beans.factory.xml.BeanDefinitionDecorator;
+import org.springframework.beans.factory.xml.ParserContext;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * Inspired by org.springframework.aop.config.ScopedProxyBeanDefinitionDecorator
+ */
+public class ExecutionScopeDecorator implements BeanDefinitionDecorator {
+ private static final String PROXY_TARGET_CLASS = "proxy-target-class";
+
+ public BeanDefinitionHolder decorate(Node node,
+ BeanDefinitionHolder definition, ParserContext parserContext) {
+
+ definition.getBeanDefinition().setScope("execution");
+
+ // Default: CGLib not used
+ boolean proxyTargetClass = false;
+ if (node instanceof Element) {
+ Element ele = (Element) node;
+ if (ele.hasAttribute(PROXY_TARGET_CLASS)) {
+ proxyTargetClass = Boolean.valueOf(ele.getAttribute(PROXY_TARGET_CLASS)).booleanValue();
+ }
+ }
+
+ // Register the original bean definition as it will be referenced by the scoped proxy and is relevant for tooling (validation, navigation).
+ String targetBeanName = ScopedProxyUtils.getTargetBeanName(definition.getBeanName());
+ parserContext.getReaderContext().fireComponentRegistered(new BeanComponentDefinition(definition.getBeanDefinition(), targetBeanName));
+
+ return ScopedProxyUtils.createScopedProxy(definition, parserContext.getRegistry(), proxyTargetClass);
+ }
+}