Return-Path: X-Original-To: apmail-camel-issues-archive@minotaur.apache.org Delivered-To: apmail-camel-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9601297B7 for ; Thu, 19 Apr 2012 10:05:08 +0000 (UTC) Received: (qmail 68154 invoked by uid 500); 19 Apr 2012 10:05:08 -0000 Delivered-To: apmail-camel-issues-archive@camel.apache.org Received: (qmail 68100 invoked by uid 500); 19 Apr 2012 10:05:08 -0000 Mailing-List: contact issues-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list issues@camel.apache.org Received: (qmail 68089 invoked by uid 99); 19 Apr 2012 10:05:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Apr 2012 10:05:07 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Apr 2012 10:05:03 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id DC9243A37F9 for ; Thu, 19 Apr 2012 10:04:42 +0000 (UTC) Date: Thu, 19 Apr 2012 10:04:42 +0000 (UTC) From: =?utf-8?Q?=C5=81ukasz_Dywicki_=28Updated=29_=28JIRA=29?= To: issues@camel.apache.org Message-ID: <1353209421.5563.1334829882963.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (CAMEL-4256) Adding a EndpointConfiguration interface MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CAMEL-4256?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:all-tabpanel ] =C5=81ukasz Dywicki updated CAMEL-4256: ---------------------------------- Attachment: CAMEL-4256-core.diff Small changes in EndpointConfiguration interface. Usage of IntrospectionSup= port in ConfigurationHelper. New constructor for DefaultEndpoint. =20 > Adding a EndpointConfiguration interface > ---------------------------------------- > > Key: CAMEL-4256 > URL: https://issues.apache.org/jira/browse/CAMEL-4256 > Project: Camel > Issue Type: New Feature > Components: camel-core > Affects Versions: 2.8.0 > Reporter: Hadrian Zbarcea > Assignee: Hadrian Zbarcea > Fix For: 2.9.3 > > Attachments: CAMEL-4256-2.patch, CAMEL-4256-core.diff, CAMEL-4256= -test.diff, camel-4256.patch > > > One of the key missing pieces from the API is the explicit concept of End= pointConfiguration. We use URIs for that, ant that's great, but we don't ha= ve it in the API. Some components do have an informal version though. > I am proposing adding an EndpointConfiguration interface: > {code} > public interface EndpointConfiguration { > void fromUri(String uri); > String toUri(); > } > {code} > and maybe other methods, we could also use URI instead of string for pre-= parsing. Same as with other concepts the default implementation would be in= impl and components would extend that and add fields for configuration par= ameters.=20 > This would solve problems related to URI uniqueness to a good extent as t= oUri() should always place parameters in the same order. The Endpoint inter= face would change though. > The main advantage would be that we can annotate parameters and use javax= .validation to specify if a field is @ProducerOnly, @ConsumerOnly for examp= le, which may exclude them from toUri() (yes, there are some impacts, the i= d uri would be different than the config uric). We could annotate them with= @Secret to indicate that at least the value should not appear in clear in = the uri, etc. We could also add an @Default("value"), allowing us to exclud= e from the uri fields set on the default value (even if the filed was expli= citly set) and so on. > This would also make static validation possible unit testing configuratio= n would be vastly simplified and we could improve coverage. We can do it in= an incremental way without a big impact on existing components (especially= outside camel) via changes in DefaultEndpoint. I am working on a prototype= , but feedback is highly appreciated. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs: https://issues.apache.org/jira/secure/ContactAdministrators!default.jsp= a For more information on JIRA, see: http://www.atlassian.com/software/jira