You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by David Blevins <da...@visi.com> on 2010/06/02 23:18:20 UTC

New AnnotationDeployer (was Re: svn commit: r950412)

On Jun 2, 2010, at 1:01 AM, djencks@apache.org wrote:

> Author: djencks
> Date: Wed Jun  2 08:01:03 2010
> New Revision: 950412
> 
> URL: http://svn.apache.org/viewvc?rev=950412&view=rev
> Log:
> Use BundleAnnotationFinder in an osgi environment
> 
> Added:
>    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/AbstractAnnotationDeployer.java   (with props)
>    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/BundleAnnotationDeployer.java
>      - copied, changed from r948270, openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java

A heads-up would be good on a deep change like this.  I know Ivan and Matthew are both about a week into iterative changes to AnnotationDeployer.  I'm probably not much better :)

Any details on the basic difference (code wise), between AnnotationDeployer and BundleAnnotationDeployer?  (going to be an hour or two before I get the chance to take a good look).


-David


Re: New AnnotationDeployer (was Re: svn commit: r950412)

Posted by David Blevins <da...@visi.com>.
On Jun 2, 2010, at 3:23 PM, David Jencks wrote:

> 
> On Jun 2, 2010, at 3:16 PM, David Blevins wrote:
> 
>> Cool.  Might see if I can rework it to a smaller change (primarily for patching and for merging to 3.1.x ease).  With the AbstractFinder abstraction, seems like we don't need to abstract the entire AnnotationDeployer, just the part that creates the finder.
> 
> Since you mentioned that there might be another way to do this, I realize it would work at least as well to put the abstract methods in a FinderFactory and inject it.  Not sure if I'll get to changing it today && will be out till probably monday..... go ahead if you think it's a good idea or if you have another way to do this.

Took a shot at a factory that creates the finder.  It basically always tries to use the OSGi approach whenever possible and falls back to the plain classpath scrape way if the app isn't a bundle.

I put the BundleFinderFactory in a new osgi module that we'll need to use on the G-side.  I didn't put it in the existing openejb-osgi module as that one has an Activator in it that I don't think G wants activated.  I'm not a whiz at the manifest stuff so that part is still a todo.

-David


Re: New AnnotationDeployer (was Re: svn commit: r950412)

Posted by David Jencks <da...@yahoo.com>.
On Jun 2, 2010, at 3:16 PM, David Blevins wrote:

> 
> On Jun 2, 2010, at 2:57 PM, David Jencks wrote:
> 
>> 
>> On Jun 2, 2010, at 2:18 PM, David Blevins wrote:
>> 
>>> 
>>> On Jun 2, 2010, at 1:01 AM, djencks@apache.org wrote:
>>> 
>>>> Author: djencks
>>>> Date: Wed Jun  2 08:01:03 2010
>>>> New Revision: 950412
>>>> 
>>>> URL: http://svn.apache.org/viewvc?rev=950412&view=rev
>>>> Log:
>>>> Use BundleAnnotationFinder in an osgi environment
>>>> 
>>>> Added:
>>>> openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/AbstractAnnotationDeployer.java   (with props)
>>>> openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/BundleAnnotationDeployer.java
>>>>   - copied, changed from r948270, openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java
>>> 
>>> A heads-up would be good on a deep change like this.  I know Ivan and Matthew are both about a week into iterative changes to AnnotationDeployer.  I'm probably not much better :)
>> 
>> This seemed to me like a minor refactoring.  For AnnotationDeployer all the code except the creation of the actual module-wide Finder is moved unchanged into AbstractAnnotationDeployer, so it can be shared by a bundle-based approach.  I guess if you are actually working on the class it might not seem that way to you :-(
> 
> Hehe.  On a scale from 1 to 10, this counts as a "awe who really cares enough to give it a number anyway" ;)
> 
>>> Any details on the basic difference (code wise), between AnnotationDeployer and BundleAnnotationDeployer?  (going to be an hour or two before I get the chance to take a good look).
>>> 
>> 
>> The only real difference is whether you use a classloader based ClassFinder or a bundle based BundleAnnotationFinder.  The openejb classes only use the methods implemented in the common AbstractFinder superclass.  In Openejb all the functionality is in the AbstractAnnotationDeployer class which is the same as the old AnnotationDeployer except for abstracting out creating the actual Finders.
> 
> Cool.  Might see if I can rework it to a smaller change (primarily for patching and for merging to 3.1.x ease).  With the AbstractFinder abstraction, seems like we don't need to abstract the entire AnnotationDeployer, just the part that creates the finder.

