Return-Path: X-Original-To: apmail-incubator-clerezza-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-clerezza-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 5BC1A70B4 for ; Fri, 2 Sep 2011 07:05:48 +0000 (UTC) Received: (qmail 49141 invoked by uid 500); 2 Sep 2011 07:05:47 -0000 Delivered-To: apmail-incubator-clerezza-dev-archive@incubator.apache.org Received: (qmail 48653 invoked by uid 500); 2 Sep 2011 07:05:41 -0000 Mailing-List: contact clerezza-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: clerezza-dev@incubator.apache.org Delivered-To: mailing list clerezza-dev@incubator.apache.org Received: (qmail 48631 invoked by uid 99); 2 Sep 2011 07:05:37 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Sep 2011 07:05:37 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of tommaso.teofili@gmail.com designates 209.85.210.41 as permitted sender) Received: from [209.85.210.41] (HELO mail-pz0-f41.google.com) (209.85.210.41) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Sep 2011 07:05:30 +0000 Received: by pzk4 with SMTP id 4so5540452pzk.28 for ; Fri, 02 Sep 2011 00:05:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=1etnyFz8OvZ7fK/ttwjWcOwsBm94nK8BI/Vu/aXlbCY=; b=VGOsMq69R5+hLiHp2y8Suavn1N1v79Xk3eeA08lOdlYX1BJzKyP6+2Al1QVwqEK6+g y7ol5vN789jm8Pf32SgDj6y/T1IHH+5dIxYvo8LvMQ90IaWPuMFmA3DzBjo52ui7vm4T gAHDGUwHo0ZgJVRRo+qD+YYInAFaajCpqos6k= Received: by 10.68.13.101 with SMTP id g5mr1352020pbc.238.1314947109107; Fri, 02 Sep 2011 00:05:09 -0700 (PDT) MIME-Version: 1.0 Received: by 10.142.89.21 with HTTP; Fri, 2 Sep 2011 00:04:29 -0700 (PDT) In-Reply-To: References: From: Tommaso Teofili Date: Fri, 2 Sep 2011 09:04:29 +0200 Message-ID: Subject: Re: UIMA module thoughts (and refactoring) To: clerezza-dev@incubator.apache.org Content-Type: multipart/alternative; boundary=bcaec520ea2756387604abeffbc3 X-Virus-Checked: Checked by ClamAV on apache.org --bcaec520ea2756387604abeffbc3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable If no one objects, I plan to commit the solution I proposed above by the en= d of the day so that we can start from there for the first release and eventually change/better things along time. Cheers, Tommaso 2011/8/31 Tommaso Teofili > the dynamic-imports way was taken in consideration when talking with othe= r > UIMA mates, but I haven't inspected that possibility yet. > Thanks Reto. > Cheers, > Tommaso > > > 2011/8/31 Reto Bachmann-Gm=FCr > >> Hi Tommaso >> >> Without knowing about the details I'm wondering if this extension >> class loader defined when instantiating the UIMA framework cannot be >> the Bundle-Class-Loader with the Bundle having a dynamic-import >> directive. >> >> I'm very much looking forward to the 'Getting started with Clerezza >> and UIMA' page :) >> >> Cheers, >> Reto >> >> On Wed, Aug 31, 2011 at 4:48 PM, Tommaso Teofili >> wrote: >> > Hi all, >> > the UIMA Addons 2.3.1 release happened on August 29th [1], this releas= e >> > didn't include the OSGi packaging for the annotators since the UIMA >> > community wants to provide full support to OSGi in the future while th= e >> > addons OSGi packaging allowed only some basic use cases to be executed= . >> > >> > So far the bad news, the good news is that we can now include UIMA >> Addons >> > artifacts in our modules and that there is already a solution to face >> the >> > possible issues with class loading within a framework which is not ful= ly >> > OSGi compliant. >> > >> > The UIMAFramework class creates an AnalysisEngines given its (XML) >> > descriptor that contains the FQN of the annotator class which is then >> > instantiated via Class.forName(). >> > As far as I've experienced this is not good when working within OSGi >> > containers as each bundle uses a separate ClassLoader so, for example, >> the >> > ClassLoader of the uima.utils bundle cannot see the ClerezzaCASConsume= r >> > class in uima.casconsumer module by default. >> > Luckily UIMA provides the possibility of defining an extension >> ClassLoader >> > when instantiating the framework. >> > So the idea is to define an ExtensionClassLoader which registers the >> > ClassLoaders of UIMA classes implementing AnalysisComponent interface >> (that >> > is the interface for Annotators and CAS Consumers) and use it within t= he >> > creation of each AnalysisEngine. >> > Each bundle which has annotator classes can automatically register its >> > classes (in the ExtensionClassLoader) using an OSGi Activator (a >> > UIMABundleActivator in the maven-bundle-plugin configuration) which is >> > responsible for this task. >> > >> > Obviously in the future releases of UIMA with full OSGi support the >> above >> > constraints could be safely removed. >> > >> > So my idea is to apply the above changes in order to allow easy deploy >> of >> > custom UIMA pipelines within Clerezza. After that I think a brief >> 'Getting >> > started with Clerezza and UIMA' page would be useful. >> > Looking forward to your feedback. >> > Cheers, >> > Tommaso >> > >> > [1] : http://uima.apache.org/downloads.cgi >> > >> > > --bcaec520ea2756387604abeffbc3--