1 16 17 package com.google.inject; 18 19 import com.google.inject.matcher.Matcher; 20 import java.lang.reflect.Method ; 21 import java.util.ArrayList ; 22 import java.util.List ; 23 import org.aopalliance.intercept.MethodInterceptor; 24 25 30 class ProxyFactoryBuilder { 31 32 final List <MethodAspect> methodAspects = new ArrayList <MethodAspect>(); 33 34 44 public ProxyFactoryBuilder intercept(Matcher<? super Class <?>> classMatcher, 45 Matcher<? super Method > methodMatcher, 46 MethodInterceptor... interceptors) { 47 methodAspects.add( 48 new MethodAspect(classMatcher, methodMatcher, interceptors)); 49 return this; 50 } 51 52 55 public ProxyFactory create() { 56 return new ProxyFactory(new ArrayList <MethodAspect>(methodAspects)); 57 } 58 } 59 | Popular Tags |