Return-Path: X-Original-To: apmail-cxf-dev-archive@www.apache.org Delivered-To: apmail-cxf-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F113511DA6 for ; Thu, 25 Sep 2014 07:51:55 +0000 (UTC) Received: (qmail 1847 invoked by uid 500); 25 Sep 2014 07:51:55 -0000 Delivered-To: apmail-cxf-dev-archive@cxf.apache.org Received: (qmail 1780 invoked by uid 500); 25 Sep 2014 07:51:55 -0000 Mailing-List: contact dev-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list dev@cxf.apache.org Received: (qmail 1590 invoked by uid 99); 25 Sep 2014 07:51:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Sep 2014 07:51:55 +0000 X-ASF-Spam-Status: No, hits=-0.5 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of cschneider111@gmail.com designates 209.85.216.48 as permitted sender) Received: from [209.85.216.48] (HELO mail-qa0-f48.google.com) (209.85.216.48) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Sep 2014 07:51:50 +0000 Received: by mail-qa0-f48.google.com with SMTP id k15so4124296qaq.7 for ; Thu, 25 Sep 2014 00:51:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=Mi87ub5Vg423vL5Ga+IzmeFJnU1aVu/ShehRaKrkgWQ=; b=QW+N0OGqDf80/yM0bSb+Wv/ogUl1IzRX3mffAuMv64gq9CHIBGMCRgP5/ayNLo4JxT H7/2TDe08QK/qJ0lWQ/TTunSMzOIdqNXq9cxOme7vBvLi/hUNcnMxuv8jt4EHsLJGGOF +TNuVxBegYrKlfoDcVyNxvDQEV79QvklsozQCMz2aH4mKUauGFLkYO8BLy8BJ7vYRmjv SVIt19ApMJLhWNLxElUqYni8pHpwfpRkCyNugdYYRrv9E0173PzUsn/cQU9vx3GqA2dU rJd1m90cChVo8sOVkBhfQh4T5ONAWZ7Atu7Dora5h29LZm9ZRzvWx/31MMq3T0nupzth 0n4Q== X-Received: by 10.224.136.72 with SMTP id q8mr16266179qat.31.1411631489612; Thu, 25 Sep 2014 00:51:29 -0700 (PDT) Received: from [192.168.0.113] (HSI-KBW-149-172-39-28.hsi13.kabel-badenwuerttemberg.de. [149.172.39.28]) by mx.google.com with ESMTPSA id l62sm1495884qge.8.2014.09.25.00.51.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Sep 2014 00:51:29 -0700 (PDT) Sender: Christian Schneider Message-ID: <5423C97F.1080007@die-schneider.net> Date: Thu, 25 Sep 2014 09:51:27 +0200 From: Christian Schneider User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: dev@cxf.apache.org Subject: Re: How to handle "applications" in OSGi that offer / consume cxf services and want to enforce application level rules References: <5422BC21.5070204@die-schneider.net> <5422C35A.2060809@gmail.com> In-Reply-To: <5422C35A.2060809@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Having one servlet per bundle would definately work. I see two problems though: - Each servlet has its own base path where all services reside then. Not necessarily a bad thing but it would limit the freedom of the user to define where his endpoints live. - Added configuration overhead and complexity: Each of the bundles has to be a web application bundle with a web config and servlet definition. I have a slightly different idea that would also help with https://issues.apache.org/jira/browse/CXF-5410 . How about giving each servlet a name and refer the name in the endpoint uri. like servlet:servletname/path. This would make the endpoint uri more self describing and also nearer to the camel syntax. Using such a uri the user could even have one bundle that exposes endpoints to two different servlet if he needs. We could still keep the uri /path for compatibility which would map to the default servlet. So people do not have to change their uris right now. See the wiki page for details: https://cwiki.apache.org/confluence/display/CXF/Grouping+bundles+to+applications+in+OSGi This scheme should work fine with the way we share the DestinationRegistry in OSGi. In fact I think I missed the chance to give the servlet a name in the original design of the servlet path. WDYT ? Christian On 24.09.2014 15:12, Sergey Beryozkin wrote: > On 24/09/14 13:42, Christian Schneider wrote: >> I would like to deploy two (or more) CXF based applications into the >> same OSGi framework. >> How can I enforce common rules per application while keeping the >> applications separate from each other? >> >> I created a wiki page to show the scenario and describe current >> approaches I found and their limitations as well as an idea for a new >> approach. >> I would be happy about any feedback. Did you have a similar case? How >> did you solve it? > > Re the application example at the wiki, what about having 4 war > bundles, each containing its own servlet with n endpoints, as per the > text "Each of the above bundles would like to offer and consume 0..n > cxf services". > > As per the common configuration, the HTTP context to which these > servlets are bound can have some base common configuration. > > Furthermore, each servlet would have its own configuration shared by > those n endpoints bound to this servlet. > > Finally, each CXF servlet can have a bus parameter injected into it, > so this is the extra opportunity to share the parameters among the > group of endpoints (via the bus, as you mentioned) > > Sergey -- Christian Schneider http://www.liquid-reality.de Open Source Architect http://www.talend.com