You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by "Igor Drobiazko (JIRA)" <ji...@apache.org> on 2010/07/21 15:50:52 UTC

[jira] Assigned: (TAP5-335) Provide access to annotations of service implementation class

     [ https://issues.apache.org/jira/browse/TAP5-335?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Drobiazko reassigned TAP5-335:
-----------------------------------

    Assignee: Igor Drobiazko

> Provide access to annotations of service implementation class
> -------------------------------------------------------------
>
>                 Key: TAP5-335
>                 URL: https://issues.apache.org/jira/browse/TAP5-335
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-ioc
>    Affects Versions: 5.0.15
>            Reporter: Lubor Gajda
>            Assignee: Igor Drobiazko
>
> In some situations it would be useful to have direct access to annotations of service implementation class. This would allow us, during registry startup, detect services with some specific class or method level annotations and take related actions. 
> For instance imagine tapestry-quartz integration based on simple declarative
> mechanism where it would be possible to use something like this:
> public class MyServiceImpl implements MyService {
>   @Scheduled(cronExpression="0/5 * * * * ?")
>   public void myMethod() {
>     ...
>   }
> }
> and framework would be able, during registry startup, automatically detect all service methods annotated by @Scheduled annotation and register them in the scheduler.
>  
> I see two possible solutions:
> 1. Modify ServiceDef to hold information about service implementation class.
> 2. Service proxy could inherit all annotations from service implementation
> class, then we would be able to check annotations directly on service proxy.
>  
> But maybe there is another, more elegant solution.
>   
> For more details see thread:
> http://thread.gmane.org/gmane.comp.java.tapestry.user/67116/focus=67116

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Assigned: (TAP5-335) Provide access to annotations of service implementation class

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Wed, 21 Jul 2010 12:17:09 -0300, Howard Lewis Ship <hl...@gmail.com>  
wrote:

> I suppose we could extend ServiceResources to add a method
> getImplementationClass() which would return getClass() on the service
> implementation class (if it is known).

I still think the proxy methods having the annotations of the  
implementation class is the better idea, as anything that works using  
reflection would work.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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


Re: [jira] Assigned: (TAP5-335) Provide access to annotations of service implementation class

Posted by Howard Lewis Ship <hl...@gmail.com>.
I suppose we could extend ServiceResources to add a method
getImplementationClass() which would return getClass() on the service
implementation class (if it is known).

On Wed, Jul 21, 2010 at 7:03 AM, Thiago H. de Paula Figueiredo
<th...@gmail.com> wrote:
> On Wed, 21 Jul 2010 10:50:52 -0300, Igor Drobiazko (JIRA) <ji...@apache.org>
> wrote:
>
>>> Provide access to annotations of service implementation class
>
> Hi, Igor!
>
> I'm very happy to see this improvement being implemented. :) What approach
> will you use?
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and
> instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

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


Re: [jira] Assigned: (TAP5-335) Provide access to annotations of service implementation class

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Tue, 27 Jul 2010 03:33:26 -0300, Igor Drobiazko  
<ig...@gmail.com> wrote:

> I'm on the verge of committing the fix. I works pretty well but there is  
> a limitation. Copying annotations from implementation to proxy only  
> works for services bound with ServiceBinder inside the bind method. It  
> will not work for services that are created inside build methods.

This is a huge step already. Thank you very much, Igor! :)

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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


Re: [jira] Assigned: (TAP5-335) Provide access to annotations of service implementation class

Posted by Dmitry Gusev <dm...@gmail.com>.
May be it would be possible to add some annotation to build methods to
provide details on implementation class?
This isn't brilliant, but may work for some cases when you have to use build
methods.

On Tue, Jul 27, 2010 at 10:33, Igor Drobiazko <ig...@gmail.com>wrote:

> I'm on the verge of committing the fix. I works pretty well but there is a
> limitation. Copying annotations from implementation to proxy only works for
> services bound with ServiceBinder inside the bind method. It will not work
> for services that are created inside build methods.
>
> For build methods there is no way to determine the implementation class at
> proxy creation time. Proxy uses an ObjectCreator which invokes build
> methods
> to create the delegates on demand. At this time you know the implementation
> class but it's just too late. Proxy already have been fabricated.
>
> I guess we can live with that limitation. We just have to document it very
> good.
>
> On Wed, Jul 21, 2010 at 8:31 PM, Igor Drobiazko <igor.drobiazko@gmail.com
> >wrote:
>
> >
> >
> > On Wed, Jul 21, 2010 at 7:51 PM, Thiago H. de Paula Figueiredo <
> > thiagohp@gmail.com> wrote:
> >
> >> That's exactly the only thing in Tapestry-IoC that isn't awesome yet
> IMHO.
> >>
> >
> > Yep,  agreed.
> >
> >>
> >> Thank you very much for fixing this issue! I even researched a little
> bit,
> >> but I haven't had the time to implement it.
> >>
> >>
> > It is not fixed but hopefully this weekend.
> >
> > --
> > Best regards,
> >
> > Igor Drobiazko
> > http://tapestry5.de
> >
>
>
>
> --
> Best regards,
>
> Igor Drobiazko
> http://tapestry5.de
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com