Since you mentioned that there might be another way to do this, I realize it would work at least as well to put the abstract methods in a FinderFactory and inject it.  Not sure if I'll get to changing it today && will be out till probably monday..... go ahead if you think it's a good idea or if you have another way to do this.

thanks
david jencks

> 
> Anyway, still a good change!
> 
> Thanks, David!
> 
> 
> -David
> 


Re: New AnnotationDeployer (was Re: svn commit: r950412)

Posted by David Blevins <da...@visi.com>.
On Jun 2, 2010, at 2:57 PM, David Jencks wrote:

> 
> On Jun 2, 2010, at 2:18 PM, David Blevins wrote:
> 
>> 
>> On Jun 2, 2010, at 1:01 AM, djencks@apache.org wrote:
>> 
>>> Author: djencks
>>> Date: Wed Jun  2 08:01:03 2010
>>> New Revision: 950412
>>> 
>>> URL: http://svn.apache.org/viewvc?rev=950412&view=rev
>>> Log:
>>> Use BundleAnnotationFinder in an osgi environment
>>> 
>>> Added:
>>>  openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/AbstractAnnotationDeployer.java   (with props)
>>>  openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/BundleAnnotationDeployer.java
>>>    - copied, changed from r948270, openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java
>> 
>> A heads-up would be good on a deep change like this.  I know Ivan and Matthew are both about a week into iterative changes to AnnotationDeployer.  I'm probably not much better :)
> 
> This seemed to me like a minor refactoring.  For AnnotationDeployer all the code except the creation of the actual module-wide Finder is moved unchanged into AbstractAnnotationDeployer, so it can be shared by a bundle-based approach.  I guess if you are actually working on the class it might not seem that way to you :-(

Hehe.  On a scale from 1 to 10, this counts as a "awe who really cares enough to give it a number anyway" ;)

>> Any details on the basic difference (code wise), between AnnotationDeployer and BundleAnnotationDeployer?  (going to be an hour or two before I get the chance to take a good look).
>> 
> 
> The only real difference is whether you use a classloader based ClassFinder or a bundle based BundleAnnotationFinder.  The openejb classes only use the methods implemented in the common AbstractFinder superclass.  In Openejb all the functionality is in the AbstractAnnotationDeployer class which is the same as the old AnnotationDeployer except for abstracting out creating the actual Finders.

Cool.  Might see if I can rework it to a smaller change (primarily for patching and for merging to 3.1.x ease).  With the AbstractFinder abstraction, seems like we don't need to abstract the entire AnnotationDeployer, just the part that creates the finder.

Anyway, still a good change!

Thanks, David!


-David


Re: New AnnotationDeployer (was Re: svn commit: r950412)

Posted by David Jencks <da...@yahoo.com>.
On Jun 2, 2010, at 2:18 PM, David Blevins wrote:

> 
> On Jun 2, 2010, at 1:01 AM, djencks@apache.org wrote:
> 
>> Author: djencks
>> Date: Wed Jun  2 08:01:03 2010
>> New Revision: 950412
>> 
>> URL: http://svn.apache.org/viewvc?rev=950412&view=rev
>> Log:
>> Use BundleAnnotationFinder in an osgi environment
>> 
>> Added:
>>   openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/AbstractAnnotationDeployer.java   (with props)
>>   openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/BundleAnnotationDeployer.java
>>     - copied, changed from r948270, openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java
> 
> A heads-up would be good on a deep change like this.  I know Ivan and Matthew are both about a week into iterative changes to AnnotationDeployer.  I'm probably not much better :)

This seemed to me like a minor refactoring.  For AnnotationDeployer all the code except the creation of the actual module-wide Finder is moved unchanged into AbstractAnnotationDeployer, so it can be shared by a bundle-based approach.  I guess if you are actually working on the class it might not seem that way to you :-(

> 
> Any details on the basic difference (code wise), between AnnotationDeployer and BundleAnnotationDeployer?  (going to be an hour or two before I get the chance to take a good look).
> 

The only real difference is whether you use a classloader based ClassFinder or a bundle based BundleAnnotationFinder.  The openejb classes only use the methods implemented in the common AbstractFinder superclass.  In Openejb all the functionality is in the AbstractAnnotationDeployer class which is the same as the old AnnotationDeployer except for abstracting out creating the actual Finders.

thanks
david jencks



> 
> -David
>