Re: @Repository and @CacheResult(cacheName = "my-cache")

2018-04-20 Thread Thomas Andraschko
Would be great if you could create a issue + unittest, so i can fix it next week. Am Freitag, 20. April 2018 schrieb Luís Alves : > I have to leave :( don't do any change until I can confirm everything ;( > > have a nice weekend. > > On Fri, Apr 20, 2018 at 5:12 PM, Luís Alves

Re: @Repository and @CacheResult(cacheName = "my-cache")

2018-04-20 Thread Luís Alves
I have to leave :( don't do any change until I can confirm everything ;( have a nice weekend. On Fri, Apr 20, 2018 at 5:12 PM, Luís Alves wrote: > wellI think we might have an issue with the proceed part: > > try { > //Call the annotated method > result

Re: @Repository and @CacheResult(cacheName = "my-cache")

2018-04-20 Thread Luís Alves
wellI think we might have an issue with the proceed part: try { //Call the annotated method result = this.proceed(invocation); <-- this is not calling my method...I think is because the invocation is org.apache.deltaspike.proxy.impl.invocation.ManualInvocationContext@69b38203

Re: @Repository and @CacheResult(cacheName = "my-cache")

2018-04-20 Thread Luís Alves
where the hell is DeltaSpikeProxyInterceptorLookup? which jar I have to import?! On Fri, Apr 20, 2018 at 4:25 PM, Luís Alves wrote: > I'll try@Specializes on CustomDeltaSpikeProxyInterceptorLookup > extends DeltaSpikeProxyInterceptorLookup should do the trick. > > On

Re: @Repository and @CacheResult(cacheName = "my-cache")

2018-04-20 Thread Luís Alves
I'll try@Specializes on CustomDeltaSpikeProxyInterceptorLookup extends DeltaSpikeProxyInterceptorLookup should do the trick. On Fri, Apr 20, 2018 at 4:19 PM, Thomas Andraschko < andraschko.tho...@gmail.com> wrote: > https://docs.jboss.org/cdi/api/2.0/javax/enterprise/ >

Re: @Repository and @CacheResult(cacheName = "my-cache")

2018-04-20 Thread Thomas Andraschko
https://docs.jboss.org/cdi/api/2.0/javax/enterprise/inject/spi/BeanManager.html#isInterceptorBinding-java.lang.Class- Would be great if you can test it, create a issue and provide a patch. Am Freitag, 20. April 2018 schrieb Luís Alves : > I have no idea if it's possible or not. Isn't any CDI

Re: @Repository and @CacheResult(cacheName = "my-cache")

2018-04-20 Thread Luís Alves
I have no idea if it's possible or not. Isn't any CDI expert on the mailing list that want to help? ;) https://docs.oracle.com/javaee/7/api/javax/enterprise/inject/spi/ BeforeBeanDiscovery.html#addInterceptorBinding-javax.enterprise.inject.spi. AnnotatedType- doesn't make the annotation visible

Re: @Repository and @CacheResult(cacheName = "my-cache")

2018-04-20 Thread Luís Alves
Found it: /** * Service interface implemented by extensions. An extension is a service provider declared in META-INF/services. * * @author Greg Luck * @since 1.0 */ public class InterceptorExtension implements Extension { /** * Service interface implemented by extensions. An extension is a

Re: @Repository and @CacheResult(cacheName = "my-cache")

2018-04-20 Thread Thomas Andraschko
Yep, they add the interceptorBinding dynamically: https://github.com/jsr107/RI/blob/master/cache-annotations-ri/cache-annotations-ri-cdi/src/main/java/org/jsr107/ri/annotations/cdi/InterceptorExtension.java Just check our code here:

Re: @Repository and @CacheResult(cacheName = "my-cache")

2018-04-20 Thread Thomas Andraschko
AFAIK there 2 ways of using interceptors with CDI: 1) @InterceptorBinding 2) @Interceptors(..) We only support 1) currently. So i have currently no idea how @CacheResult will work even a normal CDI bean. Maybe it's done in Wildfly but not via the "normal" CDI way. 2018-04-20 15:48 GMT+02:00

Re: @Repository and @CacheResult(cacheName = "my-cache")

2018-04-20 Thread Luís Alves
Submitted: https://github.com/jsr107/jsr107spec/issues/401 I suppose they will tell the issue is from DS...:( On Fri, Apr 20, 2018 at 2:36 PM, Luís Alves wrote: > I suppose it's CDI capable. > > https://www.jcp.org/en/jsr/detail?id=107 > > Red Hat > : Pete Muir <---

Re: @Repository and @CacheResult(cacheName = "my-cache")

2018-04-20 Thread Luís Alves
I suppose it's CDI capable. https://www.jcp.org/en/jsr/detail?id=107 Red Hat : Pete Muir <--- is on the expert group * @author Gavin King * @author Pete Muir * @author Antoine Sabot-Durand */ @Target({ TYPE, METHOD, FIELD }) @Retention(RUNTIME) @Documented @NormalScope @Inherited

Re: @Repository and @CacheResult(cacheName = "my-cache")

2018-04-20 Thread Thomas Andraschko
Puh, i wonder why they did it without binding. CacheResult is actually exactly a binding for the interceptor. Is it CDI compatible? Never had a look at the cache API ;) Even there is a bridge or something available ( https://github.com/tomitribe/jcache-cdi), i'm not sure if this would work with

Re: @Repository and @CacheResult(cacheName = "my-cache")

2018-04-20 Thread Luís Alves
uhm...that's not good :S the annotation is this one: https://static.javadoc.io/javax.cache/cache-api/1.0.0/javax/cache/annotation/CacheResult.html is there a way that using that annotation we get the interceptor to work? (I can implement the interceptor myselfas I said I cannot modify the

Re: @Repository and @CacheResult(cacheName = "my-cache")

2018-04-20 Thread Thomas Andraschko
Just to be clear: I have no idea how internally CacheResult works but our partial beans only supports CDI interceptors by a binding (InterceptorBinding). Everything else, like stated in the doc (@Interceptors, @Intercepted, @Decorator), is not supported. 2018-04-20 14:31 GMT+02:00 Thomas

Re: @Repository and @CacheResult(cacheName = "my-cache")

2018-04-20 Thread Thomas Andraschko
In must not work without the interceptorbinding. Do you mean that it does work without? Am Freitag, 20. April 2018 schrieb Luís Alves : > can you update your test to remove @InterceptorBinding? and check if it > works? > > javax.cache.annotation.CacheResult is standard so I don't want to extend

Re: @Repository and @CacheResult(cacheName = "my-cache")

2018-04-20 Thread Luís Alves
can you update your test to remove @InterceptorBinding? and check if it works? javax.cache.annotation.CacheResult is standard so I don't want to extend it to have the @InterceptorBinding.if this is really the problem. On Fri, Apr 20, 2018 at 1:11 PM, Luís Alves

Re: @Repository and @CacheResult(cacheName = "my-cache")

2018-04-20 Thread Luís Alves
@Retention(RUNTIME) @Target({ TYPE, METHOD }) // @InterceptorBinding public @interface CustomInterceptor { } I suspect is this @InterceptorBindingbut not 100% surewhat is the purpose of that? On Fri, Apr 20, 2018 at 1:06 PM, Luís Alves wrote: > don't you want to

Re: @Repository and @CacheResult(cacheName = "my-cache")

2018-04-20 Thread Luís Alves
don't you want to rewrite your tests with the @CacheResult interceptor ;) ? to see if it works? On Fri, Apr 20, 2018 at 12:57 PM, Thomas Andraschko < andraschko.tho...@gmail.com> wrote: > No idea, debug if the interceptor is really called ;) > > 2018-04-20 13:56 GMT+02:00 Luís Alves

Re: @Repository and @CacheResult(cacheName = "my-cache")

2018-04-20 Thread Thomas Andraschko
No idea, debug if the interceptor is really called ;) 2018-04-20 13:56 GMT+02:00 Luís Alves : > moved the @CustomInterceptor declaration of the interceptor for the web app > beans.xml and now it gets calledSO it should work for the cache as > well. Any hint? > > On

Re: @Repository and @CacheResult(cacheName = "my-cache")

2018-04-20 Thread Luís Alves
moved the @CustomInterceptor declaration of the interceptor for the web app beans.xml and now it gets calledSO it should work for the cache as well. Any hint? On Fri, Apr 20, 2018 at 12:43 PM, Luís Alves wrote: > So I've created a custom one (in fact is a "copy" of

Re: @Repository and @CacheResult(cacheName = "my-cache")

2018-04-20 Thread Thomas Andraschko
Can you maybe copy the partialbean example of my unittest in your project and check if the interceptor is called? As you can see, it sohuld work fine on wildfly 10.1 ->

Re: @Repository and @CacheResult(cacheName = "my-cache")

2018-04-20 Thread Luís Alves
So I've created a custom one (in fact is a "copy" of yours that logs a line): @Interceptor @CustomInterceptor public class CustomInterceptorImpl implements Serializable { private static final long serialVersionUID = 7327752605570037403L; @Inject private Logger logger;

Re: @Repository and @CacheResult(cacheName = "my-cache")

2018-04-20 Thread Thomas Andraschko
You can try with a custom interceptor and check if it's invoked? I assume you don't use weld-2.0.0.Final or weld-2.0.0.SP1? We have a exclusion for this in the unit test as there is something broken, as you can check in the link i posted before. Otherwise, it would be great if you could provide a

Re: @Repository and @CacheResult(cacheName = "my-cache")

2018-04-20 Thread Luís Alves
So far no success...@CacheResult on @ApplicationScoped @Repository public abstract class SomeRepository doesn't seem to work :S not sure what I'm doing wrong. On Fri, Apr 20, 2018 at 11:03 AM, Luís Alves wrote: > I ditched the CustomBaseRepository for now...but still

Re: @Repository and @CacheResult(cacheName = "my-cache")

2018-04-20 Thread Luís Alves
I ditched the CustomBaseRepository for now...but still can't get the cache interceptor to work...here is my beans.xml: http://java.sun.com/xml/ns/javaee; xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation="http://java.sun.com/xml/ns/javaee

Re: @Repository and @CacheResult(cacheName = "my-cache")

2018-04-20 Thread Luís Alves
Thanks Thomas, if I understood correctly if they are on the bean.xml they should works :)...only annotated one don't work. I'm now (not sure why I didn't had it before) getting: org.apache.deltaspike.data.impl.RepositoryDefinitionException: Repository creation for class class

Re: @Repository and @CacheResult(cacheName = "my-cache")

2018-04-20 Thread Luís Alves
So far I found that @Repository is actually a @PartialBeanBinding and I found: "Currently CDI Interceptors applied via @Interceptors, @Intercepted and @Decorator are not supported by our proxies! "...does it means that I'm screwed ;)? LA On Fri, Apr 20, 2018 at 10:11 AM, Luís Alves

Re: @Repository and @CacheResult(cacheName = "my-cache")

2018-04-20 Thread Thomas Andraschko
See: https://github.com/apache/deltaspike/tree/master/deltaspike/modules/partial-bean/impl/src/test/java/org/apache/deltaspike/test/core/api/partialbean/uc008 2018-04-20 11:22 GMT+02:00 Thomas Andraschko : > Interceptors in generell should be supported but only via

@Repository and @CacheResult(cacheName = "my-cache")

2018-04-20 Thread Luís Alves
Hi, @Repository is @Dependent scoped...and seems that @Dependent don't run interceptors, so @CacheResult(cacheName = "my-cache") annotation isn't working :( I remember that some one proposed that @Repository could/should be @ApplicationScoped...if I change them do I have to worry with anything?