1 25 package org.objectweb.easybeans.tests.common.ejbs.base.interceptororder; 26 27 import java.util.ArrayList ; 28 import java.util.List ; 29 30 import javax.annotation.PostConstruct; 31 import javax.interceptor.Interceptors; 32 33 import org.objectweb.easybeans.tests.common.ejbs.base.ItfMethodInterceptor; 34 import org.objectweb.easybeans.tests.common.interceptors.business.basic.PackageInterceptor; 35 import org.objectweb.easybeans.tests.common.interceptors.business.basic.PrivateInterceptor; 36 import org.objectweb.easybeans.tests.common.interceptors.business.basic.ProtectedInterceptor; 37 import org.objectweb.easybeans.tests.common.interceptors.business.order.PrintOrder01Interceptor; 38 import org.objectweb.easybeans.tests.common.interceptors.business.order.PrintOrder02Interceptor; 39 import org.objectweb.easybeans.tests.common.interceptors.business.order.PrintOrder03Interceptor; 40 import org.objectweb.easybeans.tests.common.interceptors.business.order.PrintOrder04Interceptor; 41 import org.objectweb.easybeans.tests.common.interceptors.business.order.PrintOrder05Interceptor; 42 43 50 public class MethodInterceptorTest implements ItfMethodInterceptor<Integer > { 51 52 55 private List <Integer > lstPostconstruct; 56 57 63 @Interceptors({PrintOrder01Interceptor.class, PrintOrder02Interceptor.class, PrintOrder03Interceptor.class, 64 PrintOrder04Interceptor.class, PrintOrder05Interceptor.class}) 65 public List <Integer > withFiveMethodInterceptors(final List <Integer > par) { 66 par.add(ORDER); 67 return par; 68 } 69 70 77 @Interceptors({PrintOrder05Interceptor.class, PrintOrder04Interceptor.class, PrintOrder03Interceptor.class, 78 PrintOrder02Interceptor.class, PrintOrder01Interceptor.class}) 79 public List <Integer > withFiveMethodInterceptorsInverse(final List <Integer > par) { 80 par.add(ORDER); 81 return par; 82 } 83 84 90 @Interceptors({PrintOrder01Interceptor.class}) 91 public List <Integer > withOneMethodInterceptor(final List <Integer > par) { 92 par.add(ORDER); 93 return par; 94 } 95 96 102 public List <Integer > withoutInterceptor(final List <Integer > par) { 103 par.add(ORDER); 104 return par; 105 } 106 107 113 @Interceptors({PrintOrder01Interceptor.class, PrintOrder02Interceptor.class}) 114 public List <Integer > withTwoMethodInterceptors(final List <Integer > par) { 115 par.add(ORDER); 116 return par; 117 } 118 119 123 public boolean checkPostbackInterceptors(){ 124 return (lstPostconstruct != null); 125 } 126 127 130 @PostConstruct 131 public void postConstruct(){ 132 lstPostconstruct = new ArrayList <Integer >(); 133 } 134 135 141 @Interceptors({PrivateInterceptor.class, ProtectedInterceptor.class, PrintOrder01Interceptor.class, 142 PrivateInterceptor.class, PrintOrder03Interceptor.class, PrivateInterceptor.class, ProtectedInterceptor.class, 143 ProtectedInterceptor.class}) 144 public List <Integer > withPrivateProtectedPublicInterceptors(final List <Integer > par) { 145 par.add(ORDER); 146 return par; 147 } 148 149 155 @Interceptors({PrivateInterceptor.class, PrivateInterceptor.class, PrivateInterceptor.class}) 156 public List <Integer > withPrivateInterceptors(final List <Integer > par) { 157 par.add(ORDER); 158 return par; 159 } 160 161 167 @Interceptors({ProtectedInterceptor.class, ProtectedInterceptor.class}) 168 public List <Integer > withProtectedInterceptors(final List <Integer > par) { 169 par.add(ORDER); 170 return par; 171 } 172 173 179 @Interceptors({PackageInterceptor.class, PackageInterceptor.class, PackageInterceptor.class, PackageInterceptor.class}) 180 public List <Integer > withPackageInterceptors(final List <Integer > par) { 181 par.add(ORDER); 182 return par; 183 } 184 } 185 | Popular Tags |