@Test(expected = IllegalArgumentException.class) public void testIllegalListener() throws Exception { RegexProxyFactory<DataSource> factory = new RegexProxyFactory<DataSource>(DataSource.class); factory.addMethodListener(".*", null); }
public void addMethodListener(String regex, RegexMethodInterceptorListener<T> listener) { if(listener == null) { throw new IllegalArgumentException("listener cannot be null."); } Set<RegexMethodInterceptorListener<T>> set = listeners.get(regex); if(set == null) { set = new HashSet<RegexMethodInterceptorListener<T>>(); listeners.put(regex, set); } set.add(listener); }
RegexProxyFactory implements ProxyAware<T> { public void addMethodListener(String regex, RegexMethodInterceptorListener<T> listener) { if(listener == null) { throw new IllegalArgumentException("listener cannot be null."); } Set<RegexMethodInterceptorListener<T>> set = listeners.get(regex); if(set == null) { set = new HashSet<RegexMethodInterceptorListener<T>>(); listeners.put(regex, set); } set.add(listener); } }
RegexProxyFactory implements ProxyAware<T> { public void addMethodListener(String regex, RegexMethodInterceptorListener<T> listener) { if(listener == null) { throw new IllegalArgumentException("listener cannot be null."); } Set<RegexMethodInterceptorListener<T>> set = listeners.get(regex); if(set == null) { set = new HashSet<RegexMethodInterceptorListener<T>>(); listeners.put(regex, set); } set.add(listener); } RegexProxyFactory(Class<T> clazz); }
RegexProxyFactory implements ProxyAware<T> { public void addMethodListener(String regex, RegexMethodInterceptorListener<T> listener) { if(listener == null) { throw new IllegalArgumentException("listener cannot be null."); } Set<RegexMethodInterceptorListener<T>> set = listeners.get(regex); if(set == null) { set = new HashSet<RegexMethodInterceptorListener<T>>(); listeners.put(regex, set); } set.add(listener); } RegexProxyFactory(Class<T> clazz); T getProxy(T object); @SuppressWarnings("unchecked") ProxyInterceptorAware<T> getProxyInterceptor(T object); void addMethodListener(String regex, RegexMethodInterceptorListener<T> listener); }
RegexProxyFactory implements ProxyAware<T> { public void addMethodListener(String regex, RegexMethodInterceptorListener<T> listener) { if(listener == null) { throw new IllegalArgumentException("listener cannot be null."); } Set<RegexMethodInterceptorListener<T>> set = listeners.get(regex); if(set == null) { set = new HashSet<RegexMethodInterceptorListener<T>>(); listeners.put(regex, set); } set.add(listener); } RegexProxyFactory(Class<T> clazz); T getProxy(T object); @SuppressWarnings("unchecked") ProxyInterceptorAware<T> getProxyInterceptor(T object); void addMethodListener(String regex, RegexMethodInterceptorListener<T> listener);  }