Hi Romain and Alan :) I didn't say ever to not use XML or a simple file, which what I meant by the declarative side, what I mean is additionally to that, at the time of deploy that out of that file Java code is generated which provides the information we need while scanning and thats what I meant by the execution/runtime perspective.
On Wed, Feb 22, 2012 at 8:37 PM, David Blevins <[email protected]>wrote: > Additional note that the ultimate goal of the scan.xml file is to provide > something that could be standardized. There is interest for having a more > general solution. > > This probably affects the scan.xml file itself, the plugin could live > anywhere (I'd imagined we'd eventually put it in xbean). > > Ideally a standard file would be: > > - in META-INF/scan.xml > - list classes and packages > - something a user can create by hand > > Anything that adds xbean/openejb/tomee branding, is not xml, or contains > plugin-specific information would have to be removed from any proposals to > Java EE 7. > > Some things to keep in mind as we discuss. > > > -David > > On Feb 20, 2012, at 2:40 PM, David Blevins wrote: > > > We've chatted occasionally on creating a scanning.xml file where people > could setup includes and excludes and, overall, optimize classpath scanning. > > > > Romain is already busy hacking of course :) Here's the idea for a > plugin to effectively do the most expensive part of scanning in advance: > > > > <plugin> > > <groupId>org.apache.xbean</groupId> > > <artifactId>maven-xbean-finder-plugin</artifactId> > > <configuration> > > <annotations> > > <annotation>javax.ejb.Stateless</annotation> > > <annotation>javax.ejb.Stateful</annotation> > > <annotation>javax.ejb.Singleton</annotation> > > <annotation>javax.annotation.ManagedBean</annotation> > > </annotations> > > <subclasses> > > <subclass>javax.ws.rs.core.Application</subclass> > > </subclasses> > > <implementations> > > > <implementation>org.apache.openejb.server.ServerService</implementation> > > </implementations> > > </configuration> > > </plugin> > > > > With a configuration like the above, the plugin would scan the jar for > subclasses of javax.ws.rs.core.Application, classes annotated with > @Stateless, @Singleton, @Stateful and classes that implement ServiceService. > > > > The result would be a META-INF/scan.xml class that looks like so: > > > > <scan> > > <classes> > > <class>org.superbiz.Foo</class> > > <class>org.superbiz.Bar</class> > > <class>org.superbiz.Baz</class> > > </classes> > > </scan> > > > > And on the TODO list would be future support for <packages> > > > > <scan> > > <packages> > > <package>org.superbiz.foo</package> > > <package>org.superbiz.bar</package> > > </packages> > > </scan> > > > > With the above you could easily create scan.xml file by hand that would > at least be far faster than scanning an entire jar. > > > > > > Thoughts? > > > > > > -David > > > > -- Thanks - Mohammad Nour ---- "Life is like riding a bicycle. To keep your balance you must keep moving" - Albert Einstein
