Return-Path: Delivered-To: apmail-geronimo-dev-archive@www.apache.org Received: (qmail 77344 invoked from network); 19 Nov 2004 07:04:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 19 Nov 2004 07:04:34 -0000 Received: (qmail 48284 invoked by uid 500); 19 Nov 2004 07:04:28 -0000 Delivered-To: apmail-geronimo-dev-archive@geronimo.apache.org Received: (qmail 48246 invoked by uid 500); 19 Nov 2004 07:04:27 -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 Delivered-To: mailing list dev@geronimo.apache.org Received: (qmail 48229 invoked by uid 99); 19 Nov 2004 07:04:27 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from [64.14.202.141] (HELO mgd.gluecode.com) (64.14.202.141) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 18 Nov 2004 23:04:24 -0800 Received: from [192.168.1.105] (dsl093-038-137.pdx1.dsl.speakeasy.net [66.93.38.137]) (authenticated bits=0) by mgd.gluecode.com (8.12.10/8.12.10) with ESMTP id iAJ74GCW025032 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NO) for ; Thu, 18 Nov 2004 23:04:17 -0800 Mime-Version: 1.0 (Apple Message framework v619) In-Reply-To: References: Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <381D70AA-39F9-11D9-8F70-000D93361CAA@gluecode.com> Content-Transfer-Encoding: 7bit From: David Jencks Subject: Re: Can GBean get its configuration ClassLoader? Date: Thu, 18 Nov 2004 23:04:13 -0800 To: dev@geronimo.apache.org X-Mailer: Apple Mail (2.619) X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N On Nov 18, 2004, at 9:54 PM, Srinath Perera wrote: > Just two quick question, > 1) is there anyway one can add/register magic attributes form code or > plan? (Just for INFO have not find for use case for it yet :) ) no, unless you rewrite the GBeanMBean class. There's a fairly wide variety, and a request to add a reference to ServerInfo as a magic attribute. If you need another, discuss it: adding one is a moderately large architectural decision. > 2) Does GBean constrcters support injecting magic attributes only? You can inject any persistent attribute, magic attribute, or reference (collection). Most gbeans now use constructor dependency injection only, and the ones that don't are being converted as their classes are worked on. I think the normal ordering convention is to put regular persistent attributes first, then references (and reference collections), then magic attributes. Attributes start with lower case letters, References with upper case. note that magic attributes are NOT persistent, whereas regular attributes in the constructor must be persistent. thanks david jencks > Thanks > Srinath > > > > On Thu, 18 Nov 2004 13:54:28 -0500 (EST), Aaron Mulder > wrote: >> Right, you helped me out with this in person a few days ago... >> Thanks. BTW, as a note for anyone else who's interested, GBeanMBean >> has a >> section at the bottom defining all the available magic attributes, and >> there are a lot of them. Dain pointed me to that, too. :) >> >> Aaron >> >> >> >> On Thu, 18 Nov 2004, Dain Sundstrom wrote: >>> You simply declare an attribute of type ClassLoader, named >>> "classLoader", which is not persistent, and the framework will >>> automatically inject the correct class loader. >>> >>> -dain >>> >>> -- >>> Dain Sundstrom >>> Chief Architect >>> Gluecode Software >>> 310.536.8355, ext. 26 >>> >>> On Nov 18, 2004, at 7:49 AM, Alan D. Cabrera wrote: >>> >>>>> -----Original Message----- >>>>> From: Aaron Mulder [mailto:ammulder@alumni.princeton.edu] >>>>> Sent: Sunday, November 14, 2004 10:56 PM >>>>> To: dev@geronimo.apache.org >>>>> Subject: Can GBean get its configuration ClassLoader? >>>>> >>>>> I wonder if there's a way for a GBean to get the ClassLoader for >>>>> the configuration it's a part of -- in other words, the >>>>> GBeanMBean.getClassLoader(), which includes the dependencies in the >>>>> deployment plan, etc. >>>>> I want the SQLSecurityRealm to be able to load a driver class. >>>>> However, the SQLSecurityRealm itself was loaded in the Server >>>>> configuration, and the JDBC driver is included as a dependency of >>>>> the >>>>> service deployment plan that declares the realm (but gets the >>>>> SQLSecurityRealm class from its parent). So the SQLSecurityRealm >>>> can't >>>>> see the driver classes in a child of it's own CL, and the >>>>> ThreadContextClassLoader does not appear to be set to something >>>>> useful >>>>> when doStart is called on the GBean. >>>>> I basically want to be able to call some static method to get >>>> the >>>>> GBeanMBean for the current GBean implementation class, becasue >>>>> then I >>>>> could get the ClassLoader from it. But any other suggestions >>>>> would be >>>>> appreciated too. :) >>>> >>>> Why not declare the driver in the same plan as the SQLSecurityRealm >>>> and >>>> use the magic attribute classLoader? >>>> >>>> >>>> Regards, >>>> Alan >>>> >>>> >>> >>> >> >