You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwebbeans.apache.org by ge...@apache.org on 2009/11/16 06:43:50 UTC
svn commit: r880594 - in /incubator/openwebbeans/trunk/webbeans-impl/src:
main/java/org/apache/webbeans/component/
main/java/org/apache/webbeans/component/creation/
main/java/org/apache/webbeans/config/
main/java/org/apache/webbeans/decorator/ main/jav...
Author: gerdogdu
Date: Mon Nov 16 05:43:46 2009
New Revision: 880594
URL: http://svn.apache.org/viewvc?rev=880594&view=rev
Log:
[OWB-166] Interceptor bindings, that are defined on stereotypes are not applied to beans.
Added:
incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/annotation/
incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/annotation/LoggingStereoType.java (with props)
incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/annotation/SecureStereoType.java (with props)
incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/common/
incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/common/WithInheritedBindingTypeBean.java (with props)
incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/common/WithInheritedStereoTypeInterceptorBean.java (with props)
incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/common/WithStereoTypeInterceptorBean.java (with props)
incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/tests/
incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/tests/WithInheritedBindingTypeTest.java (with props)
incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/tests/WithInheritedStereoTypeInterceptorTest.java (with props)
incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/tests/WithStereoTypeInterceptorTest.java (with props)
incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/common/
incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/common/SecureInterceptor.java (with props)
incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/common/TransactionInterceptor.java (with props)
incubator/openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/newtests/interceptors/business/
incubator/openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/newtests/interceptors/business/tests/
incubator/openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/newtests/interceptors/business/tests/WithInheritedBindingTypeTest.xml (with props)
incubator/openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/newtests/interceptors/business/tests/WithInheritedStereoTypeInterceptorTest.xml (with props)
incubator/openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/newtests/interceptors/business/tests/WithStereoTypeInterceptorTest.xml (with props)
Modified:
incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractBean.java
incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractInjectionTargetBean.java
incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BaseBean.java
incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ManagedBeanCreator.java
incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ManagedBeanCreatorImpl.java
incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java
incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecoratorConfig.java
incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandler.java
incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/WebBeansInterceptorConfig.java
incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/AnnotationUtil.java
incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/common/TestContext.java
incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/decorator/DecoratorExceptionTest.java
incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/decorator/DecoratorTest1.java
incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/CallingBusinessInConstructorTest.java
incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/SecureAndTransactionalInterceptorTest.java
incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/SecureInterceptorComponentTest.java
incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/ShoppingCardInterceptorTest.java
incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/WebBeansInterceptComponentTest.java
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractBean.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractBean.java?rev=880594&r1=880593&r2=880594&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractBean.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractBean.java Mon Nov 16 05:43:46 2009
@@ -25,6 +25,7 @@
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.CreationException;
import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.Decorator;
import javax.enterprise.inject.spi.InjectionPoint;
import org.apache.webbeans.config.inheritance.BeanInheritedMetaData;
@@ -87,8 +88,8 @@
*/
protected List<InterceptorData> interceptorStack = new ArrayList<InterceptorData>();
- /** Holds decorator stack */
- protected List<Object> decoratorStack = new ArrayList<Object>();
+ /**Decorators*/
+ protected List<Decorator<?>> decorators = new ArrayList<Decorator<?>>();
/** The bean is serializable or not */
protected boolean serializable;
@@ -204,10 +205,6 @@
//Destroy instance, call @PreDestroy
destroyInstance(instance);
- //Clear Decorator and Interceptor Stack
- this.decoratorStack.clear();
- this.interceptorStack.clear();
-
//Reset it
this.dependentOwnerInjectionPoint = null;
@@ -460,14 +457,6 @@
{
return this.interceptorStack;
}
-
- /**
- * {@inheritDoc}
- */
- public List<Object> getDecoratorStack()
- {
- return this.decoratorStack;
- }
/**
* {@inheritDoc}
@@ -628,6 +617,12 @@
return this.enabled;
}
+
+ public List<Decorator<?>> getDecorators()
+ {
+ return this.decorators;
+ }
+
/**
* {@inheritDoc}
*/
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractInjectionTargetBean.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractInjectionTargetBean.java?rev=880594&r1=880593&r2=880594&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractInjectionTargetBean.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractInjectionTargetBean.java Mon Nov 16 05:43:46 2009
@@ -23,11 +23,11 @@
import javax.enterprise.inject.spi.InjectionPoint;
import javax.enterprise.inject.spi.InjectionTarget;
-import org.apache.webbeans.config.DefinitionUtil;
import org.apache.webbeans.context.creational.CreationalContextImpl;
import org.apache.webbeans.exception.WebBeansException;
import org.apache.webbeans.inject.InjectableField;
import org.apache.webbeans.inject.InjectableMethods;
+import org.apache.webbeans.intercept.InterceptorHandler;
import org.apache.webbeans.intercept.InterceptorType;
import org.apache.webbeans.intercept.InvocationContextImpl;
import org.apache.webbeans.logger.WebBeansLogger;
@@ -197,14 +197,8 @@
// Inject methods
injectMethods(instance, creationalContext);
-
- // Interceptor and decorator stack
- if (getWebBeansType().equals(WebBeansType.MANAGED))
- {
- DefinitionUtil.defineBeanInterceptorStack(this);
- DefinitionUtil.defineBeanDecoratorStack(this, instance);
- }
-
+
+ //Post construct
postConstruct(instance);
}
@@ -242,6 +236,8 @@
// Call Post Construct
if (WebBeansUtil.isContainsInterceptorMethod(getInterceptorStack(), InterceptorType.POST_CONSTRUCT))
{
+ InterceptorHandler.injectInterceptorFields(getInterceptorStack());
+
InvocationContextImpl impl = new InvocationContextImpl(null, instance, null, null, WebBeansUtil.getInterceptorMethods(getInterceptorStack(), InterceptorType.POST_CONSTRUCT), InterceptorType.POST_CONSTRUCT);
try
{
@@ -283,6 +279,8 @@
{
if (WebBeansUtil.isContainsInterceptorMethod(getInterceptorStack(), InterceptorType.PRE_DESTROY))
{
+ InterceptorHandler.injectInterceptorFields(getInterceptorStack());
+
InvocationContextImpl impl = new InvocationContextImpl(null, instance, null, null, WebBeansUtil.getInterceptorMethods(getInterceptorStack(), InterceptorType.PRE_DESTROY), InterceptorType.PRE_DESTROY);
try
{
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BaseBean.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BaseBean.java?rev=880594&r1=880593&r2=880594&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BaseBean.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BaseBean.java Mon Nov 16 05:43:46 2009
@@ -21,6 +21,7 @@
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.BeanManager;
+import javax.enterprise.inject.spi.Decorator;
import javax.enterprise.inject.spi.InjectionPoint;
import org.apache.webbeans.config.inheritance.IBeanInheritedMetaData;
@@ -190,7 +191,7 @@
* Gets decorator stack of bean instance.
* @return decorator stack
*/
- public abstract List<Object> getDecoratorStack();
+ public abstract List<Decorator<?>> getDecorators();
/**
* Sets serializable flag.
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ManagedBeanCreator.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ManagedBeanCreator.java?rev=880594&r1=880593&r2=880594&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ManagedBeanCreator.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ManagedBeanCreator.java Mon Nov 16 05:43:46 2009
@@ -29,4 +29,8 @@
*/
public void defineConstructor();
+ public void defineInterceptorStack();
+
+ public void defineDecoratorStack();
+
}
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ManagedBeanCreatorImpl.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ManagedBeanCreatorImpl.java?rev=880594&r1=880593&r2=880594&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ManagedBeanCreatorImpl.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/ManagedBeanCreatorImpl.java Mon Nov 16 05:43:46 2009
@@ -16,8 +16,10 @@
import java.lang.reflect.Constructor;
import org.apache.webbeans.component.ManagedBean;
+import org.apache.webbeans.component.WebBeansType;
import org.apache.webbeans.config.DefinitionUtil;
import org.apache.webbeans.config.ManagedBeanConfigurator;
+import org.apache.webbeans.decorator.WebBeansDecoratorConfig;
import org.apache.webbeans.util.WebBeansUtil;
/**
@@ -78,4 +80,24 @@
{
return (ManagedBean<T>)super.getBean();
}
+
+
+ @Override
+ public void defineDecoratorStack()
+ {
+ if(getBean().getWebBeansType().equals(WebBeansType.MANAGED))
+ {
+ WebBeansDecoratorConfig.configureDecarotors(getBean());
+ }
+ }
+
+
+ @Override
+ public void defineInterceptorStack()
+ {
+ if(getBean().getWebBeansType().equals(WebBeansType.MANAGED))
+ {
+ DefinitionUtil.defineBeanInterceptorStack(getBean());
+ }
+ }
}
\ No newline at end of file
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java?rev=880594&r1=880593&r2=880594&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java Mon Nov 16 05:43:46 2009
@@ -656,6 +656,8 @@
Set<ProducerFieldBean<?>> producerFields = managedBeanCreator.defineProducerFields();
managedBeanCreator.defineInjectedFields();
managedBeanCreator.defineInjectedMethods();
+ managedBeanCreator.defineDecoratorStack();
+ managedBeanCreator.defineInterceptorStack();
Set<ObserverMethod<?>> observerMethods = managedBeanCreator.defineObserverMethods();
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java?rev=880594&r1=880593&r2=880594&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java Mon Nov 16 05:43:46 2009
@@ -61,7 +61,6 @@
import org.apache.webbeans.component.ProducerMethodBean;
import org.apache.webbeans.config.inheritance.IBeanInheritedMetaData;
import org.apache.webbeans.container.InjectionResolver;
-import org.apache.webbeans.decorator.WebBeansDecoratorConfig;
import org.apache.webbeans.deployment.DeploymentTypeManager;
import org.apache.webbeans.event.EventUtil;
import org.apache.webbeans.event.NotificationManager;
@@ -1052,17 +1051,6 @@
WebBeansInterceptorConfig.configure(bean, bean.getInterceptorStack());
}
- /**
- * Configure bean instance decorator stack.
- * @param bean bean
- * @param object actual instantiated bean instance
- */
- public static void defineBeanDecoratorStack(AbstractBean<?> bean, Object object)
- {
- Asserts.assertNotNull(bean, "bean parameter can no be null");
-
- WebBeansDecoratorConfig.configureDecarotors(bean, object);
- }
public static <T> Set<ObserverMethod<?>> defineObserverMethods(InjectionTargetBean<T> component, Class<T> clazz)
{
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecoratorConfig.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecoratorConfig.java?rev=880594&r1=880593&r2=880594&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecoratorConfig.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/WebBeansDecoratorConfig.java Mon Nov 16 05:43:46 2009
@@ -62,7 +62,7 @@
BeanManagerImpl.getManager().addDecorator(decorator);
}
- public static void configureDecarotors(AbstractBean<?> component, Object instance)
+ public static void configureDecarotors(AbstractBean<?> component)
{
Set<Annotation> qualifiers = component.getQualifiers();
Annotation[] anns = new Annotation[qualifiers.size()];
@@ -73,15 +73,30 @@
while (itList.hasNext())
{
- WebBeansDecorator<?> decorator = (WebBeansDecorator<?>) itList.next();
+ WebBeansDecorator<?> decorator = (WebBeansDecorator<?>) itList.next();
+ component.getDecorators().add(decorator);
+ }
+ }
+
+ public static List<Object> getDecoratorStack(AbstractBean<?> component, Object instance)
+ {
+ List<Object> decoratorStack = new ArrayList<Object>();
+ List<Decorator<?>> decoratorList = component.getDecorators();
+ Iterator<Decorator<?>> itList = decoratorList.iterator();
+ while (itList.hasNext())
+ {
+ WebBeansDecorator<?> decorator = (WebBeansDecorator<?>) itList.next();
+
Object decoratorInstance = BeanManagerImpl.getManager().getInstance(decorator);
decorator.setInjections(decoratorInstance);
decorator.setDelegate(decoratorInstance, instance);
-
- component.getDecoratorStack().add(decoratorInstance);
+
+ decoratorStack.add(decoratorInstance);
}
+
+ return decoratorStack;
}
private static Set<Decorator<?>> getWebBeansDecorators()
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandler.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandler.java?rev=880594&r1=880593&r2=880594&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandler.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandler.java Mon Nov 16 05:43:46 2009
@@ -34,6 +34,7 @@
import org.apache.webbeans.container.BeanManagerImpl;
import org.apache.webbeans.decorator.WebBeansDecorator;
import org.apache.webbeans.decorator.WebBeansDecoratorConfig;
+import org.apache.webbeans.exception.WebBeansConfigurationException;
import org.apache.webbeans.exception.WebBeansException;
import org.apache.webbeans.intercept.ejb.EJBInterceptorConfig;
import org.apache.webbeans.intercept.webbeans.WebBeansInterceptor;
@@ -168,7 +169,7 @@
checkDecoratorStackForSameDecorator(method);
//Gets component decorator stack
- List<Object> decorators = component.getDecoratorStack();
+ List<Object> decorators = WebBeansDecoratorConfig.getDecoratorStack(component, webbeansInstance);
// Run around invoke chain
List<InterceptorData> stack = component.getInterceptorStack();
@@ -181,7 +182,7 @@
//Call Around Invokes
if (WebBeansUtil.isContainsInterceptorMethod(temp, InterceptorType.AROUND_INVOKE))
{
- result = callAroundInvokes(method, arguments, WebBeansUtil.getInterceptorMethods(stack, InterceptorType.AROUND_INVOKE));
+ result = callAroundInvokes(method, arguments, WebBeansUtil.getInterceptorMethods(temp, InterceptorType.AROUND_INVOKE));
interceptorRun = true;
}
@@ -366,8 +367,46 @@
{
it.remove();
}
+ }
+
+ injectInterceptorFields(stack);
+ }
+
+
+ public static void injectInterceptorFields(final List<InterceptorData> stack)
+ {
+ Iterator<InterceptorData> it = stack.iterator();
+ while (it.hasNext())
+ {
+ InterceptorData intData = it.next();
+
+ if (intData.isDefinedInInterceptorClass())
+ {
+ try
+ {
+ if (intData.isDefinedWithWebBeansInterceptor())
+ {
+ Object interceptorProxy = BeanManagerImpl.getManager().getInstance(intData.getWebBeansInterceptor());
+ WebBeansInterceptor<?> interceptor = (WebBeansInterceptor<?>) intData.getWebBeansInterceptor();
+ interceptor.setInjections(interceptorProxy);
+
+ //Setting interceptor proxy instance
+ intData.setInterceptorInstance(interceptorProxy);
+ }
+ }
+ catch (WebBeansConfigurationException e1)
+ {
+ throw e1;
+ }
+ catch (Exception e)
+ {
+ throw new WebBeansException(e);
+ }
+ }
+
}
+
}
}
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/WebBeansInterceptorConfig.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/WebBeansInterceptorConfig.java?rev=880594&r1=880593&r2=880594&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/WebBeansInterceptorConfig.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/WebBeansInterceptorConfig.java Mon Nov 16 05:43:46 2009
@@ -87,52 +87,57 @@
{
Class<?> clazz = component.getReturnType();
Set<Interceptor<?>> componentInterceptors = null;
+
+ Set<Annotation> bindingTypeSet = new HashSet<Annotation>();
+ Annotation[] anns = new Annotation[0];
if (AnnotationUtil.hasInterceptorBindingMetaAnnotation(clazz.getDeclaredAnnotations()))
{
-
- Set<Annotation> bindingTypeSet = new HashSet<Annotation>();
-
- Annotation[] anns = AnnotationUtil.getInterceptorBindingMetaAnnotations(clazz.getDeclaredAnnotations());
+ anns = AnnotationUtil.getInterceptorBindingMetaAnnotations(clazz.getDeclaredAnnotations());
for (Annotation ann : anns)
{
bindingTypeSet.add(ann);
}
-
- Annotation[] stereoTypes = AnnotationUtil.getStereotypeMetaAnnotations(clazz.getDeclaredAnnotations());
- for (Annotation stero : stereoTypes)
+ }
+
+ //check for stereotypes
+ Annotation[] stereoTypes = AnnotationUtil.getStereotypeMetaAnnotations(clazz.getDeclaredAnnotations());
+ for (Annotation stero : stereoTypes)
+ {
+ if (AnnotationUtil.hasInterceptorBindingMetaAnnotation(stero.annotationType().getDeclaredAnnotations()))
{
- if (AnnotationUtil.hasInterceptorBindingMetaAnnotation(stero.annotationType().getDeclaredAnnotations()))
- {
- Annotation[] steroInterceptorBindings = AnnotationUtil.getInterceptorBindingMetaAnnotations(stero.annotationType().getDeclaredAnnotations());
+ Annotation[] steroInterceptorBindings = AnnotationUtil.getInterceptorBindingMetaAnnotations(stero.annotationType().getDeclaredAnnotations());
- for (Annotation ann : steroInterceptorBindings)
- {
- bindingTypeSet.add(ann);
- }
+ for (Annotation ann : steroInterceptorBindings)
+ {
+ bindingTypeSet.add(ann);
}
}
-
- //Look for inherited binding types
- IBeanInheritedMetaData metadata = component.getInheritedMetaData();
- if(metadata != null)
+ }
+
+ //Look for inherited binding types
+ IBeanInheritedMetaData metadata = component.getInheritedMetaData();
+ if(metadata != null)
+ {
+ Set<Annotation> inheritedBindingTypes = metadata.getInheritedInterceptorBindings();
+ if(!inheritedBindingTypes.isEmpty())
{
- Set<Annotation> inheritedBindingTypes = metadata.getInheritedInterceptorBindings();
- if(!inheritedBindingTypes.isEmpty())
- {
- bindingTypeSet.addAll(inheritedBindingTypes);
- }
+ bindingTypeSet.addAll(inheritedBindingTypes);
}
+ }
- anns = new Annotation[bindingTypeSet.size()];
- anns = bindingTypeSet.toArray(anns);
-
+ anns = new Annotation[bindingTypeSet.size()];
+ anns = bindingTypeSet.toArray(anns);
+
+ if(anns.length > 0)
+ {
componentInterceptors = findDeployedWebBeansInterceptor(anns);
// Adding class interceptors
- addComponentInterceptors(componentInterceptors, stack);
+ addComponentInterceptors(componentInterceptors, stack);
}
+
// Method level interceptors.
addMethodInterceptors(clazz, stack, componentInterceptors);
@@ -158,6 +163,7 @@
private static void addMethodInterceptors(Class<?> clazz, List<InterceptorData> stack, Set<Interceptor<?>> componentInterceptors)
{
Method[] methods = clazz.getDeclaredMethods();
+ Set<Annotation> set = new HashSet<Annotation>();
for (Method method : methods)
{
@@ -166,8 +172,6 @@
Annotation[] anns = AnnotationUtil.getInterceptorBindingMetaAnnotations(method.getDeclaredAnnotations());
Annotation[] annsClazz = AnnotationUtil.getInterceptorBindingMetaAnnotations(clazz.getDeclaredAnnotations());
- Set<Annotation> set = new HashSet<Annotation>();
-
for (Annotation ann : anns)
{
set.add(ann);
@@ -177,42 +181,41 @@
{
set.add(ann);
}
+ }
- Annotation[] stereoTypes = AnnotationUtil.getStereotypeMetaAnnotations(clazz.getDeclaredAnnotations());
- for (Annotation stero : stereoTypes)
+ Annotation[] stereoTypes = AnnotationUtil.getStereotypeMetaAnnotations(clazz.getDeclaredAnnotations());
+ for (Annotation stero : stereoTypes)
+ {
+ if (AnnotationUtil.hasInterceptorBindingMetaAnnotation(stero.annotationType().getDeclaredAnnotations()))
{
- if (AnnotationUtil.hasInterceptorBindingMetaAnnotation(stero.annotationType().getDeclaredAnnotations()))
- {
- Annotation[] steroInterceptorBindings = AnnotationUtil.getInterceptorBindingMetaAnnotations(stero.annotationType().getDeclaredAnnotations());
+ Annotation[] steroInterceptorBindings = AnnotationUtil.getInterceptorBindingMetaAnnotations(stero.annotationType().getDeclaredAnnotations());
- for (Annotation ann : steroInterceptorBindings)
- {
- set.add(ann);
- }
+ for (Annotation ann : steroInterceptorBindings)
+ {
+ set.add(ann);
}
}
+ }
- Annotation[] result = new Annotation[set.size()];
- result = set.toArray(result);
-
- Set<Interceptor<?>> setInterceptors = findDeployedWebBeansInterceptor(result);
-
- if(componentInterceptors != null)
- {
- setInterceptors.removeAll(componentInterceptors);
- }
+ Annotation[] result = new Annotation[set.size()];
+ result = set.toArray(result);
- Iterator<Interceptor<?>> it = setInterceptors.iterator();
+ Set<Interceptor<?>> setInterceptors = findDeployedWebBeansInterceptor(result);
+
+ if(componentInterceptors != null)
+ {
+ setInterceptors.removeAll(componentInterceptors);
+ }
- while (it.hasNext())
- {
- WebBeansInterceptor<?> interceptor = (WebBeansInterceptor<?>) it.next();
+ Iterator<Interceptor<?>> it = setInterceptors.iterator();
- WebBeansUtil.configureInterceptorMethods(interceptor, interceptor.getClazz(), AroundInvoke.class, true, true, stack, method, true);
- WebBeansUtil.configureInterceptorMethods(interceptor, interceptor.getClazz(), PostConstruct.class, true, true, stack, method, true);
- WebBeansUtil.configureInterceptorMethods(interceptor, interceptor.getClazz(), PreDestroy.class, true, true, stack, method, true);
- }
+ while (it.hasNext())
+ {
+ WebBeansInterceptor<?> interceptor = (WebBeansInterceptor<?>) it.next();
+ WebBeansUtil.configureInterceptorMethods(interceptor, interceptor.getClazz(), AroundInvoke.class, true, true, stack, method, true);
+ WebBeansUtil.configureInterceptorMethods(interceptor, interceptor.getClazz(), PostConstruct.class, true, true, stack, method, true);
+ WebBeansUtil.configureInterceptorMethods(interceptor, interceptor.getClazz(), PreDestroy.class, true, true, stack, method, true);
}
}
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/AnnotationUtil.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/AnnotationUtil.java?rev=880594&r1=880593&r2=880594&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/AnnotationUtil.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/AnnotationUtil.java Mon Nov 16 05:43:46 2009
@@ -938,6 +938,15 @@
if (isInterceptorBindingAnnotation(ann.annotationType()))
{
interAnns.add(ann);
+
+ //check for transitive
+ Annotation[] transitives = getTransitiveInterceptorBindings(ann.annotationType().getDeclaredAnnotations());
+
+ for(Annotation transitive : transitives)
+ {
+ interAnns.add(transitive);
+ }
+
}
}
@@ -946,7 +955,12 @@
return ret;
}
-
+
+ private static Annotation[] getTransitiveInterceptorBindings(Annotation[] anns)
+ {
+ return getInterceptorBindingMetaAnnotations(anns);
+ }
+
public static Annotation[] getStereotypeMetaAnnotations(Annotation[] anns)
{
Asserts.assertNotNull(anns, "anns parameter can not be null");
@@ -957,6 +971,14 @@
if (isStereoTypeAnnotation(ann.annotationType()))
{
interAnns.add(ann);
+
+ //check for transitive
+ Annotation[] transitives = getTransitiveStereoTypes(ann.annotationType().getDeclaredAnnotations());
+
+ for(Annotation transitive : transitives)
+ {
+ interAnns.add(transitive);
+ }
}
}
@@ -965,6 +987,12 @@
return ret;
}
+
+ private static Annotation[] getTransitiveStereoTypes(Annotation[] anns)
+ {
+ return getStereotypeMetaAnnotations(anns);
+ }
+
public static boolean hasStereoTypeMetaAnnotation(Annotation[] anns)
{
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java?rev=880594&r1=880593&r2=880594&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java Mon Nov 16 05:43:46 2009
@@ -118,7 +118,6 @@
import org.apache.webbeans.intercept.InterceptorUtil;
import org.apache.webbeans.intercept.InterceptorsManager;
import org.apache.webbeans.intercept.WebBeansInterceptorConfig;
-import org.apache.webbeans.intercept.webbeans.WebBeansInterceptor;
import org.apache.webbeans.plugins.OpenWebBeansPlugin;
import org.apache.webbeans.plugins.PluginLoader;
import org.apache.webbeans.portable.AnnotatedElementFactory;
@@ -971,16 +970,7 @@
{
try
{
- if (isDefinedWithWebBeans)
- {
- Object interceptorProxy = BeanManagerImpl.getManager().getInstance(webBeansInterceptor);
- WebBeansInterceptor<?> interceptor = (WebBeansInterceptor<?>) webBeansInterceptor;
- interceptor.setInjections(interceptorProxy);
-
- //Setting interceptor proxy instance
- intData.setInterceptorInstance(interceptorProxy);
- }
- else
+ if (!isDefinedWithWebBeans)
{
if (ClassUtil.isContaintNoArgConstructor(clazz) == null)
{
@@ -989,7 +979,6 @@
intData.setInterceptorInstance(clazz.newInstance());
}
-
}
catch (WebBeansConfigurationException e1)
{
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/common/TestContext.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/common/TestContext.java?rev=880594&r1=880593&r2=880594&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/common/TestContext.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/common/TestContext.java Mon Nov 16 05:43:46 2009
@@ -40,6 +40,7 @@
import org.apache.webbeans.component.ManagedBean;
import org.apache.webbeans.component.WebBeansType;
import org.apache.webbeans.component.xml.XMLManagedBean;
+import org.apache.webbeans.config.DefinitionUtil;
import org.apache.webbeans.config.ManagedBeanConfigurator;
import org.apache.webbeans.context.ContextFactory;
import org.apache.webbeans.context.DependentContext;
@@ -317,7 +318,8 @@
{
manager.addBean(WebBeansUtil.createNewBean(bean));
DecoratorUtil.checkManagedBeanDecoratorConditions(bean);
- // DefinitionUtil.defineSimpleWebBeanInterceptorStack(bean);
+ WebBeansDecoratorConfig.configureDecarotors(bean);
+ DefinitionUtil.defineBeanInterceptorStack(bean);
getComponents().add((AbstractBean<?>) bean);
manager.addBean(bean);
@@ -415,7 +417,7 @@
* @return the new interceptor
*/
@SuppressWarnings("unchecked")
- protected <T> AbstractBean<T> defineSimpleWebBeanInterceptor(Class<T> clazz)
+ protected <T> AbstractBean<T> defineInterceptor(Class<T> clazz)
{
ManagedBean<T> component = null;
@@ -442,7 +444,7 @@
* @return the new decorator
*/
@SuppressWarnings("unchecked")
- protected <T> AbstractBean<T> defineSimpleWebBeansDecorators(Class<T> clazz)
+ protected <T> AbstractBean<T> defineDecorator(Class<T> clazz)
{
ManagedBean<T> component = null;
Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/annotation/LoggingStereoType.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/annotation/LoggingStereoType.java?rev=880594&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/annotation/LoggingStereoType.java (added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/annotation/LoggingStereoType.java Mon Nov 16 05:43:46 2009
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
+ * or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
+ */
+package org.apache.webbeans.newtests.interceptors.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import javax.enterprise.inject.Stereotype;
+
+import org.apache.webbeans.test.component.intercept.webbeans.bindings.Transactional;
+
+@Stereotype
+@Transactional
+@Target(ElementType.TYPE)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface LoggingStereoType
+{
+
+}
Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/annotation/LoggingStereoType.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/annotation/SecureStereoType.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/annotation/SecureStereoType.java?rev=880594&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/annotation/SecureStereoType.java (added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/annotation/SecureStereoType.java Mon Nov 16 05:43:46 2009
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
+ * or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
+ */
+package org.apache.webbeans.newtests.interceptors.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import javax.enterprise.inject.Stereotype;
+
+import org.apache.webbeans.test.component.intercept.webbeans.bindings.Secure;
+
+@Stereotype
+@Secure
+@LoggingStereoType
+@Target(ElementType.TYPE)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface SecureStereoType
+{
+
+}
Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/annotation/SecureStereoType.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/common/WithInheritedBindingTypeBean.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/common/WithInheritedBindingTypeBean.java?rev=880594&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/common/WithInheritedBindingTypeBean.java (added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/common/WithInheritedBindingTypeBean.java Mon Nov 16 05:43:46 2009
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
+ * or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
+ */
+package org.apache.webbeans.newtests.interceptors.business.common;
+
+import javax.enterprise.context.RequestScoped;
+import javax.inject.Named;
+
+import org.apache.webbeans.test.component.intercept.webbeans.bindings.Secure;
+
+@Named("org.apache.webbeans.newtests.interceptors.business.common.WithInheritedBindingTypeBean")
+@RequestScoped
+@Secure
+public class WithInheritedBindingTypeBean
+{
+
+ public void business()
+ {
+
+ }
+}
Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/common/WithInheritedBindingTypeBean.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/common/WithInheritedStereoTypeInterceptorBean.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/common/WithInheritedStereoTypeInterceptorBean.java?rev=880594&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/common/WithInheritedStereoTypeInterceptorBean.java (added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/common/WithInheritedStereoTypeInterceptorBean.java Mon Nov 16 05:43:46 2009
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
+ * or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
+ */
+package org.apache.webbeans.newtests.interceptors.business.common;
+
+import javax.enterprise.context.RequestScoped;
+import javax.inject.Named;
+
+import org.apache.webbeans.newtests.interceptors.annotation.SecureStereoType;
+
+@SecureStereoType
+@RequestScoped
+@Named("org.apache.webbeans.newtests.interceptors.business.common.WithInheritedStereoTypeInterceptorBean")
+public class WithInheritedStereoTypeInterceptorBean
+{
+ public void businessMethod()
+ {
+
+ }
+}
Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/common/WithInheritedStereoTypeInterceptorBean.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/common/WithStereoTypeInterceptorBean.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/common/WithStereoTypeInterceptorBean.java?rev=880594&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/common/WithStereoTypeInterceptorBean.java (added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/common/WithStereoTypeInterceptorBean.java Mon Nov 16 05:43:46 2009
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
+ * or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
+ */
+package org.apache.webbeans.newtests.interceptors.business.common;
+
+import javax.enterprise.context.RequestScoped;
+import javax.inject.Named;
+
+import org.apache.webbeans.newtests.interceptors.annotation.LoggingStereoType;
+
+@LoggingStereoType
+@RequestScoped
+@Named("org.apache.webbeans.newtests.interceptors.business.common.WithStereoTypeInterceptorBean")
+public class WithStereoTypeInterceptorBean
+{
+ public void sayHello()
+ {
+
+ }
+
+}
Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/common/WithStereoTypeInterceptorBean.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/tests/WithInheritedBindingTypeTest.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/tests/WithInheritedBindingTypeTest.java?rev=880594&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/tests/WithInheritedBindingTypeTest.java (added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/tests/WithInheritedBindingTypeTest.java Mon Nov 16 05:43:46 2009
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
+ * or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
+ */
+package org.apache.webbeans.newtests.interceptors.business.tests;
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Set;
+
+import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.spi.Bean;
+
+import junit.framework.Assert;
+
+import org.apache.webbeans.common.AbstractUnitTest;
+import org.apache.webbeans.context.ContextFactory;
+import org.apache.webbeans.newtests.interceptors.business.common.WithInheritedBindingTypeBean;
+import org.apache.webbeans.newtests.interceptors.common.SecureInterceptor;
+import org.apache.webbeans.newtests.interceptors.common.TransactionInterceptor;
+import org.junit.Test;
+
+@SuppressWarnings("unchecked")
+public class WithInheritedBindingTypeTest extends AbstractUnitTest
+{
+ private static final String PACKAGE_NAME = WithInheritedBindingTypeTest.class.getPackage().getName();
+
+ @Test
+ public void testStereoTypeBasedInterceptor()
+ {
+ Collection<URL> beanXmls = new ArrayList<URL>();
+ beanXmls.add(getXMLUrl(PACKAGE_NAME, "WithInheritedBindingTypeTest"));
+
+ Collection<Class<?>> beanClasses = new ArrayList<Class<?>>();
+ beanClasses.add(TransactionInterceptor.class);
+ beanClasses.add(SecureInterceptor.class);
+ beanClasses.add(WithInheritedBindingTypeBean.class);
+
+ TransactionInterceptor.coount = 0;
+
+ startContainer(beanClasses, beanXmls);
+
+ Set<Bean<?>> beans = getBeanManager().getBeans("org.apache.webbeans.newtests.interceptors.business.common.WithInheritedBindingTypeBean");
+ Assert.assertNotNull(beans);
+ Bean<WithInheritedBindingTypeBean> bean = (Bean<WithInheritedBindingTypeBean>)beans.iterator().next();
+
+ CreationalContext<WithInheritedBindingTypeBean> ctx = getBeanManager().createCreationalContext(bean);
+
+ Object reference = getBeanManager().getReference(bean, WithInheritedBindingTypeBean.class, ctx);
+ Assert.assertNotNull(reference);
+
+ Assert.assertTrue(reference instanceof WithInheritedBindingTypeBean);
+
+ WithInheritedBindingTypeBean beanInstance = (WithInheritedBindingTypeBean)reference;
+
+ beanInstance.business();
+
+
+ Assert.assertTrue(TransactionInterceptor.ECHO);
+ Assert.assertTrue(SecureInterceptor.ECHO);
+
+ ContextFactory.destroyRequestContext(null);
+ ContextFactory.initRequestContext(null);
+
+ reference = getBeanManager().getReference(bean, WithInheritedBindingTypeBean.class, ctx);
+ beanInstance = (WithInheritedBindingTypeBean)reference;
+ beanInstance.business();
+
+ Assert.assertEquals(2, TransactionInterceptor.coount);
+
+ shutDownContainer();
+
+ }
+}
Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/tests/WithInheritedBindingTypeTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/tests/WithInheritedStereoTypeInterceptorTest.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/tests/WithInheritedStereoTypeInterceptorTest.java?rev=880594&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/tests/WithInheritedStereoTypeInterceptorTest.java (added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/tests/WithInheritedStereoTypeInterceptorTest.java Mon Nov 16 05:43:46 2009
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
+ * or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
+ */
+package org.apache.webbeans.newtests.interceptors.business.tests;
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Set;
+
+import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.spi.Bean;
+
+import junit.framework.Assert;
+
+import org.apache.webbeans.common.AbstractUnitTest;
+import org.apache.webbeans.newtests.interceptors.business.common.WithInheritedStereoTypeInterceptorBean;
+import org.apache.webbeans.newtests.interceptors.business.common.WithStereoTypeInterceptorBean;
+import org.apache.webbeans.newtests.interceptors.common.SecureInterceptor;
+import org.apache.webbeans.newtests.interceptors.common.TransactionInterceptor;
+import org.junit.Test;
+
+public class WithInheritedStereoTypeInterceptorTest extends AbstractUnitTest
+{
+ private static final String PACKAGE_NAME = WithStereoTypeInterceptorTest.class.getPackage().getName();
+
+ public WithInheritedStereoTypeInterceptorTest()
+ {
+
+ }
+
+ @Test
+ @SuppressWarnings("unchecked")
+ public void testInheritedStereoTypeWihtInterceptorBinding()
+ {
+ Collection<URL> beanXmls = new ArrayList<URL>();
+ beanXmls.add(getXMLUrl(PACKAGE_NAME, "WithInheritedStereoTypeInterceptorTest"));
+
+ Collection<Class<?>> beanClasses = new ArrayList<Class<?>>();
+ beanClasses.add(TransactionInterceptor.class);
+ beanClasses.add(SecureInterceptor.class);
+ beanClasses.add(WithInheritedStereoTypeInterceptorBean.class);
+
+ startContainer(beanClasses, beanXmls);
+
+ Set<Bean<?>> beans = getBeanManager().getBeans("org.apache.webbeans.newtests.interceptors.business.common.WithInheritedStereoTypeInterceptorBean");
+ Assert.assertNotNull(beans);
+ Bean<WithInheritedStereoTypeInterceptorBean> bean = (Bean<WithInheritedStereoTypeInterceptorBean>)beans.iterator().next();
+
+ CreationalContext<WithInheritedStereoTypeInterceptorBean> ctx = getBeanManager().createCreationalContext(bean);
+
+ Object reference = getBeanManager().getReference(bean, WithInheritedStereoTypeInterceptorBean.class, ctx);
+ Assert.assertNotNull(reference);
+
+ Assert.assertTrue(reference instanceof WithInheritedStereoTypeInterceptorBean);
+
+ WithInheritedStereoTypeInterceptorBean beanInstance = (WithInheritedStereoTypeInterceptorBean)reference;
+
+ beanInstance.businessMethod();
+
+ Assert.assertTrue(TransactionInterceptor.ECHO);
+ Assert.assertTrue(SecureInterceptor.ECHO);
+
+ shutDownContainer();
+
+ }
+
+}
Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/tests/WithInheritedStereoTypeInterceptorTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/tests/WithStereoTypeInterceptorTest.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/tests/WithStereoTypeInterceptorTest.java?rev=880594&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/tests/WithStereoTypeInterceptorTest.java (added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/tests/WithStereoTypeInterceptorTest.java Mon Nov 16 05:43:46 2009
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
+ * or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
+ */
+package org.apache.webbeans.newtests.interceptors.business.tests;
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Set;
+
+import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.spi.Bean;
+
+import junit.framework.Assert;
+
+import org.apache.webbeans.common.AbstractUnitTest;
+import org.apache.webbeans.newtests.interceptors.business.common.WithStereoTypeInterceptorBean;
+import org.apache.webbeans.newtests.interceptors.common.TransactionInterceptor;
+import org.junit.Test;
+
+@SuppressWarnings("unchecked")
+public class WithStereoTypeInterceptorTest extends AbstractUnitTest
+{
+ private static final String PACKAGE_NAME = WithStereoTypeInterceptorTest.class.getPackage().getName();
+
+ @Test
+ public void testStereoTypeBasedInterceptor()
+ {
+ Collection<URL> beanXmls = new ArrayList<URL>();
+ beanXmls.add(getXMLUrl(PACKAGE_NAME, "WithStereoTypeInterceptorTest"));
+
+ Collection<Class<?>> beanClasses = new ArrayList<Class<?>>();
+ beanClasses.add(TransactionInterceptor.class);
+ beanClasses.add(WithStereoTypeInterceptorBean.class);
+
+ startContainer(beanClasses, beanXmls);
+
+ Set<Bean<?>> beans = getBeanManager().getBeans("org.apache.webbeans.newtests.interceptors.business.common.WithStereoTypeInterceptorBean");
+ Assert.assertNotNull(beans);
+ Bean<WithStereoTypeInterceptorBean> bean = (Bean<WithStereoTypeInterceptorBean>)beans.iterator().next();
+
+ CreationalContext<WithStereoTypeInterceptorBean> ctx = getBeanManager().createCreationalContext(bean);
+
+ Object reference = getBeanManager().getReference(bean, WithStereoTypeInterceptorBean.class, ctx);
+ Assert.assertNotNull(reference);
+
+ Assert.assertTrue(reference instanceof WithStereoTypeInterceptorBean);
+
+ WithStereoTypeInterceptorBean beanInstance = (WithStereoTypeInterceptorBean)reference;
+
+ beanInstance.sayHello();
+
+ Assert.assertTrue(TransactionInterceptor.ECHO);
+
+ shutDownContainer();
+
+ }
+}
Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/business/tests/WithStereoTypeInterceptorTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/common/SecureInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/common/SecureInterceptor.java?rev=880594&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/common/SecureInterceptor.java (added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/common/SecureInterceptor.java Mon Nov 16 05:43:46 2009
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
+ * or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
+ */
+package org.apache.webbeans.newtests.interceptors.common;
+
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.Interceptor;
+import javax.interceptor.InvocationContext;
+
+import org.apache.webbeans.test.component.intercept.webbeans.bindings.Secure;
+
+@Interceptor
+@Secure
+public class SecureInterceptor
+{
+ public static boolean ECHO = false;
+
+ @AroundInvoke
+ public Object invoke(InvocationContext context) throws Exception
+ {
+ ECHO = true;
+
+ return context.proceed();
+ }
+}
Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/common/SecureInterceptor.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/common/TransactionInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/common/TransactionInterceptor.java?rev=880594&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/common/TransactionInterceptor.java (added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/common/TransactionInterceptor.java Mon Nov 16 05:43:46 2009
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
+ * or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
+ */
+package org.apache.webbeans.newtests.interceptors.common;
+
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.Interceptor;
+import javax.interceptor.InvocationContext;
+
+import org.apache.webbeans.test.component.intercept.webbeans.bindings.Transactional;
+
+@Interceptor
+@Transactional
+public class TransactionInterceptor
+{
+ public static boolean ECHO = false;
+
+ public static int coount = 0;
+
+ @AroundInvoke
+ public Object invoke(InvocationContext context) throws Exception
+ {
+ ECHO = true;
+ coount++;
+ return context.proceed();
+ }
+}
Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/interceptors/common/TransactionInterceptor.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/decorator/DecoratorExceptionTest.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/decorator/DecoratorExceptionTest.java?rev=880594&r1=880593&r2=880594&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/decorator/DecoratorExceptionTest.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/decorator/DecoratorExceptionTest.java Mon Nov 16 05:43:46 2009
@@ -62,7 +62,7 @@
{
try
{
- defineSimpleWebBeansDecorators(DelegateAttributeIsnotInterface.class);
+ defineDecorator(DelegateAttributeIsnotInterface.class);
}
catch (Exception e)
{
@@ -77,7 +77,7 @@
{
try
{
- defineSimpleWebBeansDecorators(MoreThanOneDelegateAttribute.class);
+ defineDecorator(MoreThanOneDelegateAttribute.class);
}
catch (Exception e)
{
@@ -98,7 +98,7 @@
{
try
{
- defineSimpleWebBeansDecorators(PaymentDecorator.class);
+ defineDecorator(PaymentDecorator.class);
defineManagedBean(CheckWithCheckPaymentDecoratorField.class);
}
catch (Exception e)
@@ -114,7 +114,7 @@
{
try
{
- defineSimpleWebBeansDecorators(DelegateAttributeMustImplementAllDecoratedTypes.class);
+ defineDecorator(DelegateAttributeMustImplementAllDecoratedTypes.class);
}
catch (Exception e)
{
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/decorator/DecoratorTest1.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/decorator/DecoratorTest1.java?rev=880594&r1=880593&r2=880594&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/decorator/DecoratorTest1.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/decorator/DecoratorTest1.java Mon Nov 16 05:43:46 2009
@@ -72,7 +72,7 @@
clear();
defineManagedBean(CheckWithCheckPayment.class);
- defineSimpleWebBeansDecorators(ServiceDecorator.class);
+ defineDecorator(ServiceDecorator.class);
AbstractBean<ServiceImpl1> component = defineManagedBean(ServiceImpl1.class);
ContextFactory.initRequestContext(null);
@@ -98,7 +98,7 @@
{
clear();
- defineSimpleWebBeansDecorators(LargeTransactionDecorator.class);
+ defineDecorator(LargeTransactionDecorator.class);
AbstractBean<AccountComponent> component = defineManagedBean(AccountComponent.class);
ContextFactory.initRequestContext(null);
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/CallingBusinessInConstructorTest.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/CallingBusinessInConstructorTest.java?rev=880594&r1=880593&r2=880594&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/CallingBusinessInConstructorTest.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/CallingBusinessInConstructorTest.java Mon Nov 16 05:43:46 2009
@@ -56,7 +56,7 @@
clear();
- defineSimpleWebBeanInterceptor(SecureInterceptor.class);
+ defineInterceptor(SecureInterceptor.class);
Bean<CallBusinessInConstructorBean> bean = defineManagedBean(CallBusinessInConstructorBean.class);
CallBusinessInConstructorBean instance = (CallBusinessInConstructorBean) getInstanceByName("callBusinessInConstructorBean");
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/SecureAndTransactionalInterceptorTest.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/SecureAndTransactionalInterceptorTest.java?rev=880594&r1=880593&r2=880594&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/SecureAndTransactionalInterceptorTest.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/SecureAndTransactionalInterceptorTest.java Mon Nov 16 05:43:46 2009
@@ -47,7 +47,7 @@
public void testSecureAndTransactionalInterceptor()
{
ContextFactory.initSessionContext(new MockHttpSession());
- defineSimpleWebBeanInterceptor(SecureAndTransactionalInterceptor.class);
+ defineInterceptor(SecureAndTransactionalInterceptor.class);
Bean<SecureAndTransactionalComponent> bean = defineManagedBean(SecureAndTransactionalComponent.class);
SecureAndTransactionalComponent payment = getManager().getInstance(bean);
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/SecureInterceptorComponentTest.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/SecureInterceptorComponentTest.java?rev=880594&r1=880593&r2=880594&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/SecureInterceptorComponentTest.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/SecureInterceptorComponentTest.java Mon Nov 16 05:43:46 2009
@@ -41,7 +41,7 @@
@Test
public void testSecureInterceptor()
{
- defineSimpleWebBeanInterceptor(SecureInterceptor.class);
+ defineInterceptor(SecureInterceptor.class);
AbstractBean<SecureComponent> component = defineManagedBean(SecureComponent.class);
ContextFactory.initRequestContext(null);
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/ShoppingCardInterceptorTest.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/ShoppingCardInterceptorTest.java?rev=880594&r1=880593&r2=880594&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/ShoppingCardInterceptorTest.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/ShoppingCardInterceptorTest.java Mon Nov 16 05:43:46 2009
@@ -50,7 +50,7 @@
public void testTransactionalInterceptor()
{
ContextFactory.initSessionContext(new MockHttpSession());
- defineSimpleWebBeanInterceptor(TransactionalInterceptor.class);
+ defineInterceptor(TransactionalInterceptor.class);
Bean<ShoppingCard> bean = defineManagedBean(ShoppingCard.class);
ShoppingCard card = getManager().getInstance(bean);
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/WebBeansInterceptComponentTest.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/WebBeansInterceptComponentTest.java?rev=880594&r1=880593&r2=880594&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/WebBeansInterceptComponentTest.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/WebBeansInterceptComponentTest.java Mon Nov 16 05:43:46 2009
@@ -64,7 +64,7 @@
try
{
- defineSimpleWebBeanInterceptor(WebBeansInterceptor.class);
+ defineInterceptor(WebBeansInterceptor.class);
defineManagedBean(WInterceptorComponent.class);
}
@@ -83,7 +83,7 @@
{
getComponents().clear();
- defineSimpleWebBeanInterceptor(WebBeansInterceptor.class);
+ defineInterceptor(WebBeansInterceptor.class);
defineManagedBean(WInterceptorComponent.class);
ContextFactory.initRequestContext(null);
@@ -106,8 +106,8 @@
{
getComponents().clear();
- defineSimpleWebBeanInterceptor(WebBeansInterceptor.class);
- defineSimpleWebBeanInterceptor(WebBeanswithMetaInterceptor.class);
+ defineInterceptor(WebBeansInterceptor.class);
+ defineInterceptor(WebBeanswithMetaInterceptor.class);
defineManagedBean(WMetaInterceptorComponent.class);
ContextFactory.initRequestContext(null);
Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/newtests/interceptors/business/tests/WithInheritedBindingTypeTest.xml
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/newtests/interceptors/business/tests/WithInheritedBindingTypeTest.xml?rev=880594&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/newtests/interceptors/business/tests/WithInheritedBindingTypeTest.xml (added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/newtests/interceptors/business/tests/WithInheritedBindingTypeTest.xml Mon Nov 16 05:43:46 2009
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<beans>
+ <interceptors>
+ <class>org.apache.webbeans.newtests.interceptors.common.TransactionInterceptor</class>
+ <class>org.apache.webbeans.newtests.interceptors.common.SecureInterceptor</class>
+
+ </interceptors>
+</beans>
Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/newtests/interceptors/business/tests/WithInheritedBindingTypeTest.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/newtests/interceptors/business/tests/WithInheritedStereoTypeInterceptorTest.xml
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/newtests/interceptors/business/tests/WithInheritedStereoTypeInterceptorTest.xml?rev=880594&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/newtests/interceptors/business/tests/WithInheritedStereoTypeInterceptorTest.xml (added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/newtests/interceptors/business/tests/WithInheritedStereoTypeInterceptorTest.xml Mon Nov 16 05:43:46 2009
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<beans>
+ <interceptors>
+ <class>org.apache.webbeans.newtests.interceptors.common.TransactionInterceptor</class>
+ <class>org.apache.webbeans.newtests.interceptors.common.SecureInterceptor</class>
+ </interceptors>
+</beans>
Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/newtests/interceptors/business/tests/WithInheritedStereoTypeInterceptorTest.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/newtests/interceptors/business/tests/WithStereoTypeInterceptorTest.xml
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/newtests/interceptors/business/tests/WithStereoTypeInterceptorTest.xml?rev=880594&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/newtests/interceptors/business/tests/WithStereoTypeInterceptorTest.xml (added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/newtests/interceptors/business/tests/WithStereoTypeInterceptorTest.xml Mon Nov 16 05:43:46 2009
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<beans>
+ <interceptors>
+ <class>org.apache.webbeans.newtests.interceptors.common.TransactionInterceptor</class>
+ </interceptors>
+</beans>
Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/newtests/interceptors/business/tests/WithStereoTypeInterceptorTest.xml
------------------------------------------------------------------------------
svn:eol-style = native