Return-Path: Delivered-To: apmail-geronimo-dev-archive@www.apache.org Received: (qmail 27983 invoked from network); 9 Apr 2007 20:03:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Apr 2007 20:03:30 -0000 Received: (qmail 33289 invoked by uid 500); 9 Apr 2007 20:03:36 -0000 Delivered-To: apmail-geronimo-dev-archive@geronimo.apache.org Received: (qmail 32572 invoked by uid 500); 9 Apr 2007 20:03:34 -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 32543 invoked by uid 99); 9 Apr 2007 20:03:34 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Apr 2007 13:03:34 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of jason.dillon@gmail.com designates 64.233.166.178 as permitted sender) Received: from [64.233.166.178] (HELO py-out-1112.google.com) (64.233.166.178) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Apr 2007 13:03:27 -0700 Received: by py-out-1112.google.com with SMTP id f31so1061202pyh for ; Mon, 09 Apr 2007 13:03:06 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:in-reply-to:references:mime-version:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer:sender; b=VE8dZOKpf66HeALmkYKGcMTqKqf4nVoBLvwfotsmIChIQjkLCpc6P+vQeT/QdDRHLX/akZiiFO4TP678ddN2CBUyAeX27LNyoNqevHs+3Xa2AWAqcNtna6ygx9e/7BYZGpB6UZta9QWWOfs0d851zviHYvbtmrjE6b57DP3AEAs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:in-reply-to:references:mime-version:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer:sender; b=ExPJrlm9v2JFFGViqoP4WuNR7qJouJUHZXaVH3fDBXq20MukfudiYsI/rG7OUfAzqWHrwhze0ORctq+74ddHBw8QA+Sffu28QBXYohdgH4OcDWmfNdaaMFGsycnNQRS/hlXkGSNl+3SuQVUkOHUj6JOFi6zDIbigrkwMlJjTs1I= Received: by 10.64.131.4 with SMTP id e4mr12493585qbd.1176148961572; Mon, 09 Apr 2007 13:02:41 -0700 (PDT) Received: from ?10.0.1.2? ( [24.7.69.241]) by mx.google.com with ESMTP id 15sm1434874nzp.2007.04.09.13.02.36; Mon, 09 Apr 2007 13:02:40 -0700 (PDT) In-Reply-To: <20070409195045.09F1C1A9838@eris.apache.org> References: <20070409195045.09F1C1A9838@eris.apache.org> Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Cc: scm@geronimo.apache.org Content-Transfer-Encoding: 7bit From: Jason Dillon Subject: Re: svn commit: r526893 - in /geronimo/server/trunk/modules: geronimo-cxf/src/main/java/org/apache/geronimo/cxf/CXFGBean.java geronimo-webservices/src/main/java/org/apache/geronimo/webservices/SystemPropertyGBean.java Date: Mon, 9 Apr 2007 13:02:31 -0700 To: dev@geronimo.apache.org X-Mailer: Apple Mail (2.752.3) Sender: Jason Dillon X-Virus-Checked: Checked by ClamAV on apache.org Don't we already have one of these somewhere.... --jason On Apr 9, 2007, at 12:50 PM, gawor@apache.org wrote: > Author: gawor > Date: Mon Apr 9 12:50:21 2007 > New Revision: 526893 > > URL: http://svn.apache.org/viewvc?view=rev&rev=526893 > Log: > switch to more generic gbean that sets system properties > > Added: > geronimo/server/trunk/modules/geronimo-webservices/src/main/ > java/org/apache/geronimo/webservices/SystemPropertyGBean.java > (with props) > Removed: > geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/ > apache/geronimo/cxf/CXFGBean.java > > Added: geronimo/server/trunk/modules/geronimo-webservices/src/main/ > java/org/apache/geronimo/webservices/SystemPropertyGBean.java > URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/ > geronimo-webservices/src/main/java/org/apache/geronimo/webservices/ > SystemPropertyGBean.java?view=auto&rev=526893 > ====================================================================== > ======== > --- geronimo/server/trunk/modules/geronimo-webservices/src/main/ > java/org/apache/geronimo/webservices/SystemPropertyGBean.java (added) > +++ geronimo/server/trunk/modules/geronimo-webservices/src/main/ > java/org/apache/geronimo/webservices/SystemPropertyGBean.java Mon > Apr 9 12:50:21 2007 > @@ -0,0 +1,73 @@ > +/** > + * Licensed to the Apache Software Foundation (ASF) under one or more > + * contributor license agreements. See the NOTICE file > distributed with > + * this work for additional information regarding copyright > ownership. > + * The ASF licenses this file to You under the Apache License, > Version 2.0 > + * (the "License"); you may not use this file except in compliance > with > + * the License. You may obtain a copy of the License at > + * > + * http://www.apache.org/licenses/LICENSE-2.0 > + * > + * Unless required by applicable law or agreed to in writing, > software > + * distributed under the License is distributed on an "AS IS" BASIS, > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or > implied. > + * See the License for the specific language governing permissions > and > + * limitations under the License. > + */ > +package org.apache.geronimo.webservices; > + > +import org.apache.geronimo.gbean.GBeanInfo; > +import org.apache.geronimo.gbean.GBeanInfoBuilder; > +import org.apache.geronimo.gbean.GBeanLifecycle; > +import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory; > + > +public class SystemPropertyGBean implements GBeanLifecycle { > + > + private String propertyName; > + private String propertyValue; > + > + public SystemPropertyGBean(String propertyName, String > propertyValue) { > + if (propertyName == null || propertyValue == null) { > + throw new IllegalArgumentException("Property name or > value is null"); > + } > + > + this.propertyName = propertyName; > + this.propertyValue = propertyValue; > + } > + > + public void doStart() throws Exception { > + setProperty(this.propertyName, this.propertyValue); > + } > + > + private void setProperty(String propertyName, String value) { > + String propValue = System.getProperty(propertyName); > + // set only if the property is not set > + if (propValue == null) { > + System.setProperty(propertyName, value); > + } > + } > + > + public void doStop() throws Exception { > + } > + > + public void doFail() { > + } > + > + public static final GBeanInfo GBEAN_INFO; > + > + static { > + GBeanInfoBuilder infoFactory = > GBeanInfoBuilder.createStatic(SystemPropertyGBean.class, > SystemPropertyGBean.class, NameFactory.GERONIMO_SERVICE); > + > + infoFactory.addAttribute("propertyName", String.class, > true, true); > + infoFactory.addAttribute("propertyValue", String.class, > true, true); > + > + infoFactory.setConstructor(new String[] {"propertyName", > "propertyValue"}); > + > + GBEAN_INFO = infoFactory.getBeanInfo(); > + } > + > + public static GBeanInfo getGBeanInfo() { > + return GBEAN_INFO; > + } > + > +} > > Propchange: geronimo/server/trunk/modules/geronimo-webservices/src/ > main/java/org/apache/geronimo/webservices/SystemPropertyGBean.java > ---------------------------------------------------------------------- > -------- > svn:eol-style = native > >