Repository: deltaspike
Updated Branches:
  refs/heads/master e16cea140 -> 269eb82f7


DELTASPIKE-1339 Add support for dynamic interceptor binding, added via Extension

Project: http://git-wip-us.apache.org/repos/asf/deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltaspike/commit/269eb82f
Tree: http://git-wip-us.apache.org/repos/asf/deltaspike/tree/269eb82f
Diff: http://git-wip-us.apache.org/repos/asf/deltaspike/diff/269eb82f

Branch: refs/heads/master
Commit: 269eb82f739828c3c5a081e361bec31437f7a9c7
Parents: e16cea1
Author: Thomas Andraschko <tandrasc...@apache.org>
Authored: Mon Apr 23 14:23:34 2018 +0200
Committer: Thomas Andraschko <tandrasc...@apache.org>
Committed: Mon Apr 23 14:23:34 2018 +0200

----------------------------------------------------------------------
 .../impl/PartialBeanProxyFactory.java           |  2 +-
 .../uc013/MethodLevelInterceptorTest.java       | 92 ++++++++++++++++++++
 .../api/partialbean/uc013/MyRepository.java     | 41 +++++++++
 .../core/api/partialbean/uc013/SimpleCache.java | 35 ++++++++
 .../partialbean/uc013/SimpleCacheExtension.java | 31 +++++++
 .../uc013/SimpleCacheInterceptor.java           | 47 ++++++++++
 .../partialbean/uc013/SimpleCacheManager.java   | 42 +++++++++
 .../uc013/TestPartialBeanHandler.java           | 36 ++++++++
 .../proxy/api/DeltaSpikeProxyFactory.java       |  4 +-
 .../DeltaSpikeProxyInterceptorLookup.java       | 11 ++-
 .../DeltaSpikeProxyInvocationContext.java       |  2 +-
 11 files changed, 332 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/269eb82f/deltaspike/modules/partial-bean/impl/src/main/java/org/apache/deltaspike/partialbean/impl/PartialBeanProxyFactory.java
----------------------------------------------------------------------
diff --git 
a/deltaspike/modules/partial-bean/impl/src/main/java/org/apache/deltaspike/partialbean/impl/PartialBeanProxyFactory.java
 
