Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AspectJ » confused on how to setup projects
confused on how to setup projects [message #61823] Tue, 14 February 2006 21:52 Go to next message
Barry Kaplan is currently offline Barry KaplanFriend
Messages: 230
Registered: July 2009
Senior Member
I have the following projects:

P1 - contains the aspect below
P2 - contains the class annotated with @Configurable
hibernate.jar - also needs to be weaved (I guess)

For this scenario, what are the AJDT project settings to get a static compile. (I can get load time working just fine, but can't for the life of me figure out how to setup the projects).

thanks!!!!

----
My aspect is:

@Aspect
public class HibernateAwareAnnotationBeanConfigurerAspect extends BeanConfigurerSupport {

@Pointcut(" initialization((@org.springframework.beans.factory.annotatio n.Configurable *).new(..)) && this(beanInstance)")
void beanCreation(Object beanInstance) {}

@Pointcut("execution(* org.hibernate.engine.UnsavedValueFactory.instantiate(..))")
void hibernateUnsavedValueFactory() {}

@AfterReturning("beanCreation(beanInstance) && !cflow(hibernateUnsavedValueFactory())")
public void configure(Object beanInstance) {
configureBean(beanInstance);
}
}
Re: confused on how to setup projects [message #61847 is a reply to message #61823] Tue, 14 February 2006 21:54 Go to previous messageGo to next message
Barry Kaplan is currently offline Barry KaplanFriend
Messages: 230
Registered: July 2009
Senior Member
Here's some better formatting....

@Aspect
public class HibernateAwareAnnotationBeanConfigurerAspect extends
BeanConfigurerSupport {


@Pointcut(" initialization((@org.springframework.beans.factory.annotatio n.Configurable
*).new(..)) && this(beanInstance)")
void beanCreation(Object beanInstance) {}

@Pointcut("execution(*
org.hibernate.engine.UnsavedValueFactory.instantiate(..))")
void hibernateUnsavedValueFactory() {}

@AfterReturning("beanCreation(beanInstance) &&
!cflow(hibernateUnsavedValueFactory())")
public void configure(Object beanInstance) {
configureBean(beanInstance);
}
}
Re: confused on how to setup projects [message #61870 is a reply to message #61847] Tue, 14 February 2006 21:55 Go to previous messageGo to next message
Barry Kaplan is currently offline Barry KaplanFriend
Messages: 230
Registered: July 2009
Senior Member
.... I guess not ....
Re: confused on how to setup projects [message #61894 is a reply to message #61823] Wed, 15 February 2006 13:11 Go to previous messageGo to next message
Matt Chapman is currently offline Matt ChapmanFriend
Messages: 429
Registered: July 2009
Senior Member
Hi Barry,

Things on the inpath get woven by things on the aspectpath.

So to perform the weaving in P1, simply add P2 and hibernate.jar to the
inpath of P1. All of the woven class files will go to the output directory
of P1.

If instead you want to create a woven version of hibernate.jar, create a
new AJ project and put P1 on the aspectpath, the jar on the inpath, and
set the outjar field appropriately to create the new jar, instead of the
class files going to the output directory.

Regards,

Matt.


On Tue, 14 Feb 2006 16:52:40 -0500, Barry Kaplan wrote:
> I have the following projects:
>
> P1 - contains the aspect below
> P2 - contains the class annotated with @Configurable
> hibernate.jar - also needs to be weaved (I guess)
>
> For this scenario, what are the AJDT project settings to get a static compile. (I can get load time working just fine, but can't for the life of me figure out how to setup the projects).
>
> thanks!!!!
>
> ----
> My aspect is:
>
> @Aspect
> public class HibernateAwareAnnotationBeanConfigurerAspect extends BeanConfigurerSupport {
>
> @Pointcut(" initialization((@org.springframework.beans.factory.annotatio n.Configurable *).new(..)) && this(beanInstance)")
> void beanCreation(Object beanInstance) {}
>
> @Pointcut("execution(* org.hibernate.engine.UnsavedValueFactory.instantiate(..))")
> void hibernateUnsavedValueFactory() {}
>
> @AfterReturning("beanCreation(beanInstance) && !cflow(hibernateUnsavedValueFactory())")
> public void configure(Object beanInstance) {
> configureBean(beanInstance);
> }
> }
Re: confused on how to setup projects [message #61948 is a reply to message #61894] Fri, 17 February 2006 13:37 Go to previous messageGo to next message
Barry Kaplan is currently offline Barry KaplanFriend
Messages: 230
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------060005080303020808030903
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Ok, I went with option 2 since the project dependency is from
P2->P1->hibernate.jar.

But I'm getting errors when weaving the hibernate jar
---
Severity Description Resource In Folder Location Creation
Time Id
2 can't determine annotations of missing type
org.apache.tools.ant.taskdefs.MatchingTask
when matching pointcut
(((initialization(@org.springframework.beans.factory.annotat ion.Configurable
*.new(..)) && this(BindingTypePattern(java.lang.Object, 0))) &&
!concretecflow(org.aspectj.runtime.internal.CFlowCounter
org.opentrader.infra.hibernate.HibernateAwareAnnotationBeanC onfigurerAspect.ajc$cflowCounter$0))
&&
persingleton(org.opentrader.infra.hibernate.HibernateAwareAn notationBeanConfigurerAspect))
when matching shadow initialization(void
org.hibernate.tool.hbm2ddl.SchemaExportTask.<init>())
when weaving type org.hibernate.tool.hbm2ddl.SchemaExportTask
when weaving classes
when weaving
when batch building
BuildConfig[Q:\eclipse.workspaces\folio\.metadata\.plugins\o rg.eclipse.ajdt.core\ot-platform-samples.generated.lst]
#Files=16
[Xlint:cantFindType] hibernate-3.1.2.jar
ot-thirdparty/lib/hibernate February 17, 2006 8:34:43 AM 184224
---

My aop.xml contains "<include within="org.hibernate.engine..*"/>". How
can I use the same scope with ajdt, as I can't set the access
restrictions on the class in the inpath?

-barry



However,

Matt Chapman wrote:
> Hi Barry,
>
> Things on the inpath get woven by things on the aspectpath.
>
> So to perform the weaving in P1, simply add P2 and hibernate.jar to the
> inpath of P1. All of the woven class files will go to the output directory
> of P1.
>
> If instead you want to create a woven version of hibernate.jar, create a
> new AJ project and put P1 on the aspectpath, the jar on the inpath, and
> set the outjar field appropriately to create the new jar, instead of the
> class files going to the output directory.
>
> Regards,
>
> Matt.
>
>
> On Tue, 14 Feb 2006 16:52:40 -0500, Barry Kaplan wrote:
>
>> I have the following projects:
>>
>> P1 - contains the aspect below
>> P2 - contains the class annotated with @Configurable
>> hibernate.jar - also needs to be weaved (I guess)
>>
>> For this scenario, what are the AJDT project settings to get a static compile. (I can get load time working just fine, but can't for the life of me figure out how to setup the projects).
>>
>> thanks!!!!
>>
>> ----
>> My aspect is:
>>
>> @Aspect
>> public class HibernateAwareAnnotationBeanConfigurerAspect extends BeanConfigurerSupport {
>>
>> @Pointcut(" initialization((@org.springframework.beans.factory.annotatio n.Configurable *).new(..)) && this(beanInstance)")
>> void beanCreation(Object beanInstance) {}
>>
>> @Pointcut("execution(* org.hibernate.engine.UnsavedValueFactory.instantiate(..))")
>> void hibernateUnsavedValueFactory() {}
>>
>> @AfterReturning("beanCreation(beanInstance) && !cflow(hibernateUnsavedValueFactory())")
>> public void configure(Object beanInstance) {
>> configureBean(beanInstance);
>> }
>> }
>>
>
>


--------------060005080303020808030903
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Ok, I went with option 2 since the project dependency is from
P2-&gt;P1-&gt;hibernate.jar. <br>
<br>
But I'm getting errors when weaving the hibernate jar<br>
---<br>
Severity&nbsp;&nbsp;&nbsp; Description&nbsp;&nbsp;&nbsp; Resource&nbsp;&nbsp;&nbsp; In Folder&nbsp;&nbsp;&nbsp; Location&nbsp;&nbsp;&nbsp;
Creation Time&nbsp;&nbsp;&nbsp; Id<br>
2&nbsp;&nbsp;&nbsp; can't determine annotations of missing type
org.apache.tools.ant.taskdefs.MatchingTask<br>
when matching pointcut
(((initialization(@org.springframework.beans.factory.annotat ion.Configurable
*.new(..)) &amp;&amp; this(BindingTypePattern(java.lang.Object, 0)))
&amp;&amp; !concretecflow(org.aspectj.runtime.internal.CFlowCounter
org.opentrader.infra.hibernate.HibernateAwareAnnotationBeanC onfigurerAspect.ajc$cflowCounter$0))
&amp;&amp;
persingleton(org.opentrader.infra.hibernate.HibernateAwareAn notationBeanConfigurerAspect)) <br>
when matching shadow initialization(void
org.hibernate.tool.hbm2ddl.SchemaExportTask.&lt;init& ;gt;()) <br>
when weaving type org.hibernate.tool.hbm2ddl.SchemaExportTask<br>
when weaving classes <br>
when weaving <br>
when batch building
BuildConfig[Q:\eclipse.workspaces\folio\.metadata\.plugins\o rg.eclipse.ajdt.core\ot-platform-samples.generated.lst]
#Files=16<br>
&nbsp;[Xlint:cantFindType]&nbsp;&nbsp;&nbsp; hibernate-3.1.2.jar&nbsp;&nbsp;&nbsp;
ot-thirdparty/lib/hibernate&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; February 17, 2006 8:34:43 AM&nbsp;&nbsp;&nbsp;
184224<br>
---<br>
<br>
My aop.xml contains&nbsp; "&lt;include
within="org.hibernate.engine..*"/&gt;". How can I use the same scope
with ajdt, as I can't set the access restrictions on the class in the
inpath?<br>
<br>
-barry<br>
<br>
<br>
<br>
However, <br>
<br>
Matt Chapman wrote:
<blockquote cite="midpan.2006.02.15.13.11.44.234642@gmail.com"
type="cite">
<pre wrap="">Hi Barry,

Things on the inpath get woven by things on the aspectpath.

So to perform the weaving in P1, simply add P2 and hibernate.jar to the
inpath of P1. All of the woven class files will go to the output directory
of P1.

If instead you want to create a woven version of hibernate.jar, create a
new AJ project and put P1 on the aspectpath, the jar on the inpath, and
set the outjar field appropriately to create the new jar, instead of the
class files going to the output directory.

Regards,

Matt.


On Tue, 14 Feb 2006 16:52:40 -0500, Barry Kaplan wrote:
</pre>
<blockquote type="cite">
<pre wrap="">I have the following projects:

P1 - contains the aspect below
P2 - contains the class annotated with @Configurable
hibernate.jar - also needs to be weaved (I guess)

For this scenario, what are the AJDT project settings to get a static compile. (I can get load time working just fine, but can't for the life of me figure out how to setup the projects).

thanks!!!!

----
My aspect is:

@Aspect
public class HibernateAwareAnnotationBeanConfigurerAspect extends BeanConfigurerSupport {

@Pointcut(<a class="moz-txt-link-rfc2396E" href=" mailto:initialization((@org.springframework.beans.factory.an notation.Configurable*).new(..))&&this(beanInstance) ">" initialization((@org.springframework.beans.factory.annotatio n.Configurable *).new(..)) &amp;&amp; this(beanInstance)"</a>)
void beanCreation(Object beanInstance) {}

@Pointcut("execution(* org.hibernate.engine.UnsavedValueFactory.instantiate(..))")
void hibernateUnsavedValueFactory() {}

@AfterReturning("beanCreation(beanInstance) &amp;&amp; !cflow(hibernateUnsavedValueFactory())")
public void configure(Object beanInstance) {
configureBean(beanInstance);
}
}
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
<br>
</body>
</html>

--------------060005080303020808030903--
Re: confused on how to setup projects [message #61970 is a reply to message #61948] Fri, 17 February 2006 17:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ytgyazilim.gmail.com

Hello Barry,

is this stack of Eclipse plugins you are experimenting with.

Actually We might be after the same stuff. When one of us found the
solution, can inform the other one and post the solution here so that
it gets recorded for the new newbies like us.

My problem is I have a base plugin which exposes ejb3 interfaces it has
to talk to jboss.

There is a number of other plugins making calls to that one plugin and
to the classes in tha jar base plugin exposes.

I would like to intercept upper level plugins' calls to the library and
put them through an "around" invocation that
a) I can wrap them up with ProgressService.busyCursorWhile(runnable)
so that anything taking longer then x msecs gives feedback to the user
that computer is busy waiting for a response from the server and frozen.

b) I can intercept to lazy initializing hibernate entities on the client
side and send them back to the server for lazy initialization.

c) I can intercept the stateful ejb beans and make sure they are removed
by implicitely putting making a remove call in the finally block of
proceed() call.

I will post whatever I have by tomorrow.

Ceylan

Barry Kaplan wrote:
> Ok, I went with option 2 since the project dependency is from
> P2->P1->hibernate.jar.
>
> But I'm getting errors when weaving the hibernate jar
> ---
> Severity Description Resource In Folder Location Creation
> Time Id
> 2 can't determine annotations of missing type
> org.apache.tools.ant.taskdefs.MatchingTask
> when matching pointcut
> (((initialization(@org.springframework.beans.factory.annotat ion.Configurable
> *.new(..)) && this(BindingTypePattern(java.lang.Object, 0))) &&
> !concretecflow(org.aspectj.runtime.internal.CFlowCounter
> org.opentrader.infra.hibernate.HibernateAwareAnnotationBeanC onfigurerAspect.ajc$cflowCounter$0))
> &&
> persingleton(org.opentrader.infra.hibernate.HibernateAwareAn notationBeanConfigurerAspect))
> when matching shadow initialization(void
> org.hibernate.tool.hbm2ddl.SchemaExportTask.<init>())
> when weaving type org.hibernate.tool.hbm2ddl.SchemaExportTask
> when weaving classes
> when weaving
> when batch building
> BuildConfig[Q:\eclipse.workspaces\folio\.metadata\.plugins\o rg.eclipse.ajdt.core\ot-platform-samples.generated.lst]
> #Files=16
> [Xlint:cantFindType] hibernate-3.1.2.jar
> ot-thirdparty/lib/hibernate February 17, 2006 8:34:43 AM 184224
> ---
>
> My aop.xml contains "<include within="org.hibernate.engine..*"/>". How
> can I use the same scope with ajdt, as I can't set the access
> restrictions on the class in the inpath?
>
> -barry
>
>
>
> However,
>
> Matt Chapman wrote:
>> Hi Barry,
>>
>> Things on the inpath get woven by things on the aspectpath.
>>
>> So to perform the weaving in P1, simply add P2 and hibernate.jar to the
>> inpath of P1. All of the woven class files will go to the output directory
>> of P1.
>>
>> If instead you want to create a woven version of hibernate.jar, create a
>> new AJ project and put P1 on the aspectpath, the jar on the inpath, and
>> set the outjar field appropriately to create the new jar, instead of the
>> class files going to the output directory.
>>
>> Regards,
>>
>> Matt.
>>
>>
>> On Tue, 14 Feb 2006 16:52:40 -0500, Barry Kaplan wrote:
>>
>>> I have the following projects:
>>>
>>> P1 - contains the aspect below
>>> P2 - contains the class annotated with @Configurable
>>> hibernate.jar - also needs to be weaved (I guess)
>>>
>>> For this scenario, what are the AJDT project settings to get a static compile. (I can get load time working just fine, but can't for the life of me figure out how to setup the projects).
>>>
>>> thanks!!!!
>>>
>>> ----
>>> My aspect is:
>>>
>>> @Aspect
>>> public class HibernateAwareAnnotationBeanConfigurerAspect extends BeanConfigurerSupport {
>>>
>>> @Pointcut(" initialization((@org.springframework.beans.factory.annotatio n.Configurable *).new(..)) && this(beanInstance)")
>>> void beanCreation(Object beanInstance) {}
>>>
>>> @Pointcut("execution(* org.hibernate.engine.UnsavedValueFactory.instantiate(..))")
>>> void hibernateUnsavedValueFactory() {}
>>>
>>> @AfterReturning("beanCreation(beanInstance) && !cflow(hibernateUnsavedValueFactory())")
>>> public void configure(Object beanInstance) {
>>> configureBean(beanInstance);
>>> }
>>> }
>>>
>>
>>
>
Re: confused on how to setup projects [message #61994 is a reply to message #61970] Fri, 17 February 2006 17:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ytgyazilim.gmail.com

By the way,
If it an RCP project you are working on,
how did you get the load time weaving working.

When I turn the loadtime weaving on as per the instructions,
Eclipse.exe won't fire at all as I think it insists on having total
control over class loaders...

Ceylan


H.Ceylan wrote:
> Hello Barry,
>
> is this stack of Eclipse plugins you are experimenting with.
>
> Actually We might be after the same stuff. When one of us found the
> solution, can inform the other one and post the solution here so that
> it gets recorded for the new newbies like us.
>
> My problem is I have a base plugin which exposes ejb3 interfaces it has
> to talk to jboss.
>
> There is a number of other plugins making calls to that one plugin and
> to the classes in tha jar base plugin exposes.
>
> I would like to intercept upper level plugins' calls to the library and
> put them through an "around" invocation that
> a) I can wrap them up with ProgressService.busyCursorWhile(runnable)
> so that anything taking longer then x msecs gives feedback to the user
> that computer is busy waiting for a response from the server and frozen.
>
> b) I can intercept to lazy initializing hibernate entities on the client
> side and send them back to the server for lazy initialization.
>
> c) I can intercept the stateful ejb beans and make sure they are removed
> by implicitely putting making a remove call in the finally block of
> proceed() call.
>
> I will post whatever I have by tomorrow.
>
> Ceylan
>
> Barry Kaplan wrote:
>> Ok, I went with option 2 since the project dependency is from
>> P2->P1->hibernate.jar.
>>
>> But I'm getting errors when weaving the hibernate jar
>> ---
>> Severity Description Resource In Folder Location Creation
>> Time Id
>> 2 can't determine annotations of missing type
>> org.apache.tools.ant.taskdefs.MatchingTask
>> when matching pointcut
>> (((initialization(@org.springframework.beans.factory.annotat ion.Configurable
>> *.new(..)) && this(BindingTypePattern(java.lang.Object, 0))) &&
>> !concretecflow(org.aspectj.runtime.internal.CFlowCounter
>> org.opentrader.infra.hibernate.HibernateAwareAnnotationBeanC onfigurerAspect.ajc$cflowCounter$0))
>> &&
>> persingleton(org.opentrader.infra.hibernate.HibernateAwareAn notationBeanConfigurerAspect))
>> when matching shadow initialization(void
>> org.hibernate.tool.hbm2ddl.SchemaExportTask.<init>())
>> when weaving type org.hibernate.tool.hbm2ddl.SchemaExportTask
>> when weaving classes
>> when weaving
>> when batch building
>> BuildConfig[Q:\eclipse.workspaces\folio\.metadata\.plugins\o rg.eclipse.ajdt.core\ot-platform-samples.generated.lst]
>> #Files=16
>> [Xlint:cantFindType] hibernate-3.1.2.jar
>> ot-thirdparty/lib/hibernate February 17, 2006 8:34:43 AM 184224
>> ---
>>
>> My aop.xml contains "<include within="org.hibernate.engine..*"/>". How
>> can I use the same scope with ajdt, as I can't set the access
>> restrictions on the class in the inpath?
>>
>> -barry
>>
>>
>>
>> However,
>>
>> Matt Chapman wrote:
>>> Hi Barry,
>>>
>>> Things on the inpath get woven by things on the aspectpath.
>>>
>>> So to perform the weaving in P1, simply add P2 and hibernate.jar to the
>>> inpath of P1. All of the woven class files will go to the output directory
>>> of P1.
>>>
>>> If instead you want to create a woven version of hibernate.jar, create a
>>> new AJ project and put P1 on the aspectpath, the jar on the inpath, and
>>> set the outjar field appropriately to create the new jar, instead of the
>>> class files going to the output directory.
>>>
>>> Regards,
>>>
>>> Matt.
>>>
>>>
>>> On Tue, 14 Feb 2006 16:52:40 -0500, Barry Kaplan wrote:
>>>
>>>> I have the following projects:
>>>>
>>>> P1 - contains the aspect below
>>>> P2 - contains the class annotated with @Configurable
>>>> hibernate.jar - also needs to be weaved (I guess)
>>>>
>>>> For this scenario, what are the AJDT project settings to get a static compile. (I can get load time working just fine, but can't for the life of me figure out how to setup the projects).
>>>>
>>>> thanks!!!!
>>>>
>>>> ----
>>>> My aspect is:
>>>>
>>>> @Aspect
>>>> public class HibernateAwareAnnotationBeanConfigurerAspect extends BeanConfigurerSupport {
>>>>
>>>> @Pointcut(" initialization((@org.springframework.beans.factory.annotatio n.Configurable *).new(..)) && this(beanInstance)")
>>>> void beanCreation(Object beanInstance) {}
>>>>
>>>> @Pointcut("execution(* org.hibernate.engine.UnsavedValueFactory.instantiate(..))")
>>>> void hibernateUnsavedValueFactory() {}
>>>>
>>>> @AfterReturning("beanCreation(beanInstance) && !cflow(hibernateUnsavedValueFactory())")
>>>> public void configure(Object beanInstance) {
>>>> configureBean(beanInstance);
>>>> }
>>>> }
>>>>
>>>
Re: confused on how to setup projects [message #62018 is a reply to message #61994] Fri, 17 February 2006 23:45 Go to previous messageGo to next message
Barry Kaplan is currently offline Barry KaplanFriend
Messages: 230
Registered: July 2009
Senior Member
H.Ceylan wrote:
> By the way,
> If it an RCP project you are working on,
> how did you get the load time weaving working.

Its not an RCP app. Just a normal java project.

-barry
Re: confused on how to setup projects [message #62041 is a reply to message #62018] Sat, 18 February 2006 00:33 Go to previous message
Eclipse UserFriend
Originally posted by: ytgyazilim.gmail.com

Hi Barry

Although you case is somewhat different, I did found solution to my
problem, which might be of your use as well.

If the project dependency stack is like this:

P5 -> P4 -> p3 -> p2 -> p1

and aspects needed say on P4 and subjects to the aspects are as deep
as in p2:

1) p2, p3, p4 aspectized.
2) any jars referenced directly by the aspects defined upper layers are
referenced in inpath listing.

That has done the trick for me.

But know I hit another issu which I will post seperately...

Take care and good weekend.

Ceylan
Barry Kaplan wrote:
> H.Ceylan wrote:
>> By the way,
>> If it an RCP project you are working on,
>> how did you get the load time weaving working.
>
> Its not an RCP app. Just a normal java project.
>
> -barry
Re: confused on how to setup projects [message #592178 is a reply to message #61823] Tue, 14 February 2006 21:54 Go to previous message
Barry Kaplan is currently offline Barry KaplanFriend
Messages: 230
Registered: July 2009
Senior Member
Here's some better formatting....

@Aspect
public class HibernateAwareAnnotationBeanConfigurerAspect extends
BeanConfigurerSupport {


@Pointcut(" initialization((@org.springframework.beans.factory.annotatio n.Configurable
*).new(..)) && this(beanInstance)")
void beanCreation(Object beanInstance) {}

@Pointcut("execution(*
org.hibernate.engine.UnsavedValueFactory.instantiate(..))")
void hibernateUnsavedValueFactory() {}

@AfterReturning("beanCreation(beanInstance) &&
!cflow(hibernateUnsavedValueFactory())")
public void configure(Object beanInstance) {
configureBean(beanInstance);
}
}
Re: confused on how to setup projects [message #592186 is a reply to message #61847] Tue, 14 February 2006 21:55 Go to previous message
Barry Kaplan is currently offline Barry KaplanFriend
Messages: 230
Registered: July 2009
Senior Member
.... I guess not ....
Re: confused on how to setup projects [message #592192 is a reply to message #61823] Wed, 15 February 2006 13:11 Go to previous message
Matt Chapman is currently offline Matt ChapmanFriend
Messages: 429
Registered: July 2009
Senior Member
Hi Barry,

Things on the inpath get woven by things on the aspectpath.

So to perform the weaving in P1, simply add P2 and hibernate.jar to the
inpath of P1. All of the woven class files will go to the output directory
of P1.

If instead you want to create a woven version of hibernate.jar, create a
new AJ project and put P1 on the aspectpath, the jar on the inpath, and
set the outjar field appropriately to create the new jar, instead of the
class files going to the output directory.

Regards,

Matt.


On Tue, 14 Feb 2006 16:52:40 -0500, Barry Kaplan wrote:
> I have the following projects:
>
> P1 - contains the aspect below
> P2 - contains the class annotated with @Configurable
> hibernate.jar - also needs to be weaved (I guess)
>
> For this scenario, what are the AJDT project settings to get a static compile. (I can get load time working just fine, but can't for the life of me figure out how to setup the projects).
>
> thanks!!!!
>
> ----
> My aspect is:
>
> @Aspect
> public class HibernateAwareAnnotationBeanConfigurerAspect extends BeanConfigurerSupport {
>
> @Pointcut(" initialization((@org.springframework.beans.factory.annotatio n.Configurable *).new(..)) && this(beanInstance)")
> void beanCreation(Object beanInstance) {}
>
> @Pointcut("execution(* org.hibernate.engine.UnsavedValueFactory.instantiate(..))")
> void hibernateUnsavedValueFactory() {}
>
> @AfterReturning("beanCreation(beanInstance) && !cflow(hibernateUnsavedValueFactory())")
> public void configure(Object beanInstance) {
> configureBean(beanInstance);
> }
> }
Re: confused on how to setup projects [message #592213 is a reply to message #61894] Fri, 17 February 2006 13:37 Go to previous message
Barry Kaplan is currently offline Barry KaplanFriend
Messages: 230
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------060005080303020808030903
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Ok, I went with option 2 since the project dependency is from
P2->P1->hibernate.jar.

But I'm getting errors when weaving the hibernate jar
---
Severity Description Resource In Folder Location Creation
Time Id
2 can't determine annotations of missing type
org.apache.tools.ant.taskdefs.MatchingTask
when matching pointcut
(((initialization(@org.springframework.beans.factory.annotat ion.Configurable
*.new(..)) && this(BindingTypePattern(java.lang.Object, 0))) &&
!concretecflow(org.aspectj.runtime.internal.CFlowCounter
org.opentrader.infra.hibernate.HibernateAwareAnnotationBeanC onfigurerAspect.ajc$cflowCounter$0))
&&
persingleton(org.opentrader.infra.hibernate.HibernateAwareAn notationBeanConfigurerAspect))
when matching shadow initialization(void
org.hibernate.tool.hbm2ddl.SchemaExportTask.<init>())
when weaving type org.hibernate.tool.hbm2ddl.SchemaExportTask
when weaving classes
when weaving
when batch building
BuildConfig[Q:\eclipse.workspaces\folio\.metadata\.plugins\o rg.eclipse.ajdt.core\ot-platform-samples.generated.lst]
#Files=16
[Xlint:cantFindType] hibernate-3.1.2.jar
ot-thirdparty/lib/hibernate February 17, 2006 8:34:43 AM 184224
---

My aop.xml contains "<include within="org.hibernate.engine..*"/>". How
can I use the same scope with ajdt, as I can't set the access
restrictions on the class in the inpath?

-barry



However,

Matt Chapman wrote:
> Hi Barry,
>
> Things on the inpath get woven by things on the aspectpath.
>
> So to perform the weaving in P1, simply add P2 and hibernate.jar to the
> inpath of P1. All of the woven class files will go to the output directory
> of P1.
>
> If instead you want to create a woven version of hibernate.jar, create a
> new AJ project and put P1 on the aspectpath, the jar on the inpath, and
> set the outjar field appropriately to create the new jar, instead of the
> class files going to the output directory.
>
> Regards,
>
> Matt.
>
>
> On Tue, 14 Feb 2006 16:52:40 -0500, Barry Kaplan wrote:
>
>> I have the following projects:
>>
>> P1 - contains the aspect below
>> P2 - contains the class annotated with @Configurable
>> hibernate.jar - also needs to be weaved (I guess)
>>
>> For this scenario, what are the AJDT project settings to get a static compile. (I can get load time working just fine, but can't for the life of me figure out how to setup the projects).
>>
>> thanks!!!!
>>
>> ----
>> My aspect is:
>>
>> @Aspect
>> public class HibernateAwareAnnotationBeanConfigurerAspect extends BeanConfigurerSupport {
>>
>> @Pointcut(" initialization((@org.springframework.beans.factory.annotatio n.Configurable *).new(..)) && this(beanInstance)")
>> void beanCreation(Object beanInstance) {}
>>
>> @Pointcut("execution(* org.hibernate.engine.UnsavedValueFactory.instantiate(..))")
>> void hibernateUnsavedValueFactory() {}
>>
>> @AfterReturning("beanCreation(beanInstance) && !cflow(hibernateUnsavedValueFactory())")
>> public void configure(Object beanInstance) {
>> configureBean(beanInstance);
>> }
>> }
>>
>
>


--------------060005080303020808030903
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Ok, I went with option 2 since the project dependency is from
P2-&gt;P1-&gt;hibernate.jar. <br>
<br>
But I'm getting errors when weaving the hibernate jar<br>
---<br>
Severity&nbsp;&nbsp;&nbsp; Description&nbsp;&nbsp;&nbsp; Resource&nbsp;&nbsp;&nbsp; In Folder&nbsp;&nbsp;&nbsp; Location&nbsp;&nbsp;&nbsp;
Creation Time&nbsp;&nbsp;&nbsp; Id<br>
2&nbsp;&nbsp;&nbsp; can't determine annotations of missing type
org.apache.tools.ant.taskdefs.MatchingTask<br>
when matching pointcut
(((initialization(@org.springframework.beans.factory.annotat ion.Configurable
*.new(..)) &amp;&amp; this(BindingTypePattern(java.lang.Object, 0)))
&amp;&amp; !concretecflow(org.aspectj.runtime.internal.CFlowCounter
org.opentrader.infra.hibernate.HibernateAwareAnnotationBeanC onfigurerAspect.ajc$cflowCounter$0))
&amp;&amp;
persingleton(org.opentrader.infra.hibernate.HibernateAwareAn notationBeanConfigurerAspect)) <br>
when matching shadow initialization(void
org.hibernate.tool.hbm2ddl.SchemaExportTask.&lt;init& ;gt;()) <br>
when weaving type org.hibernate.tool.hbm2ddl.SchemaExportTask<br>
when weaving classes <br>
when weaving <br>
when batch building
BuildConfig[Q:\eclipse.workspaces\folio\.metadata\.plugins\o rg.eclipse.ajdt.core\ot-platform-samples.generated.lst]
#Files=16<br>
&nbsp;[Xlint:cantFindType]&nbsp;&nbsp;&nbsp; hibernate-3.1.2.jar&nbsp;&nbsp;&nbsp;
ot-thirdparty/lib/hibernate&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; February 17, 2006 8:34:43 AM&nbsp;&nbsp;&nbsp;
184224<br>
---<br>
<br>
My aop.xml contains&nbsp; "&lt;include
within="org.hibernate.engine..*"/&gt;". How can I use the same scope
with ajdt, as I can't set the access restrictions on the class in the
inpath?<br>
<br>
-barry<br>
<br>
<br>
<br>
However, <br>
<br>
Matt Chapman wrote:
<blockquote cite="midpan.2006.02.15.13.11.44.234642@gmail.com"
type="cite">
<pre wrap="">Hi Barry,

Things on the inpath get woven by things on the aspectpath.

So to perform the weaving in P1, simply add P2 and hibernate.jar to the
inpath of P1. All of the woven class files will go to the output directory
of P1.

If instead you want to create a woven version of hibernate.jar, create a
new AJ project and put P1 on the aspectpath, the jar on the inpath, and
set the outjar field appropriately to create the new jar, instead of the
class files going to the output directory.

Regards,

Matt.


On Tue, 14 Feb 2006 16:52:40 -0500, Barry Kaplan wrote:
</pre>
<blockquote type="cite">
<pre wrap="">I have the following projects:

P1 - contains the aspect below
P2 - contains the class annotated with @Configurable
hibernate.jar - also needs to be weaved (I guess)

For this scenario, what are the AJDT project settings to get a static compile. (I can get load time working just fine, but can't for the life of me figure out how to setup the projects).

thanks!!!!

----
My aspect is:

@Aspect
public class HibernateAwareAnnotationBeanConfigurerAspect extends BeanConfigurerSupport {

@Pointcut(<a class="moz-txt-link-rfc2396E" href=" mailto:initialization((@org.springframework.beans.factory.an notation.Configurable*).new(..))&&this(beanInstance) ">" initialization((@org.springframework.beans.factory.annotatio n.Configurable *).new(..)) &amp;&amp; this(beanInstance)"</a>)
void beanCreation(Object beanInstance) {}

@Pointcut("execution(* org.hibernate.engine.UnsavedValueFactory.instantiate(..))")
void hibernateUnsavedValueFactory() {}

@AfterReturning("beanCreation(beanInstance) &amp;&amp; !cflow(hibernateUnsavedValueFactory())")
public void configure(Object beanInstance) {
configureBean(beanInstance);
}
}
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
<br>
</body>
</html>

--------------060005080303020808030903--
Re: confused on how to setup projects [message #592236 is a reply to message #61948] Fri, 17 February 2006 17:01 Go to previous message
Eclipse UserFriend
Originally posted by: ytgyazilim.gmail.com

Hello Barry,

is this stack of Eclipse plugins you are experimenting with.

Actually We might be after the same stuff. When one of us found the
solution, can inform the other one and post the solution here so that
it gets recorded for the new newbies like us.

My problem is I have a base plugin which exposes ejb3 interfaces it has
to talk to jboss.

There is a number of other plugins making calls to that one plugin and
to the classes in tha jar base plugin exposes.

I would like to intercept upper level plugins' calls to the library and
put them through an "around" invocation that
a) I can wrap them up with ProgressService.busyCursorWhile(runnable)
so that anything taking longer then x msecs gives feedback to the user
that computer is busy waiting for a response from the server and frozen.

b) I can intercept to lazy initializing hibernate entities on the client
side and send them back to the server for lazy initialization.

c) I can intercept the stateful ejb beans and make sure they are removed
by implicitely putting making a remove call in the finally block of
proceed() call.

I will post whatever I have by tomorrow.

Ceylan

Barry Kaplan wrote:
> Ok, I went with option 2 since the project dependency is from
> P2->P1->hibernate.jar.
>
> But I'm getting errors when weaving the hibernate jar
> ---
> Severity Description Resource In Folder Location Creation
> Time Id
> 2 can't determine annotations of missing type
> org.apache.tools.ant.taskdefs.MatchingTask
> when matching pointcut
> (((initialization(@org.springframework.beans.factory.annotat ion.Configurable
> *.new(..)) && this(BindingTypePattern(java.lang.Object, 0))) &&
> !concretecflow(org.aspectj.runtime.internal.CFlowCounter
> org.opentrader.infra.hibernate.HibernateAwareAnnotationBeanC onfigurerAspect.ajc$cflowCounter$0))
> &&
> persingleton(org.opentrader.infra.hibernate.HibernateAwareAn notationBeanConfigurerAspect))
> when matching shadow initialization(void
> org.hibernate.tool.hbm2ddl.SchemaExportTask.<init>())
> when weaving type org.hibernate.tool.hbm2ddl.SchemaExportTask
> when weaving classes
> when weaving
> when batch building
> BuildConfig[Q:\eclipse.workspaces\folio\.metadata\.plugins\o rg.eclipse.ajdt.core\ot-platform-samples.generated.lst]
> #Files=16
> [Xlint:cantFindType] hibernate-3.1.2.jar
> ot-thirdparty/lib/hibernate February 17, 2006 8:34:43 AM 184224
> ---
>
> My aop.xml contains "<include within="org.hibernate.engine..*"/>". How
> can I use the same scope with ajdt, as I can't set the access
> restrictions on the class in the inpath?
>
> -barry
>
>
>
> However,
>
> Matt Chapman wrote:
>> Hi Barry,
>>
>> Things on the inpath get woven by things on the aspectpath.
>>
>> So to perform the weaving in P1, simply add P2 and hibernate.jar to the
>> inpath of P1. All of the woven class files will go to the output directory
>> of P1.
>>
>> If instead you want to create a woven version of hibernate.jar, create a
>> new AJ project and put P1 on the aspectpath, the jar on the inpath, and
>> set the outjar field appropriately to create the new jar, instead of the
>> class files going to the output directory.
>>
>> Regards,
>>
>> Matt.
>>
>>
>> On Tue, 14 Feb 2006 16:52:40 -0500, Barry Kaplan wrote:
>>
>>> I have the following projects:
>>>
>>> P1 - contains the aspect below
>>> P2 - contains the class annotated with @Configurable
>>> hibernate.jar - also needs to be weaved (I guess)
>>>
>>> For this scenario, what are the AJDT project settings to get a static compile. (I can get load time working just fine, but can't for the life of me figure out how to setup the projects).
>>>
>>> thanks!!!!
>>>
>>> ----
>>> My aspect is:
>>>
>>> @Aspect
>>> public class HibernateAwareAnnotationBeanConfigurerAspect extends BeanConfigurerSupport {
>>>
>>> @Pointcut(" initialization((@org.springframework.beans.factory.annotatio n.Configurable *).new(..)) && this(beanInstance)")
>>> void beanCreation(Object beanInstance) {}
>>>
>>> @Pointcut("execution(* org.hibernate.engine.UnsavedValueFactory.instantiate(..))")
>>> void hibernateUnsavedValueFactory() {}
>>>
>>> @AfterReturning("beanCreation(beanInstance) && !cflow(hibernateUnsavedValueFactory())")
>>> public void configure(Object beanInstance) {
>>> configureBean(beanInstance);
>>> }
>>> }
>>>
>>
>>
>
Re: confused on how to setup projects [message #592251 is a reply to message #61970] Fri, 17 February 2006 17:03 Go to previous message
Eclipse UserFriend
Originally posted by: ytgyazilim.gmail.com

By the way,
If it an RCP project you are working on,
how did you get the load time weaving working.

When I turn the loadtime weaving on as per the instructions,
Eclipse.exe won't fire at all as I think it insists on having total
control over class loaders...

Ceylan


H.Ceylan wrote:
> Hello Barry,
>
> is this stack of Eclipse plugins you are experimenting with.
>
> Actually We might be after the same stuff. When one of us found the
> solution, can inform the other one and post the solution here so that
> it gets recorded for the new newbies like us.
>
> My problem is I have a base plugin which exposes ejb3 interfaces it has
> to talk to jboss.
>
> There is a number of other plugins making calls to that one plugin and
> to the classes in tha jar base plugin exposes.
>
> I would like to intercept upper level plugins' calls to the library and
> put them through an "around" invocation that
> a) I can wrap them up with ProgressService.busyCursorWhile(runnable)
> so that anything taking longer then x msecs gives feedback to the user
> that computer is busy waiting for a response from the server and frozen.
>
> b) I can intercept to lazy initializing hibernate entities on the client
> side and send them back to the server for lazy initialization.
>
> c) I can intercept the stateful ejb beans and make sure they are removed
> by implicitely putting making a remove call in the finally block of
> proceed() call.
>
> I will post whatever I have by tomorrow.
>
> Ceylan
>
> Barry Kaplan wrote:
>> Ok, I went with option 2 since the project dependency is from
>> P2->P1->hibernate.jar.
>>
>> But I'm getting errors when weaving the hibernate jar
>> ---
>> Severity Description Resource In Folder Location Creation
>> Time Id
>> 2 can't determine annotations of missing type
>> org.apache.tools.ant.taskdefs.MatchingTask
>> when matching pointcut
>> (((initialization(@org.springframework.beans.factory.annotat ion.Configurable
>> *.new(..)) && this(BindingTypePattern(java.lang.Object, 0))) &&
>> !concretecflow(org.aspectj.runtime.internal.CFlowCounter
>> org.opentrader.infra.hibernate.HibernateAwareAnnotationBeanC onfigurerAspect.ajc$cflowCounter$0))
>> &&
>> persingleton(org.opentrader.infra.hibernate.HibernateAwareAn notationBeanConfigurerAspect))
>> when matching shadow initialization(void
>> org.hibernate.tool.hbm2ddl.SchemaExportTask.<init>())
>> when weaving type org.hibernate.tool.hbm2ddl.SchemaExportTask
>> when weaving classes
>> when weaving
>> when batch building
>> BuildConfig[Q:\eclipse.workspaces\folio\.metadata\.plugins\o rg.eclipse.ajdt.core\ot-platform-samples.generated.lst]
>> #Files=16
>> [Xlint:cantFindType] hibernate-3.1.2.jar
>> ot-thirdparty/lib/hibernate February 17, 2006 8:34:43 AM 184224
>> ---
>>
>> My aop.xml contains "<include within="org.hibernate.engine..*"/>". How
>> can I use the same scope with ajdt, as I can't set the access
>> restrictions on the class in the inpath?
>>
>> -barry
>>
>>
>>
>> However,
>>
>> Matt Chapman wrote:
>>> Hi Barry,
>>>
>>> Things on the inpath get woven by things on the aspectpath.
>>>
>>> So to perform the weaving in P1, simply add P2 and hibernate.jar to the
>>> inpath of P1. All of the woven class files will go to the output directory
>>> of P1.
>>>
>>> If instead you want to create a woven version of hibernate.jar, create a
>>> new AJ project and put P1 on the aspectpath, the jar on the inpath, and
>>> set the outjar field appropriately to create the new jar, instead of the
>>> class files going to the output directory.
>>>
>>> Regards,
>>>
>>> Matt.
>>>
>>>
>>> On Tue, 14 Feb 2006 16:52:40 -0500, Barry Kaplan wrote:
>>>
>>>> I have the following projects:
>>>>
>>>> P1 - contains the aspect below
>>>> P2 - contains the class annotated with @Configurable
>>>> hibernate.jar - also needs to be weaved (I guess)
>>>>
>>>> For this scenario, what are the AJDT project settings to get a static compile. (I can get load time working just fine, but can't for the life of me figure out how to setup the projects).
>>>>
>>>> thanks!!!!
>>>>
>>>> ----
>>>> My aspect is:
>>>>
>>>> @Aspect
>>>> public class HibernateAwareAnnotationBeanConfigurerAspect extends BeanConfigurerSupport {
>>>>
>>>> @Pointcut(" initialization((@org.springframework.beans.factory.annotatio n.Configurable *).new(..)) && this(beanInstance)")
>>>> void beanCreation(Object beanInstance) {}
>>>>
>>>> @Pointcut("execution(* org.hibernate.engine.UnsavedValueFactory.instantiate(..))")
>>>> void hibernateUnsavedValueFactory() {}
>>>>
>>>> @AfterReturning("beanCreation(beanInstance) && !cflow(hibernateUnsavedValueFactory())")
>>>> public void configure(Object beanInstance) {
>>>> configureBean(beanInstance);
>>>> }
>>>> }
>>>>
>>>
Re: confused on how to setup projects [message #592257 is a reply to message #61994] Fri, 17 February 2006 23:45 Go to previous message
Barry Kaplan is currently offline Barry KaplanFriend
Messages: 230
Registered: July 2009
Senior Member
H.Ceylan wrote:
> By the way,
> If it an RCP project you are working on,
> how did you get the load time weaving working.

Its not an RCP app. Just a normal java project.

-barry
Re: confused on how to setup projects [message #592272 is a reply to message #62018] Sat, 18 February 2006 00:33 Go to previous message
Eclipse UserFriend
Originally posted by: ytgyazilim.gmail.com

Hi Barry

Although you case is somewhat different, I did found solution to my
problem, which might be of your use as well.

If the project dependency stack is like this:

P5 -> P4 -> p3 -> p2 -> p1

and aspects needed say on P4 and subjects to the aspects are as deep
as in p2:

1) p2, p3, p4 aspectized.
2) any jars referenced directly by the aspects defined upper layers are
referenced in inpath listing.

That has done the trick for me.

But know I hit another issu which I will post seperately...

Take care and good weekend.

Ceylan
Barry Kaplan wrote:
> H.Ceylan wrote:
>> By the way,
>> If it an RCP project you are working on,
>> how did you get the load time weaving working.
>
> Its not an RCP app. Just a normal java project.
>
> -barry
Previous Topic:Instances going out of scope
Next Topic:Serial Version UID problem
Goto Forum:
  


Current Time: Thu Mar 28 08:36:26 GMT 2024

Powered by FUDForum. Page generated in 0.26060 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top