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 what resources they have declared in their web.xml/web-fragment.xmls or through annotations. Basically I need a mechanism to tell tomee to create a resource using a "default" object factory/service provider for every resource that does not have an explicit one set. Kind regards, Svetlin 2016-06-27 15:33 GMT+03:00 Romain Manni-Bucau <[email protected]>: > 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 get created. this can > be done observing AssemblerCreated event and overriding openejb.conf.file > to point on your custom tomee.xml you would write in this observer, > alternative is to set system properties for resources using properties > syntax) > > > > > Romain Manni-Bucau > @rmannibucau <https://twitter.com/rmannibucau> | Blog > <https://blog-rmannibucau.rhcloud.com> | Old Wordpress Blog > <http://rmannibucau.wordpress.com> | Github < > https://github.com/rmannibucau> | > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber > <http://www.tomitribe.com> | JavaEE Factory > <https://javaeefactory-rmannibucau.rhcloud.com> > > 2016-06-27 14:19 GMT+02:00 Svetlin Zarev <[email protected] > >: > > > 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: > > > > > > > > <ServiceJar> > > <ServiceProvider id= > > *"Default ExampleObject Provider" *service= > > *"Resource" *types= > > *"org.example.ExampleObject" *class-name= > > *"org.example.ExampleObjectProvider" *factory-name= > > *"provide" *constructor=*"ServiceId"*> > > </ServiceProvider> > > </ServiceJar> > > > > > > > > Can I register that service provider to be the *default* service provider > > for ExampleObject objects without having to declare every single > > ExampleObject resource in tome.xml/resource.xml ? In other words – I want > > it to behave exactly like the default service-providers (for instance > like > > the javax.sql.DataSource provider) declared in > > org.apache.openejb/service-jar.xml. > > > > > > > > Kind regards, > > > > Svetlin > > >
