Return-Path: X-Original-To: apmail-geronimo-dev-archive@www.apache.org Delivered-To: apmail-geronimo-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 128024EC3 for ; Wed, 29 Jun 2011 08:08:08 +0000 (UTC) Received: (qmail 89405 invoked by uid 500); 29 Jun 2011 08:08:07 -0000 Delivered-To: apmail-geronimo-dev-archive@geronimo.apache.org Received: (qmail 88805 invoked by uid 500); 29 Jun 2011 08:08:05 -0000 Mailing-List: contact dev-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list dev@geronimo.apache.org Received: (qmail 87771 invoked by uid 99); 29 Jun 2011 08:07:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Jun 2011 08:07:52 +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; Wed, 29 Jun 2011 08:07:49 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 6725E438F19 for ; Wed, 29 Jun 2011 08:07:28 +0000 (UTC) Date: Wed, 29 Jun 2011 08:07:28 +0000 (UTC) From: "Ivan (JIRA)" To: dev@geronimo.apache.org Message-ID: <1129866666.1562.1309334848403.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1714128152.36092.1308903407586.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Resolved] (GERONIMO-6022) Support use the @Resource(name="java:global/env/abc") for environment entry injection MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/GERONIMO-6022?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ivan resolved GERONIMO-6022. ---------------------------- Resolution: Fixed > Support use the @Resource(name="java:global/env/abc") for environment entry injection > ------------------------------------------------------------------------------------- > > Key: GERONIMO-6022 > URL: https://issues.apache.org/jira/browse/GERONIMO-6022 > Project: Geronimo > Issue Type: Bug > Security Level: public(Regular issues) > Components: naming > Affects Versions: 3.0 > Reporter: Ivan > Assignee: Ivan > Fix For: 3.0 > > Attachments: 0001-GERONIMO-6022-Add-a-referenceType-for-different-inje.patch > > > It looks to me that it is nature to use lookup attribute, not the name attribute, but it will be better that we could inject env-entry with this style. > I went through the related parts in the Java EE 6 spec, and do not find some explicit descriptions for this, only found the words below. From it, it seems that it is valid to define environment entry in those sharable namespace, I could see many ways for using this, e.g. in an ear package, which contains some wars, ejbs etc. > a. Declare an entry like java:global/env/abc in one war package, and all other components could use @Resource(name="java:global/env/abc") to inject values. > b. More than one components declare the entry java:global/env/abc with the same values, it is OK, but fails while the values are different. > c. Declare the entry in the application.xml, other modules just use it. > In current EnvironmentEntryBuilder, it somewhat supports the behaviors above. But it totally depends on the naming build order of those sub components, if one component just uses the value is found first, it will be ignored due to no target value is found. > ---> EE 5.2.2 > If multiple application components declare an environment entry in one of the > shared namespaces, all attributes of that entry must be identical in each > declaration. For example, if multiple components declare a resource reference > with the same java:app name, the authentication and shareable attributes must > be identical. > If all attributes of each declaration of a shared environment entry are not > identical, this must be reported as a deployment error to the Deployer. The > deployment tool may allow the Deployer to correct the error and continue > deployment. > By default, environment entries declared by application components are > created in the java:comp/env namespace. Environment entries may be declared > in any one of the defined namespaces by explicitly including the namespace prefix > before the name. It is recommended but not required that environment entries be > created in the env subcontext of the corresponding naming context. For example, > entries shared within a module should be declared in the java:module/env > context. Note that names that are not under the env subcontext may conflict with > the current or future versions of this specification, with server-defined names, > such as the names of applications or modules, or with server-defined resources. > Names in the env subcontexts of any of the namespaces must only be created by > an explicit declaration in an application or by an explicit action by an > administrator; the application server must not predefine any names in the env > subcontext of any of the namespaces, or in any subcontext of any such env > context. > <--- -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira