You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by Jonathan Gallimore <jo...@gmail.com> on 2008/09/08 22:50:40 UTC

Re: OpenEJB Eclipse Plugin update

I've managed to hack something up around this - basically it uses JDT to 
parse the necessary Singletons, and then walks through the PreDestroy 
and PostContruct methods looking for method invocations. Its pretty 
basic at the moment, it does a complete search on every build, rather 
than building incrementally. It does work recursively, and will visit 
other classes (if you make a call like new MyOtherClass().someMethod() 
in the PreDestroy/PostConstruct method for example), so its potentially 
a long running operation. It will mark incorrect / missing uses of 
@DependsOn as errors.

I've checked it in, but left it to be switched off by default. I'm 
planning to add quick fix and incremental build support soon too.

Any comments are welcome. I'm also happy to have a go at providing this 
in IntelliJ if that would be useful to anyone.

Jon


David Blevins wrote:
>
> On Aug 7, 2008, at 9:11 AM, Karan Malhi wrote:
>
>>>
>>> I think OPENEJB-516 (https://issues.apache.org/jira/browse/OPENEJB-516)
>>> can be closed, as the plugin will now add the javaee-api and 
>>> openejb-client
>>> JARs to the classpath of projects associated with its runtime - does 
>>> anyone
>>> have any thoughts on this?
>>>
>>> I also think OPENEJB-525 (
>>> https://issues.apache.org/jira/browse/OPENEJB-525) can be closed as the
>>> plugin is now built with Maven.
>>>
>>
>> Yes, these issues should be closed.
>> Also, I think David just implemented the DependsOn functionality. 
>> What do
>> you think about generating a dependency graph in eclipse? i.e the plugin
>> could scrape through the EJB's / descriptors and generate this graph 
>> (which
>> could possibly also be modified).
>
> Along those lines what would be really cool is if the tool could add 
> the @DependsOn automatically for a user.
>
> A singleton needs a @DependsOn declaration only when referring to 
> (invoking) another singleton in either its @PostConstruct or 
> @PreDestroy method.  I don't know if it's possible, but if there was 
> some way spot that and add the @DependsOn for them, that'd be really 
> cool.
>
> As an example, the bean has this:
>
> @Singleton
> @Startup
> public class RedBean {
>
>   @EJB(beanName="BlueBean")
>   private BlueLocal blue
>
>   @PostConstruct
>   public void startup() {
>
>   }
> }
>
> and all is fine, but when they add this to the @PostConstruct method...
>
>   @PostConstruct
>   public void startup() {
>       blue.doSomeWork();
>   }
>
> At that point you need to add the @DependsOn like so:
>
> @Singleton
> @Startup
> @DependsOn("BlueBean")
> public class RedBean {
>    ...
> }
>
> Don't know if that's possible, but would be cool.
>
> -David
>


Re: OpenEJB Eclipse Plugin update

Posted by Jonathan Gallimore <jo...@gmail.com>.
Thanks David. I'll get some info up on the Wiki about this. I could 
probably make an inspection for IntelliJ that does this as well, if 
anyone would find that helpful.

Jon

David Blevins wrote:
>
> On Sep 8, 2008, at 1:50 PM, Jonathan Gallimore wrote:
>
>> I've managed to hack something up around this - basically it uses JDT 
>> to parse the necessary Singletons, and then walks through the 
>> PreDestroy and PostContruct methods looking for method invocations. 
>> Its pretty basic at the moment, it does a complete search on every 
>> build, rather than building incrementally. It does work recursively, 
>> and will visit other classes (if you make a call like new 
>> MyOtherClass().someMethod() in the PreDestroy/PostConstruct method 
>> for example), so its potentially a long running operation. It will 
>> mark incorrect / missing uses of @DependsOn as errors.
>>
>> I've checked it in, but left it to be switched off by default. I'm 
>> planning to add quick fix and incremental build support soon too.
>
> This is completely awesome!
>
> -David
>


Re: OpenEJB Eclipse Plugin update

Posted by David Blevins <da...@visi.com>.
On Sep 8, 2008, at 1:50 PM, Jonathan Gallimore wrote:

> I've managed to hack something up around this - basically it uses  
> JDT to parse the necessary Singletons, and then walks through the  
> PreDestroy and PostContruct methods looking for method invocations.  
> Its pretty basic at the moment, it does a complete search on every  
> build, rather than building incrementally. It does work recursively,  
> and will visit other classes (if you make a call like new  
> MyOtherClass().someMethod() in the PreDestroy/PostConstruct method  
> for example), so its potentially a long running operation. It will  
> mark incorrect / missing uses of @DependsOn as errors.
>
> I've checked it in, but left it to be switched off by default. I'm  
> planning to add quick fix and incremental build support soon too.

This is completely awesome!

-David


Re: OpenEJB Eclipse Plugin update

Posted by "Daniel S. Haischt" <da...@googlemail.com>.
yes an all-in-one package

On Thu, Sep 25, 2008 at 12:45 PM, Jonathan Gallimore
<jo...@gmail.com> wrote:
> You mean like an 'all-in-one' package? I like the idea. I think it might be
> a lot of work to create it for shapshots, but its something I think is
> worthwhile doing when we release, or put up some betas :)
>
> Jon
>
>
> Daniel S. Haischt wrote:
>>
>> crazy idea probably but I post it anyway...
>>
>> Was remembering the guy who was asking recently how to setup Eclipse
>> to develop EJBs etc. ...
>>
>> Do you think it would make sense to create an Eclipse product
>> configuration that contains the WTP
>> and any other required plugin/feature required to develop OpenEJB
>> based apps including our OpenEJB
>> plugin stuff which then can be downloaded as a zipped product?
>>
>> The product would be of course just a re-branded Eclipse SDK.
>>
>> On Wed, Sep 24, 2008 at 7:47 PM, Jonathan Gallimore
>> <jo...@gmail.com> wrote:
>>
>>>
>>> I've just committed this and updated the update site. There's a tick box
>>> to
>>> include the dependency when creating / editing the runtime.
>>>
>>> Jon
>>>
>>> David Blevins wrote:
>>>
>>>>
>>>> On Sep 9, 2008, at 4:47 AM, Jonathan Gallimore wrote:
>>>>
>>>>
>>>>>
>>>>> I also forgot to mention - I think it would be useful to have an option
>>>>> to include the 3.1 experimental jars on a project. I don't think
>>>>> Eclipse WTP
>>>>> has any 3.1 support yet, but we could just add it as an option on our
>>>>> runtime configuration panel. Does anyone have any objections or other
>>>>> thoughts?
>>>>>
>>>>
>>>> No objections here.  I think it will be good to give people the option
>>>> to
>>>> pull in that dep easily.
>>>>
>>>> -David
>>>>
>>>>
>>>
>>>
>
>

Re: OpenEJB Eclipse Plugin update

Posted by Jonathan Gallimore <jo...@gmail.com>.
You mean like an 'all-in-one' package? I like the idea. I think it might 
be a lot of work to create it for shapshots, but its something I think 
is worthwhile doing when we release, or put up some betas :)

Jon


Daniel S. Haischt wrote:
> crazy idea probably but I post it anyway...
>
> Was remembering the guy who was asking recently how to setup Eclipse
> to develop EJBs etc. ...
>
> Do you think it would make sense to create an Eclipse product
> configuration that contains the WTP
> and any other required plugin/feature required to develop OpenEJB
> based apps including our OpenEJB
> plugin stuff which then can be downloaded as a zipped product?
>
> The product would be of course just a re-branded Eclipse SDK.
>
> On Wed, Sep 24, 2008 at 7:47 PM, Jonathan Gallimore
> <jo...@gmail.com> wrote:
>   
>> I've just committed this and updated the update site. There's a tick box to
>> include the dependency when creating / editing the runtime.
>>
>> Jon
>>
>> David Blevins wrote:
>>     
>>> On Sep 9, 2008, at 4:47 AM, Jonathan Gallimore wrote:
>>>
>>>       
>>>> I also forgot to mention - I think it would be useful to have an option
>>>> to include the 3.1 experimental jars on a project. I don't think Eclipse WTP
>>>> has any 3.1 support yet, but we could just add it as an option on our
>>>> runtime configuration panel. Does anyone have any objections or other
>>>> thoughts?
>>>>         
>>> No objections here.  I think it will be good to give people the option to
>>> pull in that dep easily.
>>>
>>> -David
>>>
>>>       
>>     