Re: [jira] Assigned: (TAP5-335) Provide access to annotations of service implementation class

Posted by Igor Drobiazko <ig...@gmail.com>.
I'm on the verge of committing the fix. I works pretty well but there is a
limitation. Copying annotations from implementation to proxy only works for
services bound with ServiceBinder inside the bind method. It will not work
for services that are created inside build methods.

For build methods there is no way to determine the implementation class at
proxy creation time. Proxy uses an ObjectCreator which invokes build methods
to create the delegates on demand. At this time you know the implementation
class but it's just too late. Proxy already have been fabricated.

I guess we can live with that limitation. We just have to document it very
good.

On Wed, Jul 21, 2010 at 8:31 PM, Igor Drobiazko <ig...@gmail.com>wrote:

>
>
> On Wed, Jul 21, 2010 at 7:51 PM, Thiago H. de Paula Figueiredo <
> thiagohp@gmail.com> wrote:
>
>> That's exactly the only thing in Tapestry-IoC that isn't awesome yet IMHO.
>>
>
> Yep,  agreed.
>
>>
>> Thank you very much for fixing this issue! I even researched a little bit,
>> but I haven't had the time to implement it.
>>
>>
> It is not fixed but hopefully this weekend.
>
> --
> Best regards,
>
> Igor Drobiazko
> http://tapestry5.de
>



-- 
Best regards,

Igor Drobiazko
http://tapestry5.de

Re: [jira] Assigned: (TAP5-335) Provide access to annotations of service implementation class

Posted by Igor Drobiazko <ig...@gmail.com>.
On Wed, Jul 21, 2010 at 7:51 PM, Thiago H. de Paula Figueiredo <
thiagohp@gmail.com> wrote:

> That's exactly the only thing in Tapestry-IoC that isn't awesome yet IMHO.
>

Yep,  agreed.

>
> Thank you very much for fixing this issue! I even researched a little bit,
> but I haven't had the time to implement it.
>
>
It is not fixed but hopefully this weekend.

-- 
Best regards,

Igor Drobiazko
http://tapestry5.de

Re: [jira] Assigned: (TAP5-335) Provide access to annotations of service implementation class

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Wed, 21 Jul 2010 14:42:15 -0300, Igor Drobiazko  
<ig...@gmail.com> wrote:

> Hi Thiago,

Hi, Igor!

> copying the annotations from implementation class to proxy is definitely  
> the way to go. Especially when you are using some third party framework.

Your words are music to my ears. :) That's exactly the only thing in  
Tapestry-IoC that isn't awesome yet IMHO.

Thank you very much for fixing this issue! I even researched a little bit,  
but I haven't had the time to implement it.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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


Re: [jira] Assigned: (TAP5-335) Provide access to annotations of service implementation class

Posted by Igor Drobiazko <ig...@gmail.com>.
Hi Thiago,

copying the annotations from implementation class to proxy is definitely the
way to go. Especially when you are using some third party framework. I have
some issues with spring-integration annotations like:

http://static.springsource.org/spring-integration/docs/2.0.x/javadoc-api/org/springframework/integration/annotation/Transformer.html

http://static.springsource.org/spring-integration/docs/2.0.x/javadoc-api/org/springframework/integration/annotation/Splitter.html

These annotations are lost when proxies are created. Spring is fails to find
them using reflection.

On Wed, Jul 21, 2010 at 4:03 PM, Thiago H. de Paula Figueiredo <
thiagohp@gmail.com> wrote:

> On Wed, 21 Jul 2010 10:50:52 -0300, Igor Drobiazko (JIRA) <ji...@apache.org>
> wrote:
>
>  Provide access to annotations of service implementation class
>>>
>>
> Hi, Igor!
>
> I'm very happy to see this improvement being implemented. :) What approach
> will you use?
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>


-- 
Best regards,

Igor Drobiazko
http://tapestry5.de

Re: [jira] Assigned: (TAP5-335) Provide access to annotations of service implementation class

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Wed, 21 Jul 2010 10:50:52 -0300, Igor Drobiazko (JIRA)  
<ji...@apache.org> wrote:

>> Provide access to annotations of service implementation class

Hi, Igor!

I'm very happy to see this improvement being implemented. :) What approach  
will you use?

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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