Re: [hibernate-dev] Suggestions for alternative due to deprecation of Configuration access in ServiceContributor...

2018-05-23 Thread Steve Ebersole
By "read only" I assume you mean immutable (aka,
Collections#immutableMap)?  If so, sure, that is a decent solution...


On Wed, May 23, 2018 at 7:55 AM Scott Marlow  wrote:

> For the WildFly use of ServiceContributor [1], which registers for each
> SF/EMF, the 2lc RegionFactoryInitiator + JtaPlatform, I am worried that
> we don't yet have a "per app deployment" way to disable the WF
> ServiceContributorImpl.
>
> I'm thinking that some applications (e.g. Spring) may not want to use
> the WF 2lc RegionFactoryInitiator + JtaPlatform classes.  To accomadate
> that need, I'm thinking of introducing WF configuration properties for
> controlling this:
>
> * wildfly.jpa.jtaplatform will default to true but if set to false, [1]
> will not call serviceRegistryBuilder.addInitiator(new
> WildFlyCustomJtaPlatformInitiator()).
>
> * wildfly.jpa.regionfactory will default to true but if set to false,
> [1] will not call serviceRegistryBuilder.addInitiator(new
> WildFlyCustomRegionFactoryInitiator()).
>
> My request is that we keep the
> StandardServiceRegistryBuilder.getSettings() call and document that in
> the future, instead of removing it, we will change it to return a read
> only copy of the configuration settings.  Then, I can update [1] to
> check for these new properties and know that I can depend on using
> StandardServiceRegistryBuilder.getSettings().
>
> An alternative could be to add a new method
> StandardServiceRegistryBuilder.getReadOnlySettings().
>
> I'd like to make the WF code change now for WF13, so a quick response is
> appreciated! :)
>
> Scott
>
> [1]
>
> https://github.com/scottmarlow/wildfly/blob/WFLY-10427/jpa/hibernate5_3/src/main/java/org/jboss/as/jpa/hibernate5/service/ServiceContributorImpl.java#L30
> ___
> hibernate-dev mailing list
> hibernate-dev@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev
>
___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev


[hibernate-dev] Suggestions for alternative due to deprecation of Configuration access in ServiceContributor...

2018-05-23 Thread Scott Marlow
For the WildFly use of ServiceContributor [1], which registers for each 
SF/EMF, the 2lc RegionFactoryInitiator + JtaPlatform, I am worried that 
we don't yet have a "per app deployment" way to disable the WF 
ServiceContributorImpl.

I'm thinking that some applications (e.g. Spring) may not want to use 
the WF 2lc RegionFactoryInitiator + JtaPlatform classes.  To accomadate 
that need, I'm thinking of introducing WF configuration properties for 
controlling this:

* wildfly.jpa.jtaplatform will default to true but if set to false, [1] 
will not call serviceRegistryBuilder.addInitiator(new 
WildFlyCustomJtaPlatformInitiator()).

* wildfly.jpa.regionfactory will default to true but if set to false, 
[1] will not call serviceRegistryBuilder.addInitiator(new 
WildFlyCustomRegionFactoryInitiator()).

My request is that we keep the 
StandardServiceRegistryBuilder.getSettings() call and document that in 
the future, instead of removing it, we will change it to return a read 
only copy of the configuration settings.  Then, I can update [1] to 
check for these new properties and know that I can depend on using 
StandardServiceRegistryBuilder.getSettings().

An alternative could be to add a new method 
StandardServiceRegistryBuilder.getReadOnlySettings().

I'd like to make the WF code change now for WF13, so a quick response is 
appreciated! :)

Scott

[1] 
https://github.com/scottmarlow/wildfly/blob/WFLY-10427/jpa/hibernate5_3/src/main/java/org/jboss/as/jpa/hibernate5/service/ServiceContributorImpl.java#L30
___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev