[
https://issues.apache.org/jira/browse/TAP5-335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12645616#action_12645616
]
Howard M. Lewis Ship commented on TAP5-335:
-------------------------------------------
It would be nice if we could expose the ServiceDef for a service to the
service's builder, and make introspection of the Registry (to find ServiceDefs)
part of the ObjectLocator API.
Remember that there isn't always a service implementation class! Sometimes its
a builder method, sometimes a class w/ constructor, sometimes a ServiceBuilder
instance.
I think we need a new representation of a service:
public interface ServiceDescription extends AnnotationProvider
{
public String getServiceId();
public Class getServiceInterface();
Set<Class> getMarkers();
}
It would provide annotations of the constructor or builder method and off the
class (if known).
ObjectLocator could be changed to include:
public Map<String,ServiceDescription> getServiceDescriptions();
This would be an immutable, case-insensitive map.
> 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
>
> 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.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]