You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Rendy Tapestry <re...@gmail.com> on 2011/08/04 15:55:53 UTC

Class Transformation problem

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 transformation ? If
yes, how could I solve my problem ?

Thanks,

Rendy.

ps. I am using tapestry 5.2.5 (ComponentClassTransformWorker)

Re: Class Transformation problem

Posted by Rendy Tapestry <re...@gmail.com>.
Hi Taha,

Thanks for your response. This my problem in detail,

I am creating a web service using tynamo, in tynamo, they direct us to place
Resource class in rest package. In every service inside the resource, I want
to put an annotation (like your @xhr - ajax graceful degradation) to every
method I want to transform. The transformation itself is simple one, I want
to catch every exeception thrown from invocation.proceed and convert it to a
string. This string will be used to override the result sent to the caller.

Because this package is not the one in controlled package, how do I
accomplish this idea ?

Thanks,
Rendy.

On Thu, Aug 4, 2011 at 10:29 PM, Josh Canfield <jo...@gmail.com>wrote:

> Also, rest resources can be bound as services to use injection and advice.
> On Aug 4, 2011 8:05 AM, "Taha Hafeez" <ta...@gmail.com> wrote:
> > 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 scanning service.
> >
> > As far as class transformation is concerned, you can transform an
> > existing class or create a new one by using ClassFab etc classes which
> > are based on javassist in 5.2+ (on PlasticClass etc in 5.3+).
> >
> > Can you elaborate on your problem ?
> >
> > On Thu, Aug 4, 2011 at 7:25 PM, Rendy Tapestry <rendy.tapestry@gmail.com
> >
> wrote:
> >> 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 transformation ?
> If
> >> yes, how could I solve my problem ?
> >>
> >> Thanks,
> >>
> >> Rendy.
> >>
> >> ps. I am using tapestry 5.2.5 (ComponentClassTransformWorker)
> >>
> >
> >
> >
> > --
> > Regards
> >
> > Taha Hafeez Siddiqi (tawus)
> > http://tawus.wordpress.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
>

Re: Class Transformation problem

Posted by Rendy Tapestry <re...@gmail.com>.
Yes it works, thank you.

Rendy.

On Fri, Aug 5, 2011 at 11:27 PM, Josh Canfield <jo...@gmail.com>wrote:

> Right, this is what I was talking about. I use tynamo resteasy in this way.
>
> On Fri, Aug 5, 2011 at 12:27 AM, Taha Hafeez <ta...@gmail.com>
> wrote:
> > I don't think you need ComponentClassTransformationWorker. What you
> > need is, as Josh said, a service advice
> >
> > http://tapestry.apache.org/service-advisors.html
> >
> > Now the tricky part is where to apply it. As Josh said, if you expose
> > your resources as services you will be able to apply advises and even
> > use injection.
> >
> > By "exposing as service" I mean create an interface and its
> > implementation and bind using ServiceBinder. Then you can add that
> > resource to resteasy as
> >
> > public static void contributeApplication(Configuration<Object>
> > singletons, ObjectLocator locator)
> > {
> >        singletons.add(locator.autobuild(MyDomainObjectResource.class));
> > }
> >
> > Disclaimer: I have never used tynamo-resteasy and this information is
> > based on http://tynamo.org/tapestry-resteasy+guide.
> >
> > On Fri, Aug 5, 2011 at 8:16 AM, Rendy Tapestry <re...@gmail.com>
> wrote:
> >> Hi Josh,
> >>
> >> Might you please elaborate your answer ? I don't get it :)
> >>
> >> Thanks,
> >> Rendy.
> >>
> >> On Thu, Aug 4, 2011 at 10:29 PM, Josh Canfield <joshcanfield@gmail.com
> >wrote:
> >>
> >>> Also, rest resources can be bound as services to use injection and
> advice.
> >>> On Aug 4, 2011 8:05 AM, "Taha Hafeez" <ta...@gmail.com>
> wrote:
> >>> > 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 scanning service.
> >>> >
> >>> > As far as class transformation is concerned, you can transform an
> >>> > existing class or create a new one by using ClassFab etc classes
> which
> >>> > are based on javassist in 5.2+ (on PlasticClass etc in 5.3+).
> >>> >
> >>> > Can you elaborate on your problem ?
> >>> >
> >>> > On Thu, Aug 4, 2011 at 7:25 PM, Rendy Tapestry <
> rendy.tapestry@gmail.com
> >>> >
> >>> wrote:
> >>> >> 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
> transformation ?
> >>> If
> >>> >> yes, how could I solve my problem ?
> >>> >>
> >>> >> Thanks,
> >>> >>
> >>> >> Rendy.
> >>> >>
> >>> >> ps. I am using tapestry 5.2.5 (ComponentClassTransformWorker)
> >>> >>
> >>> >
> >>> >
> >>> >
> >>> > --
> >>> > Regards
> >>> >
> >>> > Taha Hafeez Siddiqi (tawus)
> >>> > http://tawus.wordpress.com
> >>> >
> >>> > ---------------------------------------------------------------------
> >>> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >>> > For additional commands, e-mail: users-help@tapestry.apache.org
> >>> >
> >>>
> >>
> >
> >
> >
> > --
> > Regards
> >
> > Taha Hafeez Siddiqi (tawus)
> > http://tawus.wordpress.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Class Transformation problem

