TomEE default service providers

2016-06-27 Thread Svetlin Zarev
Hello, Let’s assume that I have an object: org.example.ExampleObject and a service provider: org.example.ExampleObjectProvider The service provider has a service-jar.xml: Can I register that service provider to be the *default* service provider for ExampleObject objects withou

Re: TomEE default service providers

2016-06-27 Thread Romain Manni-Bucau
Hi there are two things: 1. being able to inherit from default to auto configure a declared object (this is doable using plain new Template API or old service-provider) 2. being able to declare on the fly resources (this requires you to write a small openejb observer to add resources before they

Re: TomEE default service providers

2016-06-27 Thread Svetlin Zarev
HI, Are there any resources for the Template API ? I was not able to find any. > your custom tomee.xml you would write in this observer Generating a tomee.xml on the fly (or any other declaration of the resources) is not an option, because the resources are not known at that time. I cannot know

Re: TomEE default service providers

2016-06-27 Thread Romain Manni-Bucau
2016-06-27 16:23 GMT+02:00 Svetlin Zarev : > HI, > > Are there any resources for the Template API ? I was not able to find any. > > Javadoc mainly: https://github.com/apache/tomee/blob/master/container/openejb-api/src/main/java/org/apache/openejb/api/resource/Template.java here is a sample https:

Re: TomEE default service providers

2016-06-28 Thread Svetlin Zarev
Hi, >Oh I see, then Template can be set as a component using the fully qualified name: The Template API is very nice, but the AutoConfig deployer fails too early if it cannot find a service provider and hence the template is never invoked. But while digging through it, I found that AutoConfig::au

Re: TomEE default service providers

2016-06-28 Thread Romain Manni-Bucau
2016-06-28 10:56 GMT+02:00 Svetlin Zarev : > Hi, > > >Oh I see, then Template can be set as a component using the fully > qualified > name: > > The Template API is very nice, but the AutoConfig deployer fails too early > if it cannot find a service provider and hence the template is never > invoke

Re: TomEE default service providers

2016-06-28 Thread Svetlin Zarev
> if you speak about the service-provider system property ( > openejb.provider.default) to override defaults and service-jar.xml: it is > stable That's great. > if you speak about the class: internal (i'd like to kill it to bind it to > the container instance and not keep it global to be honest bu

Re: TomEE default service providers

2016-06-28 Thread Romain Manni-Bucau
The only issue doing it I know - but can be fine for you - is you break in embedded mode, ie you need to override few services like security service and default datasources JdbcUrl if used to switch between openejb and tomcat implementations depending tomcat part of tomee is in used or not. This is