[
https://issues.apache.org/jira/browse/CAMEL-7487?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14026889#comment-14026889
]
ASF GitHub Bot commented on CAMEL-7487:
---------------------------------------
GitHub user dhirajsb opened a pull request:
https://github.com/apache/camel/pull/175
CAMEL-7487 Create an archetype and code generation plugins to generate
Camel Components that wrap some API
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/175.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 #175
----
commit 0e76f0495007c3bbc469c4f1f6a2bffb4eae7581
Author: Dhiraj Bokde <[email protected]>
Date: 2014-05-23T20:29:39Z
Initial version of Component utilities
commit 61836d69a2869c1e15e6edb398ec853bc0844502
Author: Dhiraj Bokde <[email protected]>
Date: 2014-05-24T00:47:51Z
Fixed substitution order in ArgumentSubstitutionParser
commit 0ab55029578eede76bb0c0595cb42bb41ea87981
Author: Dhiraj Bokde <[email protected]>
Date: 2014-05-24T01:33:04Z
Made ApiMethodParser.parse() final and added processResults to avoid
warnings from ApiMethodParser
commit 8e386fa88fb01f499ff6de9b02619c02c7506280
Author: Dhiraj Bokde <[email protected]>
Date: 2014-05-24T01:35:56Z
Initial version of component util maven plugin
commit 2206b345fd578ad5b824f7d4a99b87cb50dc5fb5
Author: Dhiraj Bokde <[email protected]>
Date: 2014-05-24T01:38:10Z
Removed redundant test class
commit d45927a7ceaf131d9a8e87e004bfd041cdd63556
Author: Dhiraj Bokde <[email protected]>
Date: 2014-05-26T12:37:45Z
Refactored mojos, added JavadocApiMethodGenerator, ApiComponentGenerator
commit 1be812015f44910abc14af7b02b06330580de57b
Author: Dhiraj Bokde <[email protected]>
Date: 2014-05-26T13:04:01Z
Added generated source validation, refactored package_path in unit tests
commit c3afc84d6ec57c9baa610610603971ef0ee357a7
Author: Dhiraj Bokde <[email protected]>
Date: 2014-05-28T21:18:17Z
Fixed array argument handling
commit 09cd27ffa0eb13d8c6ed63b3f27ef0243cccc834
Author: Dhiraj Bokde <[email protected]>
Date: 2014-05-28T21:19:08Z
Fixed argument substituion check to use exact type match
commit ae4154eed1964bad6dc557605738c6bfa497ee4c
Author: Dhiraj Bokde <[email protected]>
Date: 2014-05-28T21:19:35Z
Added test for invoking a derived proxy class
commit 07ae0bc5a2b549ba0477209528f296af68d57373
Author: Dhiraj Bokde <[email protected]>
Date: 2014-05-28T21:20:13Z
Added argument name and type uniqueness check
commit a653acbed484b1191e8617cbba1c1ef5b50e892e
Author: Dhiraj Bokde <[email protected]>
Date: 2014-05-28T21:21:05Z
Converted generated ApiCollection class to singleton
commit 0e3108f9c6389bda0658002363c724ec3a2f2dd9
Author: Dhiraj Bokde <[email protected]>
Date: 2014-05-28T21:21:43Z
Added substitution for duplicate argument name key
commit 84d6d268fb0a11ddbe25c6c3e02a67adaf32898c
Author: Dhiraj Bokde <[email protected]>
Date: 2014-05-28T21:22:26Z
Added check to exclude static methods in proxies
commit 6f5fd33bb4862ce6113bf26744fea296aedef499
Author: Dhiraj Bokde <[email protected]>
Date: 2014-05-28T21:24:51Z
Removed author name
commit 93365f7fa9b2e0cb4cc01a984811663e4d1a037f
Author: Dhiraj Bokde <[email protected]>
Date: 2014-05-30T01:00:49Z
Added support for generating integration tests, fixed
JavadocApiMethodGeneratorMojoTest, refactored ApiComponentGeneratorMojo to only
generate component classes, refactored plugin tests
commit f6a0a839c23184d9796a11ec3227e1671e660fd8
Author: Dhiraj Bokde <[email protected]>
Date: 2014-05-30T18:14:46Z
Added getApiNames() to ApiCollection, added more method modifiers to
signature parsing
commit ed1a4aff1abb3c7b22f4efdde4ca11fc1aa52d19
Author: Dhiraj Bokde <[email protected]>
Date: 2014-05-30T19:48:09Z
Added support for generating endpoint config using component-util plugin,
added integration tests, refactored unit tests, cleaned-up generated code
commit eeb2c4cd527df4018fb4227ca2d69d5ded754774
Author: Dhiraj Bokde <[email protected]>
Date: 2014-06-02T22:45:47Z
Updated ApiCollection to use type ApiName, fixed method name constant to be
locale independent
commit 77b26ab45d98c5a87a7a22dc8319d237b8dc61fc
Author: Dhiraj Bokde <[email protected]>
Date: 2014-06-02T22:47:54Z
Updated ApiComponentGeneratorMojo to generate ApiName enumeration
commit 4b1c1f0c5531edec8f4da231c0c8258cc40b4340
Author: Dhiraj Bokde <[email protected]>
Date: 2014-06-03T19:44:16Z
Initial version of camel-archetype-api-component
commit d5ab202ea13196e600c4ecc451fa00dc8d0c8b39
Author: Dhiraj Bokde <[email protected]>
Date: 2014-06-04T04:39:35Z
Added support for creating endpoint configuration from ApiCollection, added
method aliases to tests, minor refactoring
commit 94aba1c73e173c3b243831afccf3fb2b7fded074
Author: Dhiraj Bokde <[email protected]>
Date: 2014-06-04T20:47:58Z
Fixed method alias handling, changed component config file name pattern
commit 849bf6cbd8a14382bf8170e740092c28bca772ac
Author: Dhiraj Bokde <[email protected]>
Date: 2014-06-04T20:55:36Z
Updated archetype files to first real implementation
commit 52c45365b206d7af166017a1a94f2579c966c89a
Author: Dhiraj Bokde <[email protected]>
Date: 2014-06-05T01:41:37Z
Updated generated tests to get api name for test routes from ApiCollection,
added java.awt.headless=true to Javadoc mojo
commit 612ca92d8b36f64b9a47765b350c8f62d9fdd28c
Author: Dhiraj Bokde <[email protected]>
Date: 2014-06-05T02:03:50Z
Fixed generated ApiCollection, fixed integration test
commit 8aaed089af4c96051602dc3190b52f5c092d0447
Author: Dhiraj Bokde <[email protected]>
Date: 2014-06-05T02:05:45Z
Fixed endpoint configuration, added component default ctor
commit 49290ca2412902076d420c9b677b9b9910740668
Author: Dhiraj Bokde <[email protected]>
Date: 2014-06-05T02:28:24Z
Renamed test API classes for clarity
commit 7531db45dffc218c86d2f67ddf8efc53d1cc3121
Author: Dhiraj Bokde <[email protected]>
Date: 2014-06-05T02:39:18Z
Fixed formatting
commit 99a405190bbc5a6b8e3f46a4de17da4fe1e71c70
Author: Dhiraj Bokde <[email protected]>
Date: 2014-06-05T18:40:53Z
Added missing '/' to test route path
----
> 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)