You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwebbeans.apache.org by st...@apache.org on 2010/06/09 08:32:09 UTC
svn commit: r952910 [1/3] - in
/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans:
corespi/scanner/ corespi/se/ decorator/ deployment/ el/ event/ inject/xml/
intercept/ util/ xml/
Author: struberg
Date: Wed Jun 9 06:32:08 2010
New Revision: 952910
URL: http://svn.apache.org/viewvc?rev=952910&view=rev
Log:
OWB-275 code cleanup
Modified:
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/AbstractMetaDataDiscovery.java
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/se/DefaultContextsService.java
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorUtil.java
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorsManager.java
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/deployment/StereoTypeModel.java
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/deployment/XMLStereoTypeModel.java
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/el/WrappedValueExpression.java
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/EventUtil.java
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/xml/XMLInjectionPointModel.java
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorData.java
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorDataImpl.java
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandler.java
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorRuntimeSupport.java
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/WebBeansXMLConfigurator.java
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/XMLDefinitionUtil.java
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/XMLUtil.java
Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/AbstractMetaDataDiscovery.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/AbstractMetaDataDiscovery.java?rev=952910&r1=952909&r2=952910&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/AbstractMetaDataDiscovery.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/AbstractMetaDataDiscovery.java Wed Jun 9 06:32:08 2010
@@ -25,7 +25,6 @@ import java.util.HashSet;
import java.util.Map;
import java.util.Set;
-import org.apache.webbeans.exception.WebBeansConfigurationException;
import org.apache.webbeans.exception.WebBeansDeploymentException;
import org.apache.webbeans.spi.ScannerService;
import org.apache.webbeans.util.ClassUtil;
@@ -66,7 +65,7 @@ public abstract class AbstractMetaDataDi
* Configure the Web Beans Container with deployment information and fills
* annotation database and beans.xml stream database.
*
- * @throws WebBeansConfigurationException if any run time exception occurs
+ * @throws org.apache.webbeans.exception.WebBeansConfigurationException if any run time exception occurs
*/
public void scan() throws WebBeansDeploymentException
{
Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/se/DefaultContextsService.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/se/DefaultContextsService.java?rev=952910&r1=952909&r2=952910&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/se/DefaultContextsService.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/se/DefaultContextsService.java Wed Jun 9 06:32:08 2010
@@ -175,7 +175,8 @@ public class DefaultContextsService exte
startSingletonContext(startParameter);
}
}
- }catch(Exception e)
+ }
+ catch(Exception e)
{
if(e instanceof ContextException)
{
Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorUtil.java?rev=952910&r1=952909&r2=952910&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorUtil.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorUtil.java Wed Jun 9 06:32:08 2010
@@ -84,7 +84,8 @@ public final class DecoratorUtil
ClassUtil.setInterfaceTypeHierarchy(decoratorSet, decoratorClazz);
//Per section 8.1 do no consider Serializable a decorated type
- if(decoratorSet.contains(java.io.Serializable.class)){
+ if(decoratorSet.contains(java.io.Serializable.class))
+ {
decoratorSet.remove(java.io.Serializable.class);
}
@@ -127,8 +128,8 @@ public final class DecoratorUtil
{
if (decClazz.getMethod(method.getName(), method.getParameterTypes()) != null)
{
- throw new WebBeansConfigurationException("Bean : " + bean.getReturnType().getName() + " can not define non-private, non-static, final method : " + method.getName() + ", because one of its decorators implements this method");
-
+ throw new WebBeansConfigurationException("Bean : " + bean.getReturnType().getName() + " can not define non-private, non-static, final method : "
+ + method.getName() + ", because one of its decorators implements this method");
}
}
Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorsManager.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorsManager.java?rev=952910&r1=952909&r2=952910&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorsManager.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DecoratorsManager.java Wed Jun 9 06:32:08 2010
@@ -63,7 +63,8 @@ public class DecoratorsManager
if (srcIndex == -1 || targetIndex == -1)
{
- throw new IllegalArgumentException("One of the compare class of the list : [" + src.getName() + "," + target.getName() + "]" + " is not contained in the enabled decorators list!");
+ throw new IllegalArgumentException("One of the compare class of the list : [" + src.getName() + "," + target.getName() + "]"
+ + " is not contained in the enabled decorators list!");
}
if (srcIndex == targetIndex)
Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/deployment/StereoTypeModel.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/deployment/StereoTypeModel.java?rev=952910&r1=952909&r2=952910&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/deployment/StereoTypeModel.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/deployment/StereoTypeModel.java Wed Jun 9 06:32:08 2010
@@ -149,7 +149,8 @@ public class StereoTypeModel implements
{
if (outerValue.equals(ElementType.TYPE) && outerValues.length == 1)
{
- throw new WebBeansConfigurationException("Inherited StereoType with class name : " + clazz.getName() + " must have compatible @Target annotation with Stereotype class name : " + clazz.getName());
+ throw new WebBeansConfigurationException("Inherited StereoType with class name : " + clazz.getName()
+ + " must have compatible @Target annotation with Stereotype class name : " + clazz.getName());
}
}
}
@@ -159,7 +160,8 @@ public class StereoTypeModel implements
{
if (outerValue.equals(ElementType.METHOD) || outerValue.equals(ElementType.FIELD))
{
- throw new WebBeansConfigurationException("Inherited StereoType with class name : " + clazz.getName() + " must have compatible @Target annotation with Stereotype class name : " + clazz.getName());
+ throw new WebBeansConfigurationException("Inherited StereoType with class name : " + clazz.getName()
+ + " must have compatible @Target annotation with Stereotype class name : " + clazz.getName());
}
}
}
Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/deployment/XMLStereoTypeModel.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/deployment/XMLStereoTypeModel.java?rev=952910&r1=952909&r2=952910&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/deployment/XMLStereoTypeModel.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/deployment/XMLStereoTypeModel.java Wed Jun 9 06:32:08 2010
@@ -66,23 +66,30 @@ public class XMLStereoTypeModel implemen
private void configure(Element stereoTypeDecleration, String errorMessage)
{
boolean scopeTypeFound = false;
- Node node; Element child;
+ Node node;
+ Element child;
NodeList ns = stereoTypeDecleration.getChildNodes();
+
for(int i=0; i<ns.getLength(); i++)
{
- node = ns.item(i);
- if (!(node instanceof Element)) continue;
- child = (Element)node;
+ node = ns.item(i);
+ if (!(node instanceof Element))
+ {
+ continue;
+ }
+ child = (Element)node;
Class<?> clazz = XMLUtil.getElementJavaType(child);
if (clazz == null)
{
- throw new NonexistentTypeException(errorMessage + "Type is not exist with class name : " + XMLUtil.getElementJavaClassName(child) + " in namespace : " + XMLUtil.getElementNameSpace(child) );
+ throw new NonexistentTypeException(errorMessage + "Type is not exist with class name : " + XMLUtil.getElementJavaClassName(child)
+ + " in namespace : " + XMLUtil.getElementNameSpace(child) );
}
Class<? extends Annotation> annClazz = null;
if (!clazz.isAnnotation())
{
- throw new WebBeansConfigurationException(errorMessage + "Type is not annotation type with class name : " + XMLUtil.getElementJavaClassName(child) + " in namespace : " + XMLUtil.getElementNameSpace(child));
+ throw new WebBeansConfigurationException(errorMessage + "Type is not annotation type with class name : "
+ + XMLUtil.getElementJavaClassName(child) + " in namespace : " + XMLUtil.getElementNameSpace(child));
}
annClazz = (Class<? extends Annotation>) clazz;
@@ -141,7 +148,8 @@ public class XMLStereoTypeModel implemen
{
if (outerValue.equals(ElementType.TYPE))
{
- throw new WebBeansConfigurationException(errorMessage + "Inherited StereoType with class name : " + clazz.getName() + " must have compatible @Target annotation with Stereotype class name : " + outerStereoClass.getName());
+ throw new WebBeansConfigurationException(errorMessage + "Inherited StereoType with class name : " + clazz.getName()
+ + " must have compatible @Target annotation with Stereotype class name : " + outerStereoClass.getName());
}
}
}
@@ -151,7 +159,8 @@ public class XMLStereoTypeModel implemen
{
if (outerValue.equals(ElementType.METHOD) || outerValue.equals(ElementType.FIELD))
{
- throw new WebBeansConfigurationException(errorMessage + "Inherited StereoType with class name : " + clazz.getName() + " must have compatible @Target annotation with Stereotype class name : " + outerStereoClass.getName());
+ throw new WebBeansConfigurationException(errorMessage + "Inherited StereoType with class name : " + clazz.getName()
+ + " must have compatible @Target annotation with Stereotype class name : " + outerStereoClass.getName());
}
}
}
@@ -163,7 +172,8 @@ public class XMLStereoTypeModel implemen
else
{
- throw new WebBeansConfigurationException(errorMessage + "Type with class name : " + XMLUtil.getElementJavaClassName(child) + " is not applicable for stereotype");
+ throw new WebBeansConfigurationException(errorMessage + "Type with class name : " + XMLUtil.getElementJavaClassName(child)
+ + " is not applicable for stereotype");
}
}
}
Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/el/WrappedValueExpression.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/el/WrappedValueExpression.java?rev=952910&r1=952909&r2=952910&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/el/WrappedValueExpression.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/el/WrappedValueExpression.java Wed Jun 9 06:32:08 2010
@@ -67,7 +67,8 @@ public class WrappedValueExpression exte
{
value = this.valueExpression.getValue(context);
- }finally
+ }
+ finally
{
//Destroy dependent store
ELContextStore store = ELContextStore.LOCAL_CONTEXT.get();
Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/EventUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/EventUtil.java?rev=952910&r1=952909&r2=952910&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/EventUtil.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/EventUtil.java Wed Jun 9 06:32:08 2010
@@ -97,18 +97,21 @@ public final class EventUtil
if (AnnotationUtil.hasMethodMultipleParameterAnnotation(candidateObserverMethod, Observes.class))
{
- throw new WebBeansConfigurationException("Observer method : " + candidateObserverMethod.getName() + " in class : " + clazz.getName() + " can not define two parameters with annotated @Observes");
+ throw new WebBeansConfigurationException("Observer method : " + candidateObserverMethod.getName() + " in class : " + clazz.getName()
+ + " can not define two parameters with annotated @Observes");
}
if (AnnotationUtil.hasMethodAnnotation(candidateObserverMethod, Produces.class) || AnnotationUtil.hasMethodAnnotation(candidateObserverMethod, Inject.class))
{
- throw new WebBeansConfigurationException("Observer method : " + candidateObserverMethod.getName() + " in class : " + clazz.getName() + " can not annotated with annotation in the list {@Produces, @Initializer, @Destructor}");
+ throw new WebBeansConfigurationException("Observer method : " + candidateObserverMethod.getName() + " in class : "
+ + clazz.getName() + " can not annotated with annotation in the list {@Produces, @Initializer, @Destructor}");
}
if (AnnotationUtil.hasMethodParameterAnnotation(candidateObserverMethod, Disposes.class))
{
- throw new WebBeansConfigurationException("Observer method : " + candidateObserverMethod.getName() + " in class : " + clazz.getName() + " can not annotated with annotation @Disposes");
+ throw new WebBeansConfigurationException("Observer method : " + candidateObserverMethod.getName() + " in class : "
+ + clazz.getName() + " can not annotated with annotation @Disposes");
}
}
@@ -147,7 +150,8 @@ public final class EventUtil
if (!ClassUtil.isParametrizedType(injectionPoint.getType()))
{
- throw new WebBeansConfigurationException("@Observable field injection " + injectionPoint + " must be ParametrizedType with actual type argument");
+ throw new WebBeansConfigurationException("@Observable field injection " + injectionPoint
+ + " must be ParametrizedType with actual type argument");
}
else
{
@@ -182,13 +186,15 @@ public final class EventUtil
}
else
{
- throw new IllegalArgumentException("@Observable field injection " + injectionPoint.toString() + " must not have more than one actual type argument");
+ throw new IllegalArgumentException("@Observable field injection " + injectionPoint.toString()
+ + " must not have more than one actual type argument");
}
}
}
else
{
- throw new IllegalArgumentException("@Observable field injection " + injectionPoint.toString() + " must be defined as ParameterizedType with one actual type argument");
+ throw new IllegalArgumentException("@Observable field injection " + injectionPoint.toString()
+ + " must be defined as ParameterizedType with one actual type argument");
}
}
Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/xml/XMLInjectionPointModel.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/xml/XMLInjectionPointModel.java?rev=952910&r1=952909&r2=952910&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/xml/XMLInjectionPointModel.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/inject/xml/XMLInjectionPointModel.java Wed Jun 9 06:32:08 2010
@@ -238,30 +238,48 @@ public class XMLInjectionPointModel
public boolean equals(Object obj)
{
if (this == obj)
+ {
return true;
+ }
if (obj == null)
+ {
return false;
+ }
if (getClass() != obj.getClass())
+ {
return false;
+ }
final XMLInjectionPointModel other = (XMLInjectionPointModel) obj;
if (!Arrays.equals(actualTypeArguments, other.actualTypeArguments))
+ {
return false;
+ }
if (bindingTypes == null)
{
if (other.bindingTypes != null)
+ {
return false;
+ }
}
else if (!bindingTypes.equals(other.bindingTypes))
+ {
return false;
+ }
if (injectionClassType == null)
{
if (other.injectionClassType != null)
+ {
return false;
+ }
}
else if (!injectionClassType.equals(other.injectionClassType))
+ {
return false;
+ }
if (parametrized != other.parametrized)
+ {
return false;
+ }
return true;
}
}
\ No newline at end of file
Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorData.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorData.java?rev=952910&r1=952909&r2=952910&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorData.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorData.java Wed Jun 9 06:32:08 2010
@@ -21,11 +21,7 @@ package org.apache.webbeans.intercept;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
-import javax.annotation.PostConstruct;
-import javax.annotation.PreDestroy;
import javax.enterprise.inject.spi.Interceptor;
-import javax.interceptor.AroundInvoke;
-import javax.interceptor.Interceptors;
import org.apache.webbeans.context.creational.CreationalContextImpl;
@@ -35,7 +31,7 @@ import org.apache.webbeans.context.creat
* interceptor definition in the OWB Container. These are;
* <p>
* <ul>
- * <li>EJB related interceptors with {@link Interceptors} annotation</li>
+ * <li>EJB related interceptors with {@link javax.interceptor.Interceptors} annotation</li>
* <li>WebBeans specific interceptor definition with using
* {@link javax.interceptor.InterceptorBinding} and {@link Interceptor}</li>
* </ul>
@@ -52,21 +48,21 @@ import org.apache.webbeans.context.creat
public interface InterceptorData
{
/**
- * Gets {@link PostConstruct} annotated method if exist
+ * Gets {@link javax.annotation.PostConstruct} annotated method if exist
* return null otherwise.
* @return post-construct method
*/
public Method getPostConstruct();
/**
- * Gets the {@link PreDestroy} annotated method
+ * Gets the {@link javax.annotation.PreDestroy} annotated method
* if exist, returns null otherwise.
* @return pre-destroy method
*/
public Method getPreDestroy();
/**
- * Gets {@link AroundInvoke} annotated method
+ * Gets {@link javax.interceptor.AroundInvoke} annotated method
* if exist, returns null otherwise.
* @return around invoke method
*/
@@ -85,9 +81,9 @@ public interface InterceptorData
* <p>
* Annotation is in
* <ul>
- * <li>{@link PostConstruct}</li>
- * <li>{@link PreDestroy}</li>
- * <li>{@link AroundInvoke}</li>
+ * <li>{@link javax.annotation.PostConstruct}</li>
+ * <li>{@link javax.annotation.PreDestroy}</li>
+ * <li>{@link javax.interceptor.AroundInvoke}</li>
* </ul>
* </p>
* @param interceptorMethod interceptor method
Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorDataImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorDataImpl.java?rev=952910&r1=952909&r2=952910&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorDataImpl.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorDataImpl.java Wed Jun 9 06:32:08 2010
@@ -269,20 +269,20 @@ public class InterceptorDataImpl impleme
public Method getInterceptorMethod()
{
- if(aroundInvoke != null)
+ if (aroundInvoke != null)
{
return aroundInvoke;
}
- else if(postConstruct != null)
+ else if (postConstruct != null)
{
return postConstruct;
}
- else if(preDestroy != null)
+ else if (preDestroy != null)
{
return preDestroy;
}
-
- else return null;
+
+ return null;
}
@Override
Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandler.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandler.java?rev=952910&r1=952909&r2=952910&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandler.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandler.java Wed Jun 9 06:32:08 2010
@@ -33,20 +33,14 @@ import javassist.util.proxy.MethodHandle
import javassist.util.proxy.ProxyFactory;
import javassist.util.proxy.ProxyObject;
-import org.apache.webbeans.component.AbstractOwbBean;
import org.apache.webbeans.component.InjectionTargetBean;
import org.apache.webbeans.component.OwbBean;
-import org.apache.webbeans.config.BeansDeployer;
-import org.apache.webbeans.config.DefinitionUtil;
import org.apache.webbeans.config.OWBLogConst;
import org.apache.webbeans.container.BeanManagerImpl;
import org.apache.webbeans.context.creational.CreationalContextImpl;
import org.apache.webbeans.decorator.DelegateHandler;
-import org.apache.webbeans.decorator.WebBeansDecorator;
import org.apache.webbeans.decorator.WebBeansDecoratorConfig;
import org.apache.webbeans.decorator.WebBeansDecoratorInterceptor;
-import org.apache.webbeans.intercept.ejb.EJBInterceptorConfig;
-import org.apache.webbeans.intercept.webbeans.WebBeansInterceptor;
import org.apache.webbeans.logger.WebBeansLogger;
import org.apache.webbeans.proxy.JavassistProxyFactory;
import org.apache.webbeans.util.ClassUtil;
@@ -59,11 +53,13 @@ import org.apache.webbeans.util.WebBeans
* <ul>
* <li><b>1- Configuration of decorators and interceptors</b>
* <p>
- * Decorators and Interceptors are configured from {@link BeansDeployer}
+ * Decorators and Interceptors are configured from {@link org.apache.webbeans.config.BeansDeployer}
* class via methods <code>defineManagedBean(class)</code> and Those methods further call
* <code>defineInterceptor(interceptor class)</code> and <code>defineDecorator(decorator class)</code>
- * methods. Those methods finally call {@link WebBeansUtil#defineInterceptor(Class)} and
- * {@link WebBeansUtil#defineDecorator(Class)} methods for actual configuration.
+ * methods. Those methods finally call
+ * {@link WebBeansUtil#defineInterceptor(org.apache.webbeans.component.creation.ManagedBeanCreatorImpl, javax.enterprise.inject.spi.ProcessInjectionTarget)} and
+ * {@link WebBeansUtil#defineDecorator(org.apache.webbeans.component.creation.ManagedBeanCreatorImpl, javax.enterprise.inject.spi.ProcessInjectionTarget)}
+ * methods for actual configuration.
* <p>
* Let's look at the "WebBeansUtil's" methods;
* </p>
@@ -136,9 +132,9 @@ import org.apache.webbeans.util.WebBeans
*
* @see WebBeansInterceptorConfig
* @see WebBeansDecoratorConfig
- * @see WebBeansInterceptor
- * @see WebBeansDecorator
- * @see EJBInterceptorConfig
+ * @see org.apache.webbeans.intercept.webbeans.WebBeansInterceptor
+ * @see org.apache.webbeans.decorator.WebBeansDecorator
+ * @see org.apache.webbeans.intercept.ejb.EJBInterceptorConfig
*/
public abstract class InterceptorHandler implements MethodHandler, Serializable
{
@@ -252,7 +248,8 @@ public abstract class InterceptorHandler
// Call Around Invokes
if (WebBeansUtil.isContainsInterceptorMethod(this.interceptedMethodMap.get(method), InterceptorType.AROUND_INVOKE))
{
- return callAroundInvokes(method, arguments, InterceptorUtil.getInterceptorMethods(this.interceptedMethodMap.get(method), InterceptorType.AROUND_INVOKE));
+ return callAroundInvokes(method, arguments, InterceptorUtil.getInterceptorMethods(this.interceptedMethodMap.get(method),
+ InterceptorType.AROUND_INVOKE));
}
}
@@ -275,7 +272,8 @@ public abstract class InterceptorHandler
{
result = method.invoke(instance, arguments);
- }finally
+ }
+ finally
{
SecurityUtil.doPrivilegedSetAccessible(method, access);
}
Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorRuntimeSupport.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorRuntimeSupport.java?rev=952910&r1=952909&r2=952910&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorRuntimeSupport.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorRuntimeSupport.java Wed Jun 9 06:32:08 2010
@@ -43,7 +43,7 @@ public class InterceptorRuntimeSupport {
*
* <p>This will first check if we really need to apply subclassing and
* if not will return <code>null</code> instead. We need subclassing
- * if the bean contains any {@link InterceptorType.AROUND_INVOKE}
+ * if the bean contains any {@link org.apache.webbeans.intercept.InterceptorType#AROUND_INVOKE}
* or if there are any Decoraors</p>
*
*
Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java?rev=952910&r1=952909&r2=952910&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java Wed Jun 9 06:32:08 2010
@@ -335,12 +335,16 @@ public final class WebBeansUtil
int modifier = clazz.getModifiers();
if (!ClassUtil.isStatic(modifier) && ClassUtil.isInnerClazz(clazz))
+ {
throw new WebBeansConfigurationException("Bean implementation class : "
+ clazz.getName() + " can not be non-static inner class");
+ }
if (!ClassUtil.isConcrete(clazz) && !AnnotationUtil.hasClassAnnotation(clazz, Decorator.class))
+ {
throw new WebBeansConfigurationException("Bean implementation class : " + clazz.getName()
+ " have to be concrete if not defines as @Decorator");
+ }
if (!isConstructureOk(clazz))
{
@@ -1071,10 +1075,12 @@ public final class WebBeansUtil
// Check method criterias
Class<?>[] params = ClassUtil.getMethodParameterTypes(method);
if (params.length != 1 || !params[0].equals(InvocationContext.class))
+ {
throw new WebBeansConfigurationException("@" + annot.getSimpleName() + " annotated method : "
+ method.getName() + " in class : " + clazz.getName()
+ " can not take any formal arguments other than InvocationContext");
-
+ }
+
if (!ClassUtil.getReturnType(method).equals(Object.class))
{
throw new WebBeansConfigurationException("@" + annot.getSimpleName() + " annotated method : "
@@ -1571,7 +1577,8 @@ public final class WebBeansUtil
*
* @return
*/
- protected static boolean isDirectlySpecializedBeanSet(Set<Bean<?>> beans) {
+ protected static boolean isDirectlySpecializedBeanSet(Set<Bean<?>> beans)
+ {
ArrayList<AbstractOwbBean<?>> beanList = new ArrayList<AbstractOwbBean<?>>();
@@ -1589,8 +1596,16 @@ public final class WebBeansUtil
AbstractOwbBean<?> b2 = (AbstractOwbBean<?>)o2;
Class c1 = b1.getReturnType();
Class c2 = b2.getReturnType();
- if (c2.isAssignableFrom(c1)) return 1;
- if (c1.isAssignableFrom(c2)) return -1;
+ if (c2.isAssignableFrom(c1))
+ {
+ return 1;
+ }
+
+ if (c1.isAssignableFrom(c2))
+ {
+ return -1;
+ }
+
throw new InconsistentSpecializationException(c1 + " and " + c2 + "are not assignable to each other." );
}
});
@@ -1598,7 +1613,9 @@ public final class WebBeansUtil
for(int i=0; i<beanList.size() - 1; i++)
{
if (!beanList.get(i).getReturnType().equals(beanList.get(i+1).getReturnType().getSuperclass()))
+ {
return false;
+ }
}
return true;
}
@@ -1873,19 +1890,22 @@ public final class WebBeansUtil
producerBeanListHelper.add(pb);
pLeft = (pb.isSpecializedBean()) ? pb : null;
}
- else {
+ else
+ {
pLeft = null;
}
if (pLeft != null) pLeftContinue = true;
}
//right
if (pRight != null &&
- pb.getBeanClass().getSuperclass().equals(pRight.getBeanClass()))
+ pb.getBeanClass().getSuperclass().equals(pRight.getBeanClass()))
{
if (!pb.isSpecializedBean())
{
pRight = null;
- } else {
+ }
+ else
+ {
Method superMethod = ClassUtil.getClassMethodWithTypes(pb.getBeanClass(), method.getName(),
Arrays.asList(method.getParameterTypes()));
//Added by GE, method check is necessary otherwise getting wrong method qualifier annotations
@@ -1893,12 +1913,16 @@ public final class WebBeansUtil
{
producerBeanListHelper.add(pb);
pRight = pb;
- } else
+ }
+ else
{
pRight = null;
}
}
- if (pRight != null) pRightContinue = true;
+ if (pRight != null)
+ {
+ pRightContinue = true;
+ }
}
} // for
} // while
@@ -2051,18 +2075,6 @@ public final class WebBeansUtil
+ " is not annotated with @Produces");
}
- /* To avoid multiple invocations of setBeanName(), following code is delayed to
- * configSpecializedProducerMethodBeans() when checkSpecializations.
- Annotation[] anns = AnnotationUtil.getQualifierAnnotations(superMethod.getAnnotations());
-
- for (Annotation ann : anns)
- {
- component.addQualifier(ann);
- }
-
- WebBeansUtil.configuredProducerSpecializedName(component, method, superMethod);
- */
-
component.setSpecializedBean(true);
}
@@ -2874,7 +2886,8 @@ public final class WebBeansUtil
stack.logErrors();
throw new WebBeansConfigurationException(logMessage);
}
- }finally
+ }
+ finally
{
stack.clear();
}