You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by "rniamo@gmail.com" <rn...@gmail.com> on 2011/03/24 19:07:03 UTC
Re : EJB 3.1 Embedded Container API and the examples
Hi,
Filtering urls/dependencies is probably faster than packages, no?
However i think the ejb-jar approach could still be used/activated by configuration, it is really a pretty nive feature but it can't be the default one today, your proposal looks nice as the default behavior.
- Romain
----- Reply message -----
De : "Thiago Veronezi" <th...@veronezi.org>
Date : jeu., mars 24, 2011 18:39
Objet : EJB 3.1 Embedded Container API and the examples
PourĀ : <de...@openejb.apache.org>
Hi, David!
Don't you think that a big ugly warning at startup time with some tips to
the user on how to improve the performance can do the job? This way we keep
the "ejb-jar.xml" (I love this one!), the "go through all classes" and the
"by package" approaches.
[]s,
Thiago.
On Tue, Mar 22, 2011 at 5:34 PM, David Blevins <da...@gmail.com>wrote:
> Currently all our examples use the OpenEJB-specific InitialContext
> approach. The main reason is that the Embedded API implementation is quite
> a bit different and it isn't possible to switch from one to the other
> without changes.
>
> One of the tricks to making them the same is that there is a spec defined
> difference in default scanning behavior. Our legacy default is to require
> ejb-jar.xml files (performance minded). The spec approach is to not require
> descriptors (several times slower).
>
> I was aware of this difference when we (the EG) made that rule, but was
> confident we (us here) could probably find some pragmatic compromise.
>
> Here's my thoughts on that...
>
> The spec doesn't require that even things like the VM classes have to be
> scanned. This would be quite silly and definitely was not the intention of
> the "no descriptors required" rule. So somewhere between everything and
> nothing is fair game. A reasonable default that makes most people happy is
> all we need. But what would that be?
>
> With the package based filtering that we [will shortly] have we can switch
> from classpath based filtering and probably wind up with something that is
> way better. The user can specify the packages they want us to scan. In the
> event that no packages are specified, the bootstrapper (EJBContainer or
> IntialContext) will throw and catch an exception in initialization, which is
> triggered by user code, and *collect* the packages. Those will be your
> defaults.
>
> We can probably continue to filter out some packages (org.apache.openejb.,
> javax., etc.) and maybe even chop the remaining packages down to two
> components "org.foo" so that we still have a nice and wide default
> namespace. If people want to go wider or more narrow than that, they can
> take some explicit configuration action.
>
> Thoughts?
>
>
>
> -David
>
>
>
>
Re: Re : EJB 3.1 Embedded Container API and the examples
Posted by David Blevins <da...@gmail.com>.
On Mar 24, 2011, at 11:07 AM, rniamo@gmail.com wrote:
> Hi,
>
> Filtering urls/dependencies is probably faster than packages, no?
The straight "require xml files" is the fastest, definitely. With a class matching pattern like ".*Bean" it would be even faster. I definitely like this approach as well.
The classpath filtering logic as it exists now is pretty slow. Well strictly speaking it's all the built-in excludes we add that are slow. Once you have more than a few regular expressions, evaluating them starts to really cost. We can probably improve that as well. We should be able to reuse the include/exclude logic now in xbean-finder and have it then be completely consistent for filtering classpaths as well as classes.
> However i think the ejb-jar approach could still be used/activated by configuration, it is really a pretty nive feature but it can't be the default one today, your proposal looks nice as the default behavior.
Crossing my fingers it works as well as I hope :)
> ----- Reply message -----
> De : "Thiago Veronezi" <th...@veronezi.org>
> Date : jeu., mars 24, 2011 18:39
> Objet : EJB 3.1 Embedded Container API and the examples
> Pour : <de...@openejb.apache.org>
>
> Hi, David!
> Don't you think that a big ugly warning at startup time with some tips to
> the user on how to improve the performance can do the job? This way we keep
> the "ejb-jar.xml" (I love this one!), the "go through all classes" and the
> "by package" approaches.
We have some timers and flags in there now. We can keep that and complain about any slowness.
As far as ignoring modules that don't have an ejb-jar.xml, we can't do that anymore ... by default at least. We can certainly make it easy to turn on.
-David