Thanks Senaka for the update.

For, JAX-RS services, checking for the @Path annotation doesn't always
work. That's because it's not mandatory to have @Path annotation set in the
class, or in a method in a class. Usually, the *methods* in a jax-rs
resource class would have the @Path annotation set though. So, we have to
write the parsing logic accordingly. But, I think a good way to determine
whether a given code is for a jax-rs /jax-ws service is the following. This
is assuming the service is a CXF-based one.

1. Read the web.xml, and check whether the
org.apache.cxf.transport.servlet.CXFServlet is set as a servlet.
2. If so, then check whether it has a 'config-location' init-param set. Get
its value. If not, the default is set to WEB-INF/cxf-servlet.xml. This is a
spring beans config file.
3. Parse that config file. If you find <jaxrs:server .../> tag, then it's a
jax-rs service. If you find <jaxws:server .../> then it's a jax-ws service.

Regards,
KasunG




On Wed, Feb 5, 2014 at 12:37 AM, Senaka Fernando <sen...@wso2.com> wrote:

> -1 for another meta file.
>
> Guys, we don't want this to change anything that we are doing today. What
> we need is to read the existing code and try to understand what it is. As a
> developer debugging the code you can read the services.xml and the
> corresponding class and whatever other information that we have right now
> in the POM and determine that a particular bundle is publishing an Axis2
> service.
>
> The introspection Jayanga is writing should follow the same pattern like a
> human trying to read the code and understand whether this is a Axis2
> service or a JAX-WS service or a JAX-RS service. If a human can't read
> source code and figure out whether it is a Data Service or a ESB Proxy
> Service we cannot be implementing a governance process around that. But I'm
> pretty sure that's not the case. Given the project and given the type of
> files in there you can figure out what it is doing. We just need to code
> that introspection logic. Of course there can be complications like the
> same project producing two or more types of services. We need to handle
> things like that.
>
> Also, Kasun et al, we are talking about source code here, and not the
> compiled AAR file etc.
>
> Thanks,
> Senaka.
>
>
> On Tue, Feb 4, 2014 at 7:41 PM, Jayanga Dissanayake <jaya...@wso2.com>wrote:
>
>> Hi Nirmal,
>>
>> Thanks for the suggestion.
>>
>> Our first approach is to extract relevant information from the source
>> without adding any burden on the developer.
>>
>> Using an additional meta file to indicate the information needed by the
>> governance purposes will simplify the governance process and we could use a
>> unified process to create service assets across all types of services.
>>
>> We can even embed the extra information to the pom.xml as properties.
>>
>> Thanks,
>>
>> *Jayanga Dissanayake*
>> Senior Software Engineer
>> WSO2 Inc. - http://wso2.com/
>> lean . enterprise . middleware
>> email: jaya...@wso2.com
>> mobile: +94772207259
>>
>>
>> On Tue, Feb 4, 2014 at 10:34 PM, Nirmal Fernando <nir...@wso2.com> wrote:
>>
>>> Hi Jayanga,
>>>
>>> I wonder this approach would help us. There could be lot of issues.
>>>
>>> Why not thinking of introducing a meta file which represents basic set
>>> of information that you require in order to generate these assets? Then the
>>> relevant components would need to configure this meta file, if it wants to
>>> be registered as an asset.
>>>
>>>
>>> On Tue, Feb 4, 2014 at 10:17 PM, Jayanga Dissanayake 
>>> <jaya...@wso2.com>wrote:
>>>
>>>> Hi Udara,
>>>>
>>>> Agreed with your point.
>>>> Its not just enough to have a file having the name 'services.xml' to
>>>> create a service assert.
>>>>
>>>> We have to read the file and get the service name and other information
>>>> from the file.
>>>> As Axis2 support <serviceGroup>, A single 'services.xml' file sometimes
>>>> may contain information about several services, hence several service
>>>> assert instances may have to be created.
>>>>
>>>> Thanks,
>>>>
>>>> *Jayanga Dissanayake*
>>>> Senior Software Engineer
>>>> WSO2 Inc. - http://wso2.com/
>>>> lean . enterprise . middleware
>>>> email: jaya...@wso2.com
>>>> mobile: +94772207259
>>>>
>>>>
>>>> On Tue, Feb 4, 2014 at 8:43 PM, Udara Liyanage <ud...@wso2.com> wrote:
>>>>
>>>>> Let's say a service.XML is found but without any service definition.
>>>>> Is it still a axis2 service?
>>>>>
>>>>> Touched, not typed. Erroneous words are a feature, not a typo.
>>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Dev mailing list
>>>> Dev@wso2.org
>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>
>>>>
>>>
>>>
>>> --
>>>
>>> Thanks & regards,
>>> Nirmal
>>>
>>> Senior Software Engineer- Platform Technologies Team, WSO2 Inc.
>>> Mobile: +94715779733
>>> Blog: http://nirmalfdo.blogspot.com/
>>>
>>>
>>>
>>
>> _______________________________________________
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
>
>
> *[image: http://wso2.com] <http://wso2.com> Senaka Fernando*
> Senior Technical Lead; WSO2 Inc.; http://wso2.com
>
>
>
> * Member; Apache Software Foundation; http://apache.org
> <http://apache.org>E-mail: senaka AT wso2.com <http://wso2.com>**P: +1
> 408 754 7388 <%2B1%20408%20754%207388>; ext: 51736*;
>
>
> *M: +94 77 322 1818 <%2B94%2077%20322%201818> Linked-In:
> http://linkedin.com/in/senakafernando
> <http://linkedin.com/in/senakafernando>*
> Lean . Enterprise . Middleware
>
> _______________________________________________
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
*Kasun Gajasinghe*
Software Engineer;
WSO2 Inc.; http://wso2.com


 ,
*email: *
*kasung AT spamfree wso2.com <http://wso2.com>   ** cell: **+94 (77)
678-0813*
*linked-in: *http://lk.linkedin.com/in/gajasinghe



*blog: **http://kasunbg.org* <http://kasunbg.org>



*twitter: **http://twitter.com/kasunbg* <http://twitter.com/kasunbg>
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to