Posted by Josh Canfield <jo...@gmail.com>.
Right, this is what I was talking about. I use tynamo resteasy in this way.

On Fri, Aug 5, 2011 at 12:27 AM, Taha Hafeez <ta...@gmail.com> wrote:
> I don't think you need ComponentClassTransformationWorker. What you
> need is, as Josh said, a service advice
>
> http://tapestry.apache.org/service-advisors.html
>
> Now the tricky part is where to apply it. As Josh said, if you expose
> your resources as services you will be able to apply advises and even
> use injection.
>
> By "exposing as service" I mean create an interface and its
> implementation and bind using ServiceBinder. Then you can add that
> resource to resteasy as
>
> public static void contributeApplication(Configuration<Object>
> singletons, ObjectLocator locator)
> {
>        singletons.add(locator.autobuild(MyDomainObjectResource.class));
> }
>
> Disclaimer: I have never used tynamo-resteasy and this information is
> based on http://tynamo.org/tapestry-resteasy+guide.
>
> On Fri, Aug 5, 2011 at 8:16 AM, Rendy Tapestry <re...@gmail.com> wrote:
>> Hi Josh,
>>
>> Might you please elaborate your answer ? I don't get it :)
>>
>> Thanks,
>> Rendy.
>>
>> On Thu, Aug 4, 2011 at 10:29 PM, Josh Canfield <jo...@gmail.com>wrote:
>>
>>> Also, rest resources can be bound as services to use injection and advice.
>>> On Aug 4, 2011 8:05 AM, "Taha Hafeez" <ta...@gmail.com> wrote:
>>> > 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 scanning service.
>>> >
>>> > As far as class transformation is concerned, you can transform an
>>> > existing class or create a new one by using ClassFab etc classes which
>>> > are based on javassist in 5.2+ (on PlasticClass etc in 5.3+).
>>> >
>>> > Can you elaborate on your problem ?
>>> >
>>> > On Thu, Aug 4, 2011 at 7:25 PM, Rendy Tapestry <rendy.tapestry@gmail.com
>>> >
>>> wrote:
>>> >> 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 transformation ?
>>> If
>>> >> yes, how could I solve my problem ?
>>> >>
>>> >> Thanks,
>>> >>
>>> >> Rendy.
>>> >>
>>> >> ps. I am using tapestry 5.2.5 (ComponentClassTransformWorker)
>>> >>
>>> >
>>> >
>>> >
>>> > --
>>> > Regards
>>> >
>>> > Taha Hafeez Siddiqi (tawus)
>>> > http://tawus.wordpress.com
>>> >
>>> > ---------------------------------------------------------------------
>>> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> > For additional commands, e-mail: users-help@tapestry.apache.org
>>> >
>>>
>>
>
>
>
> --
> Regards
>
> Taha Hafeez Siddiqi (tawus)
> http://tawus.wordpress.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Class Transformation problem

