You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by Romain Manni-Bucau <rm...@gmail.com> on 2012/02/13 22:12:15 UTC

info maven plugin?

Idea: dump info tree in a file in the app at build time (mvn for the first
version) then at runtime simply read this file (skip scanning etc...)

Starting code:
https://svn.apache.org/repos/asf/openejb/trunk/maven-plugins/info-maven-plugin/

Still need a lot of enhancement but any help/ideas are welcome ;)

Current issues:
1) what to do about paths -> override them after having read the info tree?
2) how to replace all the info tree in the current core, it seems it is not
so easy (to do so for EJBContainers and TomEE for instance since the API
usage is different), any preferred place for such a change?

- Romain

Re: info maven plugin?

Posted by Romain Manni-Bucau <rm...@gmail.com>.
went a step further trying to manage the path of the module.

the point i don't really know if about resources, we probably need a
special thing for it: jndi names are not more correct when re-reading the
conf.

containers should be updated too.

Note: to be able to use xml as format for th einfo tree i had to add some
jaxb annotation to EjbJarInfo (List<EnterpriseBeanInfo> needs inheritance
informations to be unmarshable), i'm not sure such a change is ok or not

- Romain


2012/2/13 Romain Manni-Bucau <rm...@gmail.com>

> Idea: dump info tree in a file in the app at build time (mvn for the first
> version) then at runtime simply read this file (skip scanning etc...)
>
> Starting code:
> https://svn.apache.org/repos/asf/openejb/trunk/maven-plugins/info-maven-plugin/
>
> Still need a lot of enhancement but any help/ideas are welcome ;)
>
> Current issues:
> 1) what to do about paths -> override them after having read the info tree?
> 2) how to replace all the info tree in the current core, it seems it is
> not so easy (to do so for EJBContainers and TomEE for instance since the
> API usage is different), any preferred place for such a change?
>
> - Romain
>

Re: info maven plugin?

Posted by David Blevins <da...@gmail.com>.
On Feb 13, 2012, at 1:12 PM, Romain Manni-Bucau wrote:

> Idea: dump info tree in a file in the app at build time (mvn for the first
> version) then at runtime simply read this file (skip scanning etc...)
> 
> Starting code:
> https://svn.apache.org/repos/asf/openejb/trunk/maven-plugins/info-maven-plugin/
> 
> Still need a lot of enhancement but any help/ideas are welcome ;)
> 
> Current issues:
> 1) what to do about paths -> override them after having read the info tree?

Something like that.  

All the paths are in variables called "path" and only contained in AppInfo and the various "module infos" like ClientInfo.  So it would be easy to iterate over them and fix them.

Maybe we turn all the module paths into URI strings and make them relative to the AppInfo path (in URI form).  Then once that loop is finished, we turn AppInfo.path to null.

On the read part, we create a URI for what would be the AppInfo.path, iterate over all the module paths and resolve them relative to the AppInfo URI, turn each one into an absolute file path, then finally set the appInfo.path as an absolute file path from the main URI.

> 2) how to replace all the info tree in the current core, it seems it is not
> so easy (to do so for EJBContainers and TomEE for instance since the API
> usage is different), any preferred place for such a change?

I don't really see a good way to support it in the EJBContainer API.  The only simple way would seem to be a property that points to the module where we would find a META-INF/app-info.xml.  If that was there we'd skip all the other logic and go straight to the assembler part.

-David