Re: Override bean from library on TomEE

2018-11-20 Thread Bruno Baptista
Thanks for the help Romain Bruno Baptista http://twitter.com/brunobat_ On 19/11/18 17:39, Romain Manni-Bucau wrote: Le lun. 19 nov. 2018 17:58, Bruno Baptista a écrit : Thanks Romain, It's good to know. Where is that configuration?

Re: Override bean from library on TomEE

2018-11-19 Thread Romain Manni-Bucau
Le lun. 19 nov. 2018 17:58, Bruno Baptista a écrit : > Thanks Romain, > > It's good to know. Where is that configuration? > https://github.com/apache/tomee/blob/master/container/openejb-core/src/main/resources/default.exclusions and

Re: Override bean from library on TomEE

2018-11-19 Thread Bruno Baptista
Thanks Romain, It's good to know. Where is that configuration? However, the problem is before that... The test with the interceptor, somehow fails to load the alternative, which has me very puzzled. Cheers. Bruno Baptista http://twitter.com/brunobat_ On 19/11/18 16:45, Romain Manni-Bucau

Re: Override bean from library on TomEE

2018-11-19 Thread Romain Manni-Bucau
Le lun. 19 nov. 2018 à 16:59, Roberto Cortez a écrit : > Hi, > > We had that project before, and we ended up dropping with the > justification that the libs should handle all of that. > > Not saying not to do it and I just don’t want to see code being blocked > again for the same reason :) > >

Re: Override bean from library on TomEE

2018-11-19 Thread Roberto Cortez
Hi, We had that project before, and we ended up dropping with the justification that the libs should handle all of that. Not saying not to do it and I just don’t want to see code being blocked again for the same reason :) Cheers, Roberto > On 19 Nov 2018, at 15:31, Bruno Baptista wrote: >

Re: Override bean from library on TomEE

2018-11-19 Thread Bruno Baptista
Hi Romain, In relation to the name of the lib to be /geronimo-safeguard-tomee/ instead of /tomee-microprofile-common/ I would advise against it because we can put other overrides and utility classes on it instead of creating a single lib for every particular spec/need. Feedback is

Re: Override bean from library on TomEE

2018-11-19 Thread Romain Manni-Bucau
rename the lib geronimo-safeguard-tomee or include the common MP jar in the scanned modules? side note: i mentionned it @geronimo: you likely don't want to hardcode a default name which will either be replaced by another one, not be the default one or not be controllable by the user (

Re: Override bean from library on TomEE

2018-11-19 Thread Bruno Baptista
Hi All, I created a PR to make the discussion easier. It's here: https://github.com/apache/tomee/pull/201 There's another problem with the alternative bean implementation. After including the SafeguardInterceptor in the test, the bean, FailsafeContainerExecutionManagerProvider, is never

Re: Override bean from library on TomEE

2018-11-19 Thread Bruno Baptista
Hi Jon, I'm not sure what would be the right way to load that code. But now that you mention it, a CDI extension sounds the proper way to do it. The code now loads properly. Thanks! Will create a PR soon. Bruno Baptista http://twitter.com/brunobat_ On 19/11/18 10:41, Jonathan Gallimore

Re: Override bean from library on TomEE

2018-11-19 Thread Jonathan Gallimore
I haven't seen the code, so its difficult to suggest anything - where would you expect it to be loaded - in a CDI extension? On Mon, Nov 19, 2018 at 10:31 AM Bruno Baptista wrote: > Hi all, > > I've created a jira for this task to properly track the commits: >

Re: Override bean from library on TomEE

2018-11-19 Thread Bruno Baptista
Thanks Jon Bruno Baptista http://twitter.com/brunobat_ On 19/11/18 10:10, Jonathan Gallimore wrote: I say go for it and create your module. Looking forward to reviewing the PR. Jon On Mon, Nov 19, 2018 at 10:08 AM Bruno Baptista wrote: Hi Jon, Well, 2 classes for the module. One doing

Re: Override bean from library on TomEE

2018-11-19 Thread Jonathan Gallimore
I say go for it and create your module. Looking forward to reviewing the PR. Jon On Mon, Nov 19, 2018 at 10:08 AM Bruno Baptista wrote: > Hi Jon, > > Well, 2 classes for the module. One doing the work and a test. > > We have other modules with just 2 classes, like /tomee-overlay-runner/, >

Re: Override bean from library on TomEE

2018-11-19 Thread Bruno Baptista
Hi Jon, Well, 2 classes for the module. One doing the work and a test. We have other modules with just 2 classes, like /tomee-overlay-runner/, /tomee-util/ and other. There's probably margin for consolidating some of them, but that's probably a discussion for another thread. Cheers Bruno

Re: Override bean from library on TomEE

2018-11-19 Thread Jonathan Gallimore
I'd be ok with creating a module to include your class file. We'd probably just want to keep an eye on it so it doesn't become a bucket of random stuff - so I could see it becoming tomee-microprofile-fault-tolerance, or something like that. Is it just one class file for the module? Jon On Sun,

Re: Override bean from library on TomEE

2018-11-18 Thread Bruno Baptista
Hi All, I came up with a test that successfully overrides the original /FailsafeExecutionManagerProvider/ Safeguard class. It was a bit of a surprise but, in this case, beans.xml is useless because "The alternatives that you specify in the |beans.xml| file apply only to classes in the same

Re: Override bean from library on TomEE

2018-11-16 Thread Bruno Baptista
Hi Romain, Yeah... @Resource would be the right thing to use in order to inject the managed resource. Something like this: @Resource(name = "DefaultManagedScheduledExecutorService") private ManagedScheduledExecutorService executor; Creating the test now. Thanks for the help Romain. Bruno

Re: Override bean from library on TomEE

2018-11-16 Thread Romain Manni-Bucau
FYI this works: @ApplicationScoped public class CustomProvider extends FailsafeExecutionManagerProvider { @Override @Produces @Specializes @ApplicationScoped public ExecutionManager createExecutionManager() { return new FailsafeExecutionManager() {

Re: Override bean from library on TomEE

2018-11-16 Thread Romain Manni-Bucau
Hi Bruno, I assume the alternative is activated in the beans.xml? (if not try adding a @Priority maybe or just drop the annotation which should be useless) If it is i'd start by writing a small test (with application composer) to check if it is a bug in tomee cause this is how it must work

Re: Override bean from library on TomEE

2018-11-16 Thread Bruno Baptista
Hi Roman, This is what I did and it doesn't work. The original bean is always picked up: @Specializes @Alternative @ApplicationScoped public class FailsafeContainerExecutionManagerProvider extends FailsafeExecutionManagerProvider { @Inject private ManagedScheduledExecutorService executor;

Re: Override bean from library on TomEE

2018-11-16 Thread Romain Manni-Bucau
Hi Bruno, it is a palin bean so @Specializes works, did you put it on the method? Romain Manni-Bucau @rmannibucau | Blog | Old Blog | Github | LinkedIn

Override bean from library on TomEE

2018-11-16 Thread Bruno Baptista
Hi all, We have a problem with the integration of the Safeguard Fault Tolerance library on TomEE 8 and I need help to solve it. This is a follow up to the original email thread, from Oct 3, in the Geronimo mailing list, where we decided to do perform the override in the container side. I