camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAMEL-7487) Create an archetype and code generation plugins to generate Camel Components that wrap some API
Date Thu, 12 Jun 2014 03:15:02 GMT

    [ https://issues.apache.org/jira/browse/CAMEL-7487?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14028782#comment-14028782
] 

ASF GitHub Bot commented on CAMEL-7487:
---------------------------------------

GitHub user dhirajsb opened a pull request:

    https://github.com/apache/camel/pull/179

    CAMEL-7487 Simplify generated code, add support for excluding endpoint configuration properties

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/dhirajsb/camel camel-7487

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/camel/pull/179.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #179
    
----
commit 37541d2e31ce640f77298c599bc050bc80166902
Author: Dhiraj Bokde <dhirajsb@yahoo.com>
Date:   2014-06-11T23:12:50Z

    Refactored API Endpoint, Consumer and Producer to extrac Abstract classes in camel-core,
simplifying generated code, minor fixes in route test template, added two parameter method
in sample API

commit 4b0381f2983343a4d47a5f3fc3df0ed8427991bc
Author: Dhiraj Bokde <dhirajsb@yahoo.com>
Date:   2014-06-11T23:54:04Z

    Added support for excluding generated endpoint config properties by name or type

----


> Create an archetype and code generation plugins to generate Camel Components that wrap
some API
> -----------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-7487
>                 URL: https://issues.apache.org/jira/browse/CAMEL-7487
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core, tooling
>    Affects Versions: 2.12.4
>            Reporter: Dhiraj Bokde
>            Assignee: Dhiraj Bokde
>             Fix For: 2.12.4
>
>
> The Facebook component took the approach of creating an API model for the Facebook4J
API and mapping its methods and parameters to its URI endpoint using API independent code.
This reduced the number of lines of code in the component significantly while still being
able to expose every operation in the Facebook4J API.
> This approach can be made generic, so that an API model can be created for any Java Class/Interface
that needs to be wrapped by a Camel component. This model can either be manually written in
a signature file similar to the output from the 'javap' command with a method per line with
parameter names, or automatically generated by parsing Javadoc. 
> The method and parameter names then can be mapped to the component's URI paths and URI
parameters/options. The component could use a map of API name path prefixes to several APIs
it supports/implements. 
> An API-component archetype could generate boilerplate code that uses the code-generation
plugins that can generate models. The component developer then just has to populate with code
for actually creating the API proxies. Even integration tests can be generated (which use
nulls for test values) for producer endpoints for the component, and the developer just needs
to complete the skeleton test with actual values. The producer endpoint code can be easily
copied and modified to write consumer tests. 
> Components may want to customize consumer processing based on the consumer capabilities
or features of the wrapped API/technology, which can be easily done by modifying the generated
consumer code. 
> This micro-framework for generating Camel components that use API models, will significantly
reduce the amount of effort and time it takes to wrap any API and expose it as a Camel component.
The framework is also useful in situations where an API is not readily available, but one
can be written as a  Java POJO or Interface and then wrapped as an API component. 



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message