Return-Path: X-Original-To: apmail-incubator-celix-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-celix-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 36F43100DD for ; Mon, 14 Oct 2013 21:55:29 +0000 (UTC) Received: (qmail 72010 invoked by uid 500); 14 Oct 2013 21:55:29 -0000 Delivered-To: apmail-incubator-celix-dev-archive@incubator.apache.org Received: (qmail 71987 invoked by uid 500); 14 Oct 2013 21:55:28 -0000 Mailing-List: contact celix-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: celix-dev@incubator.apache.org Delivered-To: mailing list celix-dev@incubator.apache.org Received: (qmail 71979 invoked by uid 99); 14 Oct 2013 21:55:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Oct 2013 21:55:28 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of s.zelzer@dkfz-heidelberg.de designates 193.174.53.139 as permitted sender) Received: from [193.174.53.139] (HELO mailhost4.inet.dkfz-heidelberg.de) (193.174.53.139) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Oct 2013 21:55:20 +0000 Received: from mx1.inet.dkfz-heidelberg.de (mx1.inet.dkfz-heidelberg.de [193.174.53.113]) by mailhost2.inet.dkfz-heidelberg.de (8.13.8/8.13.8) with ESMTP id r9ELswl3005817 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 14 Oct 2013 23:54:58 +0200 X-External-Mail: Yes MX X-Envelope-Sender: s.zelzer@dkfz-heidelberg.de X-Envelope-Recipient: Received: from mx-ext.inet.dkfz-heidelberg.de (mx-ext.inet.dkfz-heidelberg.de [192.54.49.101]) by mx1.inet.dkfz-heidelberg.de (8.13.8/8.13.8) with ESMTP id r9ELsv87024673 for ; Mon, 14 Oct 2013 23:54:58 +0200 Received: from [192.168.11.2] (HSI-KBW-109-192-202-207.hsi6.kabel-badenwuerttemberg.de [109.192.202.207]) (authenticated bits=0) by mx-ext.inet.dkfz-heidelberg.de (8.13.8/8.13.8/smtpin) with ESMTP id r9ELsqUJ010297 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 14 Oct 2013 23:54:53 +0200 Message-ID: <525C682C.3070908@dkfz-heidelberg.de> Date: Mon, 14 Oct 2013 23:54:52 +0200 From: Sascha Zelzer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0 MIME-Version: 1.0 To: celix-dev@incubator.apache.org Subject: Re: [DISCUSS] APR Usage References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-3.0 (mx-ext.inet.dkfz-heidelberg.de [192.54.49.101]); Mon, 14 Oct 2013 23:54:56 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mx-ext.inet.dkfz-heidelberg.de X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=-101.4 required=5.0 tests=ALL_TRUSTED,LOCAL_AUTH_GREY autolearn=disabled version=3.2.5 Hi, I agree that we should strive for a Native-OSGi API which does not depend on third-party libraries. Having said that, I also think that if such a C API gets too cumbersome and complicated to use, we should rethink this requirement. Without a specific memory ownership management technique (like APR memory pools), the C API of services obviously needs to be carefully crafted if the service interface is stateful (e.g. internally keeps a pointer or reference via a method call). In this case, the service likely needs to provide additional methods which can be used to clear the internal state (e.g. signal the withdrawel of a previously passed pointer because the calling bundle is being unloaded). I don't see a problem with adapting the original Java service interfaces to better meet the specifics of C (or C++). Transferring memory ownership to a service from another bundle probably needs a mixed approach, if APR memory pools are used internally in C a implementation like Celix (like Alexander mentioned). But I am not conviced yet that this problem cannot be overcome by a carefully designed service interface. Best, Sascha