Posted by Rendy Tapestry <re...@gmail.com>.
Thanks Taha & Josh, I will give it a try and later post back the result
here.

Thanks,
Rendy.

On Fri, Aug 5, 2011 at 2:27 PM, Taha Hafeez <ta...@gmail.com>wrote:

> I don't think you need ComponentClassTransformationWorker. What you
> need is, as Josh said, a service advice
>
> http://tapestry.apache.org/service-advisors.html
>
> Now the tricky part is where to apply it. As Josh said, if you expose
> your resources as services you will be able to apply advises and even
> use injection.
>
> By "exposing as service" I mean create an interface and its
> implementation and bind using ServiceBinder. Then you can add that
> resource to resteasy as
>
> public static void contributeApplication(Configuration<Object>
> singletons, ObjectLocator locator)
> {
>        singletons.add(locator.autobuild(MyDomainObjectResource.class));
> }
>
> Disclaimer: I have never used tynamo-resteasy and this information is
> based on http://tynamo.org/tapestry-resteasy+guide.
>
> On Fri, Aug 5, 2011 at 8:16 AM, Rendy Tapestry <re...@gmail.com>
> wrote:
> > Hi Josh,
> >
> > Might you please elaborate your answer ? I don't get it :)
> >
> > Thanks,
> > Rendy.
> >
> > On Thu, Aug 4, 2011 at 10:29 PM, Josh Canfield <joshcanfield@gmail.com
> >wrote:
> >
> >> Also, rest resources can be bound as services to use injection and
> advice.
> >> On Aug 4, 2011 8:05 AM, "Taha Hafeez" <ta...@gmail.com> wrote:
> >> > 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 scanning service.
> >> >
> >> > As far as class transformation is concerned, you can transform an
> >> > existing class or create a new one by using ClassFab etc classes which
> >> > are based on javassist in 5.2+ (on PlasticClass etc in 5.3+).
> >> >
> >> > Can you elaborate on your problem ?
> >> >
> >> > On Thu, Aug 4, 2011 at 7:25 PM, Rendy Tapestry <
> rendy.tapestry@gmail.com
> >> >
> >> wrote:
> >> >> 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 transformation
> ?
> >> If
> >> >> yes, how could I solve my problem ?
> >> >>
> >> >> Thanks,
> >> >>
> >> >> Rendy.
> >> >>
> >> >> ps. I am using tapestry 5.2.5 (ComponentClassTransformWorker)
> >> >>
> >> >
> >> >
> >> >
> >> > --
> >> > Regards
> >> >
> >> > Taha Hafeez Siddiqi (tawus)
> >> > http://tawus.wordpress.com
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >> > For additional commands, e-mail: users-help@tapestry.apache.org
> >> >
> >>
> >
>
>
>
> --
> Regards
>
> Taha Hafeez Siddiqi (tawus)
> http://tawus.wordpress.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Class Transformation problem

Posted by Taha Hafeez <ta...@gmail.com>.
I don't think you need ComponentClassTransformationWorker. What you
need is, as Josh said, a service advice

http://tapestry.apache.org/service-advisors.html

Now the tricky part is where to apply it. As Josh said, if you expose
your resources as services you will be able to apply advises and even
use injection.

By "exposing as service" I mean create an interface and its
implementation and bind using ServiceBinder. Then you can add that
resource to resteasy as

public static void contributeApplication(Configuration<Object>
singletons, ObjectLocator locator)
{
	singletons.add(locator.autobuild(MyDomainObjectResource.class));
}

Disclaimer: I have never used tynamo-resteasy and this information is
based on http://tynamo.org/tapestry-resteasy+guide.