b/deltaspike/modules/partial-bean/impl/src/main/java/org/apache/deltaspike/partialbean/impl/PartialBeanProxyFactory.java
index 03514da..038e5ca 100644
--- 
a/deltaspike/modules/partial-bean/impl/src/main/java/org/apache/deltaspike/partialbean/impl/PartialBeanProxyFactory.java
+++ 
b/deltaspike/modules/partial-bean/impl/src/main/java/org/apache/deltaspike/partialbean/impl/PartialBeanProxyFactory.java
@@ -50,7 +50,7 @@ public class PartialBeanProxyFactory extends 
DeltaSpikeProxyFactory
     @Override
     protected ArrayList<Method> getDelegateMethods(Class<?> targetClass, 
ArrayList<Method> allMethods)
     {
-        ArrayList<Method> methods = new ArrayList<Method>();
+        ArrayList<Method> methods = new ArrayList<>();
         
         Iterator<Method> it = allMethods.iterator();
         while (it.hasNext())

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/269eb82f/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc013/MethodLevelInterceptorTest.java
----------------------------------------------------------------------
diff --git 
a/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc013/MethodLevelInterceptorTest.java
 
b/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc013/MethodLevelInterceptorTest.java
new file mode 100644
index 0000000..f82a420
--- /dev/null
+++ 
b/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc013/MethodLevelInterceptorTest.java
@@ -0,0 +1,92 @@
+/*
+ * 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.deltaspike.test.core.api.partialbean.uc013;
+
+import java.util.List;
+import javax.enterprise.inject.spi.Extension;
+import org.apache.deltaspike.core.api.provider.BeanProvider;
+import 
org.apache.deltaspike.test.core.api.partialbean.shared.TestPartialBeanBinding;
+import org.apache.deltaspike.test.core.api.partialbean.util.ArchiveUtils;
+import org.apache.deltaspike.test.utils.CdiContainerUnderTest;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.Asset;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Assert;
+import org.junit.Assume;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@RunWith(Arquillian.class)
+public class MethodLevelInterceptorTest
+{
+    public static final String CONTAINER_WELD_2_0_0 = "weld-2\\.0\\.0\\..*";
+
+    @Deployment
+    public static WebArchive war()
+    {
+        Asset beansXml = new StringAsset(
+            "<beans><interceptors><class>" +
+                    SimpleCacheInterceptor.class.getName() +
+            "</class></interceptors></beans>"
+        );
+
+        String simpleName = MethodLevelInterceptorTest.class.getSimpleName();
+        String archiveName = simpleName.substring(0, 1).toLowerCase() + 
simpleName.substring(1);
+
+        //don't create a completely empty web-archive
+        if (CdiContainerUnderTest.is(CONTAINER_WELD_2_0_0))
+        {
+            return ShrinkWrap.create(WebArchive.class, archiveName + ".war")
+                    
.addAsLibraries(ArchiveUtils.getDeltaSpikeCoreAndPartialBeanArchive());
+        }
+
+        JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, archiveName 
+ ".jar")
+                .addPackage(MethodLevelInterceptorTest.class.getPackage())
+                .addPackage(TestPartialBeanBinding.class.getPackage())
+                .addAsManifestResource(beansXml, "beans.xml");
+
+        return ShrinkWrap.create(WebArchive.class, archiveName + ".war")
+                
.addAsLibraries(ArchiveUtils.getDeltaSpikeCoreAndPartialBeanArchive())
+                .addAsLibraries(testJar)
+                .addAsServiceProvider(Extension.class, 
SimpleCacheExtension.class)
+                .addAsWebInfResource(beansXml, "beans.xml");
+    }
+
+    @Test
+    public void testMethodLevelInterceptor() throws Exception
+    {
+        // this test is known to not work under weld-2.0.0.Final and 
weld-2.0.0.SP1
+        Assume.assumeTrue(!CdiContainerUnderTest.is(CONTAINER_WELD_2_0_0));
+
+        MyRepository myRepository = 
BeanProvider.getContextualReference(MyRepository.class);
+
+        List<String> users = myRepository.getAllUsers();
+        
+        Assert.assertNotNull(users);
+        Assert.assertEquals(3, users.size());
+
+        Assert.assertSame(users, myRepository.getAllUsers());
+    }
+    
+  
+}

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/269eb82f/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc013/MyRepository.java
----------------------------------------------------------------------
diff --git 
a/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc013/MyRepository.java
 
b/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc013/MyRepository.java
new file mode 100644
index 0000000..1888273
--- /dev/null
+++ 
b/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc013/MyRepository.java
@@ -0,0 +1,41 @@
+/*
+ * 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.deltaspike.test.core.api.partialbean.uc013;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.enterprise.context.ApplicationScoped;
+import 
org.apache.deltaspike.test.core.api.partialbean.shared.TestPartialBeanBinding;
+
+@TestPartialBeanBinding
+@ApplicationScoped
+public abstract class MyRepository
+{
+    @SimpleCache
+    public List<String> getAllUsers()
+    {
+        ArrayList<String> users = new ArrayList<>();
+        
+        users.add("Me");
+        users.add("You");
+        users.add("Anyone");
+        
+        return users;
+    }
+}

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/269eb82f/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc013/SimpleCache.java
----------------------------------------------------------------------
diff --git 
a/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc013/SimpleCache.java
 
b/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc013/SimpleCache.java
new file mode 100644
index 0000000..daa4910
--- /dev/null
+++ 
b/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc013/SimpleCache.java
@@ -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.deltaspike.test.core.api.partialbean.uc013;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Documented
+@Inherited
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ ElementType.TYPE, ElementType.METHOD })
+public @interface SimpleCache
+{
+    
+}

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/269eb82f/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc013/SimpleCacheExtension.java
----------------------------------------------------------------------
diff --git 
a/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc013/SimpleCacheExtension.java
 
b/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc013/SimpleCacheExtension.java
new file mode 100644
index 0000000..933eac6
--- /dev/null
+++ 
b/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc013/SimpleCacheExtension.java
@@ -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.deltaspike.test.core.api.partialbean.uc013;
+
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.spi.BeforeBeanDiscovery;
+import javax.enterprise.inject.spi.Extension;
+
+public class SimpleCacheExtension implements Extension
+{
+    void discoverInterceptorBindings(@Observes BeforeBeanDiscovery 
beforeBeanDiscoveryEvent)
+    {
+        beforeBeanDiscoveryEvent.addInterceptorBinding(SimpleCache.class);
+    }
+}

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/269eb82f/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc013/SimpleCacheInterceptor.java
----------------------------------------------------------------------
diff --git 
a/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc013/SimpleCacheInterceptor.java
 
b/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc013/SimpleCacheInterceptor.java
new file mode 100644
index 0000000..afcdb1a
--- /dev/null
+++ 
b/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc013/SimpleCacheInterceptor.java
@@ -0,0 +1,47 @@
+/*
+ * 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.deltaspike.test.core.api.partialbean.uc013;
+
+import java.io.Serializable;
+import javax.inject.Inject;
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.Interceptor;
+import javax.interceptor.InvocationContext;
+
+@Interceptor
+@SimpleCache
+public class SimpleCacheInterceptor implements Serializable
+{
+    @Inject
+    private SimpleCacheManager scm;
+    
+    @AroundInvoke
+    public Object wrapBeanCandidate(InvocationContext invocationContext) 
throws Exception
+    {
+        if (scm.getSingletonCache().containsKey(invocationContext.getMethod()))
+        {
+            return scm.getSingletonCache().get(invocationContext.getMethod());
+        }
+        
+        Object result = invocationContext.proceed();
+        scm.getSingletonCache().put(invocationContext.getMethod(), result);
+        
+        return result;
+    }
+}

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/269eb82f/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc013/SimpleCacheManager.java
----------------------------------------------------------------------
diff --git 
a/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc013/SimpleCacheManager.java
 
b/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc013/SimpleCacheManager.java
new file mode 100644
index 0000000..a9ca904
--- /dev/null
+++ 
b/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc013/SimpleCacheManager.java
@@ -0,0 +1,42 @@
+/*
+ * 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.deltaspike.test.core.api.partialbean.uc013;
+
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.Map;
+import javax.annotation.PostConstruct;
+import javax.enterprise.context.ApplicationScoped;
+
+@ApplicationScoped
+public class SimpleCacheManager {
+    
+    private Map<Method, Object> singletonCache;
+    
+    @PostConstruct
+    public void init()
+    {
+        singletonCache = new HashMap<>();
+    }
+
+    public Map<Method, Object> getSingletonCache()
+    {
+        return singletonCache;
+    }
+}

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/269eb82f/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc013/TestPartialBeanHandler.java
----------------------------------------------------------------------
diff --git 
a/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc013/TestPartialBeanHandler.java
 
b/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc013/TestPartialBeanHandler.java
new file mode 100644
index 0000000..b6f99d7
--- /dev/null
+++ 
b/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc013/TestPartialBeanHandler.java
@@ -0,0 +1,36 @@
+/*
+ * 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.deltaspike.test.core.api.partialbean.uc013;
+
+import 
org.apache.deltaspike.test.core.api.partialbean.shared.TestPartialBeanBinding;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import javax.enterprise.context.ApplicationScoped;
+
+@TestPartialBeanBinding
+@ApplicationScoped
+public class TestPartialBeanHandler implements InvocationHandler
+{
+    @Override
+    public Object invoke(Object proxy, Method method, Object[] args) throws 
Throwable
+    {        
+        return "partial";
+    }
+}

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/269eb82f/deltaspike/modules/proxy/api/src/main/java/org/apache/deltaspike/proxy/api/DeltaSpikeProxyFactory.java
----------------------------------------------------------------------
diff --git 
a/deltaspike/modules/proxy/api/src/main/java/org/apache/deltaspike/proxy/api/DeltaSpikeProxyFactory.java
 
b/deltaspike/modules/proxy/api/src/main/java/org/apache/deltaspike/proxy/api/DeltaSpikeProxyFactory.java
index dd41c83..1ee91dd 100644
--- 
a/deltaspike/modules/proxy/api/src/main/java/org/apache/deltaspike/proxy/api/DeltaSpikeProxyFactory.java
+++ 
b/deltaspike/modules/proxy/api/src/main/java/org/apache/deltaspike/proxy/api/DeltaSpikeProxyFactory.java
@@ -26,8 +26,6 @@ import java.util.Iterator;
 import java.util.List;
 import javax.enterprise.inject.spi.BeanManager;
 
-import javax.interceptor.InterceptorBinding;
-
 import org.apache.deltaspike.core.util.ClassUtils;
 import org.apache.deltaspike.core.util.ReflectionUtils;
 import org.apache.deltaspike.proxy.spi.DeltaSpikeProxyClassGenerator;
@@ -107,7 +105,7 @@ public abstract class DeltaSpikeProxyFactory
         {            
             Class<? extends Annotation> annotationType = 
annotation.annotationType();
             
-            if (annotationType.isAnnotationPresent(InterceptorBinding.class))
+            if (beanManager.isInterceptorBinding(annotationType))
             {
                 return true;
             }

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/269eb82f/deltaspike/modules/proxy/api/src/main/java/org/apache/deltaspike/proxy/spi/invocation/DeltaSpikeProxyInterceptorLookup.java
----------------------------------------------------------------------
diff --git 
a/deltaspike/modules/proxy/api/src/main/java/org/apache/deltaspike/proxy/spi/invocation/DeltaSpikeProxyInterceptorLookup.java
 
b/deltaspike/modules/proxy/api/src/main/java/org/apache/deltaspike/proxy/spi/invocation/DeltaSpikeProxyInterceptorLookup.java
index 0bd23ff..5391e3e 100644
--- 
a/deltaspike/modules/proxy/api/src/main/java/org/apache/deltaspike/proxy/spi/invocation/DeltaSpikeProxyInterceptorLookup.java
+++ 
b/deltaspike/modules/proxy/api/src/main/java/org/apache/deltaspike/proxy/spi/invocation/DeltaSpikeProxyInterceptorLookup.java
@@ -28,7 +28,6 @@ import javax.enterprise.context.ApplicationScoped;
 import javax.enterprise.inject.spi.BeanManager;
 import javax.enterprise.inject.spi.InterceptionType;
 import javax.enterprise.inject.spi.Interceptor;
-import javax.interceptor.InterceptorBinding;
 import org.apache.deltaspike.core.api.provider.BeanManagerProvider;
 
 /**
@@ -37,7 +36,7 @@ import 
org.apache.deltaspike.core.api.provider.BeanManagerProvider;
 @ApplicationScoped
 public class DeltaSpikeProxyInterceptorLookup
 {
-    private final Map<Method, List<Interceptor<?>>> cache = new 
HashMap<Method, List<Interceptor<?>>>();
+    private final Map<Method, List<Interceptor<?>>> cache = new HashMap<>();
     
     public List<Interceptor<?>> lookup(Object instance, Method method)
     {
@@ -62,12 +61,12 @@ public class DeltaSpikeProxyInterceptorLookup
             return 
beanManager.resolveInterceptors(InterceptionType.AROUND_INVOKE, 
interceptorBindings);
         }
 
-        return new ArrayList<Interceptor<?>>();
+        return new ArrayList<>();
     }
 
     private Annotation[] extractInterceptorBindings(BeanManager beanManager, 
Object instance, Method method)
     {
-        ArrayList<Annotation> bindings = new ArrayList<Annotation>();
+        ArrayList<Annotation> bindings = new ArrayList<>();
 
         addInterceptorBindings(beanManager, bindings, 
instance.getClass().getDeclaredAnnotations());
         addInterceptorBindings(beanManager, bindings, 
method.getDeclaredAnnotations());
@@ -87,7 +86,7 @@ public class DeltaSpikeProxyInterceptorLookup
             
             Class<? extends Annotation> annotationType = 
annotation.annotationType();
             
-            if (annotationType.isAnnotationPresent(InterceptorBinding.class))
+            if (beanManager.isInterceptorBinding(annotationType))
             {
                 bindings.add(annotation);
             }
@@ -101,7 +100,7 @@ public class DeltaSpikeProxyInterceptorLookup
                         continue;
                     }
 
-                    if 
(subAnnotation.annotationType().isAnnotationPresent(InterceptorBinding.class))
+                    if 
(beanManager.isInterceptorBinding(subAnnotation.annotationType()))
                     {
                         bindings.add(subAnnotation);
                     }  

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/269eb82f/deltaspike/modules/proxy/api/src/main/java/org/apache/deltaspike/proxy/spi/invocation/DeltaSpikeProxyInvocationContext.java
----------------------------------------------------------------------
diff --git 
a/deltaspike/modules/proxy/api/src/main/java/org/apache/deltaspike/proxy/spi/invocation/DeltaSpikeProxyInvocationContext.java
 
b/deltaspike/modules/proxy/api/src/main/java/org/apache/deltaspike/proxy/spi/invocation/DeltaSpikeProxyInvocationContext.java
index c99b4bb..5177b83 100644
--- 
a/deltaspike/modules/proxy/api/src/main/java/org/apache/deltaspike/proxy/spi/invocation/DeltaSpikeProxyInvocationContext.java
+++ 
b/deltaspike/modules/proxy/api/src/main/java/org/apache/deltaspike/proxy/spi/invocation/DeltaSpikeProxyInvocationContext.java
@@ -110,7 +110,7 @@ public class DeltaSpikeProxyInvocationContext<T, H> extends 
AbstractInvocationCo
             throw new DeltaSpikeProxyInvocationWrapperException(e);
         }
 
-        return null;
+        return proceedOriginalReturnValue;
     }
 
     public boolean isProceedOriginal()

Reply via email to