Re: OpenEJB Eclipse Plugin update

Posted by "Daniel S. Haischt" <da...@googlemail.com>.
crazy idea probably but I post it anyway...

Was remembering the guy who was asking recently how to setup Eclipse
to develop EJBs etc. ...

Do you think it would make sense to create an Eclipse product
configuration that contains the WTP
and any other required plugin/feature required to develop OpenEJB
based apps including our OpenEJB
plugin stuff which then can be downloaded as a zipped product?

The product would be of course just a re-branded Eclipse SDK.

On Wed, Sep 24, 2008 at 7:47 PM, Jonathan Gallimore
<jo...@gmail.com> wrote:
> I've just committed this and updated the update site. There's a tick box to
> include the dependency when creating / editing the runtime.
>
> Jon
>
> David Blevins wrote:
>>
>> On Sep 9, 2008, at 4:47 AM, Jonathan Gallimore wrote:
>>
>>> I also forgot to mention - I think it would be useful to have an option
>>> to include the 3.1 experimental jars on a project. I don't think Eclipse WTP
>>> has any 3.1 support yet, but we could just add it as an option on our
>>> runtime configuration panel. Does anyone have any objections or other
>>> thoughts?
>>
>> No objections here.  I think it will be good to give people the option to
>> pull in that dep easily.
>>
>> -David
>>
>
>

Re: OpenEJB Eclipse Plugin update

Posted by Jonathan Gallimore <jo...@gmail.com>.
I've just committed this and updated the update site. There's a tick box 
to include the dependency when creating / editing the runtime.

Jon

David Blevins wrote:
>
> On Sep 9, 2008, at 4:47 AM, Jonathan Gallimore wrote:
>
>> I also forgot to mention - I think it would be useful to have an 
>> option to include the 3.1 experimental jars on a project. I don't 
>> think Eclipse WTP has any 3.1 support yet, but we could just add it 
>> as an option on our runtime configuration panel. Does anyone have any 
>> objections or other thoughts?
>
> No objections here.  I think it will be good to give people the option 
> to pull in that dep easily.
>
> -David
>


Re: OpenEJB Eclipse Plugin update

Posted by David Blevins <da...@visi.com>.
On Sep 9, 2008, at 4:47 AM, Jonathan Gallimore wrote:

> I also forgot to mention - I think it would be useful to have an  
> option to include the 3.1 experimental jars on a project. I don't  
> think Eclipse WTP has any 3.1 support yet, but we could just add it  
> as an option on our runtime configuration panel. Does anyone have  
> any objections or other thoughts?

No objections here.  I think it will be good to give people the option  
to pull in that dep easily.

-David


Re: OpenEJB Eclipse Plugin update

Posted by Jonathan Gallimore <jo...@gmail.com>.
I also forgot to mention - I think it would be useful to have an option 
to include the 3.1 experimental jars on a project. I don't think Eclipse 
WTP has any 3.1 support yet, but we could just add it as an option on 
our runtime configuration panel. Does anyone have any objections or 
other thoughts?

Jon

Jonathan Gallimore wrote:
> I've managed to hack something up around this - basically it uses JDT 
> to parse the necessary Singletons, and then walks through the 
> PreDestroy and PostContruct methods looking for method invocations. 
> Its pretty basic at the moment, it does a complete search on every 
> build, rather than building incrementally. It does work recursively, 
> and will visit other classes (if you make a call like new 
> MyOtherClass().someMethod() in the PreDestroy/PostConstruct method for 
> example), so its potentially a long running operation. It will mark 
> incorrect / missing uses of @DependsOn as errors.
>
> I've checked it in, but left it to be switched off by default. I'm 
> planning to add quick fix and incremental build support soon too.
>
> Any comments are welcome. I'm also happy to have a go at providing 
> this in IntelliJ if that would be useful to anyone.
>
> Jon
>
>