On Fri, Aug 5, 2011 at 8:16 AM, Rendy Tapestry <re...@gmail.com> wrote:
> Hi Josh,
>
> Might you please elaborate your answer ? I don't get it :)
>
> Thanks,
> Rendy.
>
> On Thu, Aug 4, 2011 at 10:29 PM, Josh Canfield <jo...@gmail.com>wrote:
>
>> Also, rest resources can be bound as services to use injection and advice.
>> On Aug 4, 2011 8:05 AM, "Taha Hafeez" <ta...@gmail.com> wrote:
>> > 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 scanning service.
>> >
>> > As far as class transformation is concerned, you can transform an
>> > existing class or create a new one by using ClassFab etc classes which
>> > are based on javassist in 5.2+ (on PlasticClass etc in 5.3+).
>> >
>> > Can you elaborate on your problem ?
>> >
>> > On Thu, Aug 4, 2011 at 7:25 PM, Rendy Tapestry <rendy.tapestry@gmail.com
>> >
>> wrote:
>> >> 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 transformation ?
>> If
>> >> yes, how could I solve my problem ?
>> >>
>> >> Thanks,
>> >>
>> >> Rendy.
>> >>
>> >> ps. I am using tapestry 5.2.5 (ComponentClassTransformWorker)
>> >>
>> >
>> >
>> >
>> > --
>> > Regards
>> >
>> > Taha Hafeez Siddiqi (tawus)
>> > http://tawus.wordpress.com
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> > For additional commands, e-mail: users-help@tapestry.apache.org
>> >
>>
>



-- 
Regards

Taha Hafeez Siddiqi (tawus)
http://tawus.wordpress.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Class Transformation problem

Posted by Rendy Tapestry <re...@gmail.com>.
Hi Josh,

Might you please elaborate your answer ? I don't get it :)

Thanks,
Rendy.

On Thu, Aug 4, 2011 at 10:29 PM, Josh Canfield <jo...@gmail.com>wrote:

> Also, rest resources can be bound as services to use injection and advice.
> On Aug 4, 2011 8:05 AM, "Taha Hafeez" <ta...@gmail.com> wrote:
> > 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 scanning service.
> >
> > As far as class transformation is concerned, you can transform an
> > existing class or create a new one by using ClassFab etc classes which
> > are based on javassist in 5.2+ (on PlasticClass etc in 5.3+).
> >
> > Can you elaborate on your problem ?
> >
> > On Thu, Aug 4, 2011 at 7:25 PM, Rendy Tapestry <rendy.tapestry@gmail.com
> >
> wrote:
> >> 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 transformation ?
> If
> >> yes, how could I solve my problem ?
> >>
> >> Thanks,
> >>
> >> Rendy.
> >>
> >> ps. I am using tapestry 5.2.5 (ComponentClassTransformWorker)
> >>
> >
> >
> >
> > --
> > Regards
> >
> > Taha Hafeez Siddiqi (tawus)
> > http://tawus.wordpress.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
>

Re: Class Transformation problem

Posted by Josh Canfield <jo...@gmail.com>.
Also, rest resources can be bound as services to use injection and advice.
On Aug 4, 2011 8:05 AM, "Taha Hafeez" <ta...@gmail.com> wrote:
> 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 scanning service.
>
> As far as class transformation is concerned, you can transform an
> existing class or create a new one by using ClassFab etc classes which
> are based on javassist in 5.2+ (on PlasticClass etc in 5.3+).
>
> Can you elaborate on your problem ?
>
> On Thu, Aug 4, 2011 at 7:25 PM, Rendy Tapestry <re...@gmail.com>
wrote:
>> 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 transformation ?
If
>> yes, how could I solve my problem ?
>>
>> Thanks,
>>
>> Rendy.
>>
>> ps. I am using tapestry 5.2.5 (ComponentClassTransformWorker)
>>
>
>
>
> --
> Regards
>
> Taha Hafeez Siddiqi (tawus)
> http://tawus.wordpress.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>

Re: Class Transformation problem

Posted by Taha Hafeez <ta...@gmail.com>.
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 scanning service.

As far as class transformation is concerned, you can transform an
existing class or create a new one by using ClassFab etc classes which
are based on javassist in 5.2+ (on PlasticClass etc in 5.3+).

Can you elaborate on your problem ?

On Thu, Aug 4, 2011 at 7:25 PM, Rendy Tapestry <re...@gmail.com> wrote:
> 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 transformation ? If
> yes, how could I solve my problem ?
>
> Thanks,
>
> Rendy.
>
> ps. I am using tapestry 5.2.5 (ComponentClassTransformWorker)
>



-- 
Regards

Taha Hafeez Siddiqi (tawus)
http://tawus.wordpress.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org