Re: [T5.2.6] Component class transformation on initialized private instance fields

2012-01-09 Thread Kalle Korhonen
On Mon, Jan 9, 2012 at 11:27 PM, robert baker wrote: > I wanted to write a doc snippet to go in the Component Classes page in > the guide under "Transient Instance Variables" in a warning > box/pullout after the first paragraph, rewording and summing up what > you both have said: > """ > Never ini

Re: [T5.2.6] Component class transformation on initialized private instance fields

2012-01-09 Thread robert baker
Hey I just wanted to thank you both (Josh and Thiago) before I forget; this helped solve a tough production bug that was affecting a lot of people. I wanted to write a doc snippet to go in the Component Classes page in the guide under "Transient Instance Variables" in a warning box/pullout after t

Re: [T5.2.6] Component class transformation on initialized private instance fields

2012-01-05 Thread Thiago H. de Paula Figueiredo
On Thu, 05 Jan 2012 03:35:53 -0200, robert baker wrote: Hi all, Hi! When a page/component is transformed (in version 5.2.6) and there is a field like the following: private List aList = new ArrayList(); You should never, never, never, ever initialize a component, page or mixin field

Re: [T5.2.6] Component class transformation on initialized private instance fields

2012-01-04 Thread Josh Canfield
> Does the inline initialization claim the field at transformation-time > so that it is not cleared during request detachment? The inline initialization is used to reset the value at the end of a request. So, if you put stuff in the default list then you are going to see it in all of your pages. I

[T5.2.6] Component class transformation on initialized private instance fields

2012-01-04 Thread robert baker
Hi all, When a page/component is transformed (in version 5.2.6) and there is a field like the following: private List aList = new ArrayList(); Does the inline initialization claim the field at transformation-time so that it is not cleared during request detachment? ("Claim" as in what the @Reta

Re: Class Transformation problem

2011-08-14 Thread Rendy Tapestry
t; >> On Thu, Aug 4, 2011 at 10:29 PM, Josh Canfield >wrote: > >> > >>> Also, rest resources can be bound as services to use injection and > advice. > >>> On Aug 4, 2011 8:05 AM, "Taha Hafeez" > wrote: > >>> > Hi Rendy > >>> &

Re: Class Transformation problem

2011-08-05 Thread Josh Canfield
>> Rendy. >> >> On Thu, Aug 4, 2011 at 10:29 PM, Josh Canfield wrote: >> >>> Also, rest resources can be bound as services to use injection and advice. >>> On Aug 4, 2011 8:05 AM, "Taha Hafeez" wrote: >>> > Hi Rendy >>> &g

Re: Class Transformation problem

2011-08-05 Thread Rendy Tapestry
:) > > > > Thanks, > > Rendy. > > > > On Thu, Aug 4, 2011 at 10:29 PM, Josh Canfield >wrote: > > > >> Also, rest resources can be bound as services to use injection and > advice. > >> On Aug 4, 2011 8:05 AM, "Taha Hafeez" wrote

Re: Class Transformation problem

2011-08-05 Thread Taha Hafeez
> >> > No ComponentClassTransformWorker will not work outside >> > pages/components package. But class transformation is not the only >> > reason to keep a special packages. You sometime need to scan classes >> > for annotations etc and it is easy if you have spe

Re: Class Transformation problem

2011-08-04 Thread Rendy Tapestry
t; > Hi Rendy > > > > No ComponentClassTransformWorker will not work outside > > pages/components package. But class transformation is not the only > > reason to keep a special packages. You sometime need to scan classes > > for annotations etc and it is easy if you h

Re: Class Transformation problem

2011-08-04 Thread Rendy Tapestry
er will not work outside > > pages/components package. But class transformation is not the only > > reason to keep a special packages. You sometime need to scan classes > > for annotations etc and it is easy if you have specific packages > > which can be contributed to the s

Re: Class Transformation problem

2011-08-04 Thread Josh Canfield
Also, rest resources can be bound as services to use injection and advice. On Aug 4, 2011 8:05 AM, "Taha Hafeez" wrote: > Hi Rendy > > No ComponentClassTransformWorker will not work outside > pages/components package. But class transformation is not the only > reason t

Re: Class Transformation problem

2011-08-04 Thread Taha Hafeez
Hi Rendy No ComponentClassTransformWorker will not work outside pages/components package. But class transformation is not the only reason to keep a special packages. You sometime need to scan classes for annotations etc and it is easy if you have specific packages which can be contributed to the

Class Transformation problem

2011-08-04 Thread Rendy Tapestry
Hi all, I have problem with class transformation, my question, will this class transformation work outside from special package (pages for example). I am using restful integration from tynamo which direct me to put my web service in rest package. Is the package name matter with class

Re: Class Transformation

2011-02-17 Thread Thiago H. de Paula Figueiredo
On Thu, 17 Feb 2011 14:11:39 -0200, Taha Hafeez wrote: Can I do it in Javassist. You'd need to ensure your Javassist-changed class version is the only one used in your application. This is probably quite hard to do. If I needed to something like you want, I'd study how Projet Lombok wor

Re: Class Transformation

2011-02-17 Thread Taha Hafeez
We did use envers in one of our projects but it makes creating auditing reports a project in itself. Besides the auditing is not of our liking. We, being a financial organization, have to audit every thing and having so many audit tables around is just too much. Also there is less control over the

Re: Class Transformation

2011-02-17 Thread Kalle Korhonen
On Thu, Feb 17, 2011 at 7:15 AM, Taha Hafeez wrote: > Back to the question. What I really want to do is provide an @Auditable > annotation on my domain classes and then add some fields/methods at the time > of loading the classes. Are you sure that adding the auditing data directly to your domain

Re: Class Transformation

2011-02-17 Thread Lenny Primak
+1 Lombok. It is awesome and I've used it for some time. On Feb 17, 2011, at 10:38 AM, "Thiago H. de Paula Figueiredo" wrote: > On Thu, 17 Feb 2011 13:15:01 -0200, Taha Hafeez > wrote: > >> Back to the question. What I really want to do is provide an @Auditable >> annotation on my domain

Re: Class Transformation

2011-02-17 Thread Thiago H. de Paula Figueiredo
On Thu, 17 Feb 2011 13:15:01 -0200, Taha Hafeez wrote: Back to the question. What I really want to do is provide an @Auditable annotation on my domain classes and then add some fields/methods at the time of loading the classes. Tapestry-IoC doesn't change classes at all. It just creates p

Re: Class Transformation

2011-02-17 Thread Taha Hafeez
I know a bit of asm and I am really looking forward to browse its code but I am too busy with migrating our internal wicket applications to Tapestry5. We are also planning to replace front-end of Finacle from jsp to tapestry5. Back to the question. What I really want to do is provide an @Auditable

Re: Class Transformation

2011-02-17 Thread Thiago H. de Paula Figueiredo
On Thu, 17 Feb 2011 11:33:35 -0200, Taha Hafeez wrote: Hi Hi! There is internal support for creating new classes in tapestry ioc using ClassFactory/ClassFab. They're going to be deprecated soon and remved in the future. The replacement will be Howard's Plastic package: https://githu

Class Transformation

2011-02-17 Thread Taha Hafeez
Hi There is internal support for creating new classes in tapestry ioc using ClassFactory/ClassFab. What if I have to modify an existing class say add methods/fields or do I have to go for javassist directly regards Taha

Re: Class transformation

2008-02-20 Thread Robin Helgelin
On Wed, Feb 20, 2008 at 5:37 PM, Filip S. Adamsen <[EMAIL PROTECTED]> wrote: > Sorry, my bad. That is indeed not possible at the moment. I did post and example in my first message in this thread where I was playing with it, but I couldn't get Tapestry to process my renamed method, so I gave it a r

Re: Class transformation

2008-02-20 Thread Filip S. Adamsen
Sorry, my bad. That is indeed not possible at the moment. -Filip Robin Helgelin skrev: On Wed, Feb 20, 2008 at 3:35 PM, Filip S. Adamsen <[EMAIL PROTECTED]> wrote: Can't you just override the method instead and call the super method at the right time? Sure, but currently Tap

Re: Class transformation

2008-02-20 Thread Robin Helgelin
On Wed, Feb 20, 2008 at 3:35 PM, Filip S. Adamsen <[EMAIL PROTECTED]> wrote: > Can't you just override the method instead and call the super method at > the right time? Sure, but currently Tapestry class transformation doesn't support this. Or maybe I'm just bli

Re: Class transformation

2008-02-20 Thread Filip S. Adamsen
Can't you just override the method instead and call the super method at the right time? -Filip Robin Helgelin skrev: On Feb 19, 2008 8:47 PM, Howard Lewis Ship <[EMAIL PROTECTED]> wrote: I think it's because the code you add is effectively inside a block, i.e. in Java it would be: { int i =

Re: Class transformation

2008-02-19 Thread Robin Helgelin
On Feb 19, 2008 8:47 PM, Howard Lewis Ship <[EMAIL PROTECTED]> wrote: > I think it's because the code you add is effectively inside a block, > i.e. in Java it would be: > { > int i = 5; > } > > So the scope of the new variable is limited. That means you need to > generate all the code that uses

Re: Class transformation

2008-02-19 Thread Howard Lewis Ship
I think it's because the code you add is effectively inside a block, i.e. in Java it would be: { int i = 5; } So the scope of the new variable is limited. That means you need to generate all the code that uses the variable as a single body passed to ClassTransformation. On Feb 19, 2008 10:55 A

Re: Class transformation

2008-02-19 Thread Robin Helgelin
On Feb 19, 2008 7:44 PM, Howard Lewis Ship <[EMAIL PROTECTED]> wrote: > Could the extend method be failing because it does not return a value? I tried returning a value, no change. It barfs on my variable i, backtrace as this: Caused by: org.apache.tapestry.internal.services.MethodCompileExceptio

Re: Class transformation

2008-02-19 Thread Howard Lewis Ship
Could the extend method be failing because it does not return a value? On Feb 19, 2008 9:31 AM, Robin Helgelin <[EMAIL PROTECTED]> wrote: > Hi, > > I'm trying to do a simple prefix and extend to a single method, > however, it seems that ClassTransformation.extendMethod(), doesn't > find variables

Class transformation

2008-02-19 Thread Robin Helgelin
Hi, I'm trying to do a simple prefix and extend to a single method, however, it seems that ClassTransformation.extendMethod(), doesn't find variables declared with prefixMethod(). Simple example which throws a javassist.CannotCompileException: transformation.prefixMethod(method, "int i =

Re: [T5] class transformation to override an annotated method

2007-06-29 Thread #Cyrille37#
Dan Adams a écrit : @Once public List getFoos() { // do some expensive operation like reading foos from the db } Could you please give us the your @Once annotation source code ? My 2 reasons are : - I'm learning Java so I'll like to see how to write such annotation - It is a really gr

Re: [T5] class transformation to override an annotated method

2007-06-29 Thread Dan Adams
yeah, the docs say that it adds you code to the end of it. I added a ticket: https://issues.apache.org/jira/browse/TAPESTRY-1615 On Fri, 2007-06-29 at 09:30 -0700, Howard Lewis Ship wrote: > You can extend an existing method, but off the top of my head, I can't > remember if that automatically in

Re: [T5] class transformation to override an annotated method

2007-06-29 Thread Howard Lewis Ship
You can extend an existing method, but off the top of my head, I can't remember if that automatically invokes the existing method before executing the new code. I think it does, which would defeat what you are trying to do. On 6/29/07, Howard Lewis Ship <[EMAIL PROTECTED]> wrote: You are correct

Re: [T5] class transformation to override an annotated method

2007-06-29 Thread Howard Lewis Ship
You are correct, ClassTransformation needs the ability to rename a method. On 6/29/07, Dan Adams <[EMAIL PROTECTED]> wrote: Okay, so I'm creating a @Once annotation that when applied to a method like so: @Once public List getFoos() { // do some expensive operation like reading foos from the d

[T5] class transformation to override an annotated method

2007-06-29 Thread Dan Adams
Okay, so I'm creating a @Once annotation that when applied to a method like so: @Once public List getFoos() { // do some expensive operation like reading foos from the db } you can call getFoos() as much as you want and it will only actually execute once, allowing you to reference foos many tim