I'd like to kind of drop the hardcoded chain logic and freeze it until somebody get enough motivation and time to rework it in a sortable way (maybe even sortable events). Last one is an option but surprised there is no way to do it already - I know I did a couple of time but could have been a bit more hacky switching jpa provider or datasource factory for instance, dont recall the details).
Thinking to it this last option can be saner: using template or resource provider (globally set) you can make the datasource using your custom config. Can be worth a try. Romain Manni-Bucau @rmannibucau <https://twitter.com/rmannibucau> | Blog <https://blog-rmannibucau.rhcloud.com> | Old Blog <http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> | LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory <https://javaeefactory-rmannibucau.rhcloud.com> 2017-02-27 15:08 GMT+01:00 Svetlin Zarev <[email protected]>: > The latest event that is fired before the AutoConfig deployer is the > BeforeDeploymentEvent, which is fired too early and does not contain the > AppModule object. A few ideas come to mind > > 1. Back to my original idea of extracting the deployer chain creation to a > protected method. This should be safe as it does not modify the behaviour > of TomEE at all. If someone modifies the chain, then it's his > responsibility to verify he has not broken something > > 2. The PreAutoConfigDeployer (i.e. the developer provided deployer) should > be moved right before the AutoConfig deployer. > > 3. Maybe a new deployer right before the AutoConfig one, that will fire a > new event - BeforeAutoConfigEvent(AppModule) > > 4. An event is fired after each deployer -> > AfterDeployerEvent(Deployer.class, AppModule) > > What do you think ? > > 2017-02-27 15:43 GMT+02:00 Romain Manni-Bucau <[email protected]>: > > > try this: @Observes Object > > > > you will spy them all ;) > > > > > > Romain Manni-Bucau > > @rmannibucau <https://twitter.com/rmannibucau> | Blog > > <https://blog-rmannibucau.rhcloud.com> | Old Blog > > <http://rmannibucau.wordpress.com> | Github <https://github.com/ > > rmannibucau> | > > LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory > > <https://javaeefactory-rmannibucau.rhcloud.com> > > > > 2017-02-27 14:40 GMT+01:00 Svetlin Zarev <svetlin.angelov.zarev@gmail. > com > > >: > > > > > Hi, > > > > > > That event is fired too late :) When it's fired, the AutoConfig > deployer > > > has already created the datasource. Is there an event fired just before > > the > > > AutoConfig deployer ? > > > > > > Kind regards, > > > Svetlin > > > > > > 2017-02-24 16:23 GMT+02:00 Svetlin Zarev <svetlin.angelov.zarev@gmail. > > com > > > >: > > > > > > > This event is quite powerful :) I'll definitely check it. > > > > > > > > Thanks, > > > > Svetlin > > > > > > > > 2017-02-24 16:05 GMT+02:00 Romain Manni-Bucau <[email protected] > >: > > > > > > > >> You can observes an event to do that, no need to tune the deployer > > > chain: > > > >> BeforeAppInfoBuilderEvent > > > >> > > > >> > > > >> Romain Manni-Bucau > > > >> @rmannibucau <https://twitter.com/rmannibucau> | Blog > > > >> <https://blog-rmannibucau.rhcloud.com> | Old Blog > > > >> <http://rmannibucau.wordpress.com> | Github < > > > >> https://github.com/rmannibucau> | > > > >> LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory > > > >> <https://javaeefactory-rmannibucau.rhcloud.com> > > > >> > > > >> 2017-02-24 15:02 GMT+01:00 Svetlin Zarev > <svetlin.angelov.zarev@gmail. > > > com > > > >> >: > > > >> > > > >> > I have a DynamicDeployer that creates the Resource objects for the > > > >> > datasources and the ConvertDataSourceDefinitions deployer does the > > > >> (almost) > > > >> > same thing, so I want to remove it from the chain > > > >> > > > > >> > 2017-02-24 15:56 GMT+02:00 Romain Manni-Bucau < > > [email protected] > > > >: > > > >> > > > > >> > > Hi > > > >> > > > > > >> > > what's the actual goal? (= why do you need to extend > > > >> > ConfigurationFactory?) > > > >> > > Wonder if an event can't solve it if not already there. > > > >> > > > > > >> > > > > > >> > > Romain Manni-Bucau > > > >> > > @rmannibucau <https://twitter.com/rmannibucau> | Blog > > > >> > > <https://blog-rmannibucau.rhcloud.com> | Old Blog > > > >> > > <http://rmannibucau.wordpress.com> | Github < > https://github.com/ > > > >> > > rmannibucau> | > > > >> > > LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE > > Factory > > > >> > > <https://javaeefactory-rmannibucau.rhcloud.com> > > > >> > > > > > >> > > 2017-02-24 14:54 GMT+01:00 Svetlin Zarev > > > <svetlin.angelov.zarev@gmail. > > > >> > com > > > >> > > >: > > > >> > > > > > >> > > > Hello, > > > >> > > > > > > >> > > > I want to subclass the org.apache.openejb.config.Conf > > > >> igurationFactory > > > >> > > > class > > > >> > > > in order to customize the deployer chain. Unfortunately the > > chain > > > is > > > >> > > > constructed inside ConfigurationFactory(offline, > > > >> preAutoConfigDeployer) > > > >> > > > constructor, so when I use the ConfigurationFactory(offline, > > > >> > > deployerChain, > > > >> > > > configuration) constructor I have to copy-paste a huge portion > > of > > > >> the > > > >> > > code > > > >> > > > that initializes the deployer chain. Hence my suggestion: It > > would > > > >> be > > > >> > > great > > > >> > > > if the code that initializes the deployer chain is extracted > in > > a > > > >> > > protected > > > >> > > > method that initializes the passed Chain -> protected void > > > >> > > > initDeployerChain(Chain chain). In that way subclasses can > reuse > > > >> that > > > >> > > code > > > >> > > > while being able to painlessly add/remove dynamic deployers. > > > >> > > > > > > >> > > > Kind regards, > > > >> > > > Svetlin > > > >> > > > > > > >> > > > > > >> > > > > >> > > > > > > > > > > > > > >
