Return-Path: Delivered-To: apmail-incubator-uima-user-archive@minotaur.apache.org Received: (qmail 68988 invoked from network); 8 Sep 2009 14:27:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 8 Sep 2009 14:27:00 -0000 Received: (qmail 78270 invoked by uid 500); 8 Sep 2009 14:26:59 -0000 Delivered-To: apmail-incubator-uima-user-archive@incubator.apache.org Received: (qmail 78219 invoked by uid 500); 8 Sep 2009 14:26:59 -0000 Mailing-List: contact uima-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: uima-user@incubator.apache.org Delivered-To: mailing list uima-user@incubator.apache.org Received: (qmail 78209 invoked by uid 99); 8 Sep 2009 14:26:59 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Sep 2009 14:26:59 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of kottmann@gmail.com designates 72.14.220.156 as permitted sender) Received: from [72.14.220.156] (HELO fg-out-1718.google.com) (72.14.220.156) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Sep 2009 14:26:48 +0000 Received: by fg-out-1718.google.com with SMTP id e12so1861087fga.0 for ; Tue, 08 Sep 2009 07:26:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=gdZC775WRExmiCtdlcgZunoTfnQ9tOGVfm65LO4yQIA=; b=O2PojixW2tOvcEGq6izD2+z5BIBj49ZFo0raPIWopqkctGamp3C3SsF/e8Ni0+36YI J8SafqJ0ITolwMciVXZP6zIM6X1M8BEA5E1VitAhpyb7Suw6QZL2+NUV3tnAj7+L1Guq u62ySS1j+e24VvOP16h5nucf2UKTsRznjgQN8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=DP93jhVN5C7ZRKpRF5kq+A9jQ+SEr4xoJszzjlxQE0Gn6Svxs7RZmi4DL/pfR2wK+f aNcWpa95x1GyKiDvgGh4NOjYmul0tyl3DtjvhaXw5lqQb80adf2kSAEt5qpcMzjpFUQx /GAQxXDpHBSSjYG1NBYvr9+41ha4TF1NK5/4I= Received: by 10.103.85.12 with SMTP id n12mr6796299mul.29.1252419987999; Tue, 08 Sep 2009 07:26:27 -0700 (PDT) Received: from ?192.168.2.100? (p54BABEA3.dip.t-dialin.net [84.186.190.163]) by mx.google.com with ESMTPS id b9sm6619mug.9.2009.09.08.07.26.20 (version=SSLv3 cipher=RC4-MD5); Tue, 08 Sep 2009 07:26:23 -0700 (PDT) Message-ID: <4AA66984.4080306@gmail.com> Date: Tue, 08 Sep 2009 16:26:12 +0200 From: =?ISO-8859-1?Q?J=F6rn_Kottmann?= User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: uima-user@incubator.apache.org Subject: Re: Passing java references to a UIMAJ component References: <6dfceae40908110721w1c746b38tad4ef2f25c58322e@mail.gmail.com> <4A86B834.6000000@schor.com> <4AA6369D.1010102@gmail.com> <2787e08a0909080644g1b98b68cxe39790eb9c83ec89@mail.gmail.com> In-Reply-To: <2787e08a0909080644g1b98b68cxe39790eb9c83ec89@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org Adam Lally wrote: > On Tue, Sep 8, 2009 at 6:49 AM, J�rn Kottmann wrote: > >> Marshall Schor wrote: >> >>> Fabio Mancinelli wrote: >>> >>> >>>> Hi everybody, >>>> >>>> I have a quick question about UIMAJ component initialization. >>>> >>>> What I would like to do is to pass a Java reference to an object that >>>> will be used by the "business logic" of a collection reader in the >>>> context of a CPE. Since I cannot control the instantiation of the >>>> collection reader, I was wondering if there is a quick and clean way >>>> to pass that object reference or if this is not impossible at all >>>> (like I am suspecting). >>>> >>>> >>> There is no clean way to do this in general. This is because the >>> components in general could be running in other contexts, for instance, >>> in a remote machine, not the same JVM, etc. >>> >>> There is a way to share Java objects among annotators running in the >>> same machine, using external resources; see >>> >>> http://incubator.apache.org/uima/downloads/releaseDocs/2.2.2-incubating/docs/html/tutorials_and_users_guides/tutorials_and_users_guides.html#ugr.tug.aae.accessing_external_resource_files >>> >>> While that specifically addresses creating a Java object and then >>> "loading" it from an external file, the loading part is optional. >>> >>> >> What must be done to make the loading part optional ? >> >> If a resource is described without the fileResourceSpecifier element, >> then the framework throws a NullPointerException. >> >> For example: >> >> searchQueryProvider >> org.apache.uima.lucas.SearchQueryProvider >> >> ... >> >> SampleSearchQueryProvider >> org.apache.uima.lucas.SampleSearchQueryProvider >> >> >> >> > > > Instead of a fileResourceSpecifier you can use a customResourceSpecifier. See: > http://incubator.apache.org/uima/downloads/releaseDocs/2.2.2-incubating/docs/html/references/references.html#ugr.ref.xml.component_descriptor.custom_resource_specifiers > The externalResource definition now looks like this SampleSearchQueryProvider org.apache.uima.lucas.SampleSearchQueryProvider and the SampleSearchQueryProvider instance can be accessed by an AnalysisEngine. Thanks for your help, J�rn