[jboss-cvs] jboss-seam/src/ioc/org/jboss/seam/ioc/spring ...
Ales Justin
ales.justin at genera-lynx.com
Sat Feb 17 04:57:44 EST 2007
User: alesj
Date: 07/02/17 04:57:44
Modified: src/ioc/org/jboss/seam/ioc/spring SeamScope.java
TestInterceptor.java SeamScopePostProcessor.java
SpringComponent.java TestAnnotation.java
SeamTargetSource.java SeamNamespaceHandler.java
Log:
Small code fixes, javadocs, imports.
Revision Changes Path
1.2 +4 -3 jboss-seam/src/ioc/org/jboss/seam/ioc/spring/SeamScope.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: SeamScope.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/ioc/org/jboss/seam/ioc/spring/SeamScope.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- SeamScope.java 17 Feb 2007 03:26:43 -0000 1.1
+++ SeamScope.java 17 Feb 2007 09:57:44 -0000 1.2
@@ -58,7 +58,7 @@
* java.lang.Runnable)
*/
public void registerDestructionCallback(String name, Runnable callback) {
- ((SpringComponent) SpringComponent.forSpringBeanName(name)).registerDestroyCallback(name, callback);
+ SpringComponent.forSpringBeanName(name).registerDestroyCallback(name, callback);
}
/**
@@ -71,8 +71,9 @@
// reason spring doesn't use the destroy callback.
log.debug("destroying: " + name);
Component component = SpringComponent.forSpringBeanName(name);
- Object bean = scope.getContext().get(component.getName());
+ Object bean = null;
if (component != null) {
+ bean = scope.getContext().get(component.getName());
if (bean != null) { // in a portal environment, this is possible
if (Events.exists())
Events.instance().raiseEvent("org.jboss.seam.preDestroy." + name);
@@ -84,8 +85,8 @@
log.warn("Could not destroy component: " + component.getName(), e);
}
}
- }
scope.getContext().remove(component.getName());
+ }
return bean;
}
}
1.2 +1 -1 jboss-seam/src/ioc/org/jboss/seam/ioc/spring/TestInterceptor.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: TestInterceptor.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/ioc/org/jboss/seam/ioc/spring/TestInterceptor.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- TestInterceptor.java 17 Feb 2007 03:26:43 -0000 1.1
+++ TestInterceptor.java 17 Feb 2007 09:57:44 -0000 1.2
@@ -1,7 +1,7 @@
/**
*
*/
-package org.jboss.seam.example.spring;
+package org.jboss.seam.ioc.spring;
import java.io.Serializable;
1.2 +2 -2 jboss-seam/src/ioc/org/jboss/seam/ioc/spring/SeamScopePostProcessor.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: SeamScopePostProcessor.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/ioc/org/jboss/seam/ioc/spring/SeamScopePostProcessor.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- SeamScopePostProcessor.java 17 Feb 2007 03:26:43 -0000 1.1
+++ SeamScopePostProcessor.java 17 Feb 2007 09:57:44 -0000 1.2
@@ -108,14 +108,14 @@
}
/**
- * @param casesensitive prefix the prefix to use to identify seam scopes for spring beans. Default is "seam."
+ * @param prefix casesensitive the prefix to use to identify seam scopes for spring beans. Default is "seam."
*/
public void setPrefix(String prefix) {
this.prefix = prefix;
}
/**
- * @param duplicate set to tell the postprocessor to duplicate any preexisting seam components that may have the same
+ * @param override set to tell the postprocessor to duplicate any preexisting seam components that may have the same
* name as the candidate spring bean. Default: false
*/
public void setOverride(boolean override) {
1.2 +4 -3 jboss-seam/src/ioc/org/jboss/seam/ioc/spring/SpringComponent.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: SpringComponent.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/ioc/org/jboss/seam/ioc/spring/SpringComponent.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- SpringComponent.java 17 Feb 2007 03:26:43 -0000 1.1
+++ SpringComponent.java 17 Feb 2007 09:57:44 -0000 1.2
@@ -106,7 +106,7 @@
* Just like Component.forName() but mocks the applicationContext and you provide it with the spring bean name
* instead of the seam component name.
*
- * @param name the spring bean name.
+ * @param springBeanName the spring bean name.
* @return the SpringComponent mapped to that spring bean name.
*/
public static SpringComponent forSpringBeanName(String springBeanName) {
@@ -133,10 +133,11 @@
* @param springBeanName the spring bean name
* @param scope component scope
* @param factory the beanfactory this spring component should use
+ * @param interception the interception type
*/
- public SpringComponent(Class clazz, String componenentName, String springBeanName, ScopeType scope,
+ public SpringComponent(Class clazz, String componentName, String springBeanName, ScopeType scope,
BeanFactory factory, InterceptionType interception) {
- super(clazz, componenentName, scope);
+ super(clazz, componentName, scope);
this.springBeanName = springBeanName;
this.beanfactory = factory;
this.interceptionType = interception;
1.2 +1 -1 jboss-seam/src/ioc/org/jboss/seam/ioc/spring/TestAnnotation.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: TestAnnotation.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/ioc/org/jboss/seam/ioc/spring/TestAnnotation.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- TestAnnotation.java 17 Feb 2007 03:26:43 -0000 1.1
+++ TestAnnotation.java 17 Feb 2007 09:57:44 -0000 1.2
@@ -1,7 +1,7 @@
/**
*
*/
-package org.jboss.seam.example.spring;
+package org.jboss.seam.ioc.spring;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
1.2 +1 -4 jboss-seam/src/ioc/org/jboss/seam/ioc/spring/SeamTargetSource.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: SeamTargetSource.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/ioc/org/jboss/seam/ioc/spring/SeamTargetSource.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- SeamTargetSource.java 17 Feb 2007 03:26:43 -0000 1.1
+++ SeamTargetSource.java 17 Feb 2007 09:57:44 -0000 1.2
@@ -6,8 +6,6 @@
import org.jboss.seam.ScopeType;
import org.jboss.seam.contexts.Contexts;
import org.jboss.seam.contexts.Lifecycle;
-import org.jboss.seam.log.LogProvider;
-import org.jboss.seam.log.Logging;
import org.springframework.aop.TargetSource;
/**
@@ -18,7 +16,6 @@
*/
@SuppressWarnings("serial")
public class SeamTargetSource implements TargetSource, Serializable {
- private static final LogProvider log = Logging.getLogProvider(SeamTargetSource.class);
private ScopeType scope;
@@ -69,7 +66,7 @@
/**
* Get the component for this TargetSource
*
- * @return
+ * @return component
*/
public Component getComponent() {
// TODO reuse
1.2 +3 -4 jboss-seam/src/ioc/org/jboss/seam/ioc/spring/SeamNamespaceHandler.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: SeamNamespaceHandler.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/ioc/org/jboss/seam/ioc/spring/SeamNamespaceHandler.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- SeamNamespaceHandler.java 17 Feb 2007 03:26:43 -0000 1.1
+++ SeamNamespaceHandler.java 17 Feb 2007 09:57:44 -0000 1.2
@@ -115,7 +115,7 @@
public BeanDefinitionHolder decorate(Node node, BeanDefinitionHolder definition, ParserContext parserContext) {
// Add the Seam Component Post Processor to the bean factory if it doesn't already exist
if (!parserContext.getRegistry().containsBeanDefinition(SEAM_COMPONENT_POST_PROCESSOR_BEAN_NAME)) {
- Class cls = null;
+ Class cls;
try {
cls = ClassUtils.forName(SEAM_COMPONENT_POST_PROCESSOR);
} catch (ClassNotFoundException e) {
@@ -124,9 +124,8 @@
}
RootBeanDefinition beanDefinition = new RootBeanDefinition(cls);
beanDefinition.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
- beanDefinition.getPropertyValues().addPropertyValue("order", new Integer(Ordered.LOWEST_PRECEDENCE));
- parserContext.getRegistry().registerBeanDefinition(SEAM_COMPONENT_POST_PROCESSOR_BEAN_NAME,
- beanDefinition);
+ beanDefinition.getPropertyValues().addPropertyValue("order", Ordered.LOWEST_PRECEDENCE);
+ parserContext.getRegistry().registerBeanDefinition(SEAM_COMPONENT_POST_PROCESSOR_BEAN_NAME, beanDefinition);
}
// get the optional beanClass
String beanClassName = definition.getBeanDefinition().getBeanClassName();
More information about the jboss-cvs-commits
mailing list