geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r307336 - in /geronimo/trunk: applications/magicGball/ modules/assembly/src/plan/ modules/system/src/java/org/apache/geronimo/system/properties/
Date Sun, 09 Oct 2005 00:46:27 GMT
Author: djencks
Date: Sat Oct  8 17:46:22 2005
New Revision: 307336

URL: http://svn.apache.org/viewcvs?rev=307336&view=rev
Log:
GBean for setting lots of system properties, and use it for corba/ssl properties

Added:
    geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/properties/SystemProperties.java
Modified:
    geronimo/trunk/applications/magicGball/maven.xml
    geronimo/trunk/modules/assembly/src/plan/client-system-plan.xml
    geronimo/trunk/modules/assembly/src/plan/naming-server-plan.xml

Modified: geronimo/trunk/applications/magicGball/maven.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/magicGball/maven.xml?rev=307336&r1=307335&r2=307336&view=diff
==============================================================================
--- geronimo/trunk/applications/magicGball/maven.xml (original)
+++ geronimo/trunk/applications/magicGball/maven.xml Sat Oct  8 17:46:22 2005
@@ -83,8 +83,8 @@
 
     <goal name="initVars">
         <j:set var="geronimo.home" value="${maven.build.dir}/geronimo-${geronimo_version}"/>
-        <j:set var="geronimo.corba.options" value="-Djavax.rmi.CORBA.UtilClass=org.openejb.corba.util.UtilDelegateImpl
-Dorg.openejb.corba.UtilDelegateClass=com.sun.corba.se.internal.POA.ShutdownUtilDelegate -Dorg.omg.CORBA.ORBSingletonClass=com.sun.corba.se.internal.corba.ORBSingleton
-Dorg.omg.CORBA.ORBClass=org.openejb.corba.sunorb.OpenEJBORB -Djavax.rmi.CORBA.PortableRemoteObjectClass=com.sun.corba.se.internal.javax.rmi.PortableRemoteObject
"/>
-        <j:set var="geronimo.ssl.options" value="-Djavax.net.ssl.keyStore=${geronimo.home}/var/security/keystore
-Djavax.net.ssl.keyStorePassword=secret  -Djavax.net.ssl.trustStore=${geronimo.home}/var/security/keystore
-Djavax.net.ssl.trustStorePassword=secret  "/>
+<!--        <j:set var="geronimo.corba.options" value="-Djavax.rmi.CORBA.UtilClass=org.openejb.corba.util.UtilDelegateImpl
-Dorg.openejb.corba.UtilDelegateClass=com.sun.corba.se.internal.POA.ShutdownUtilDelegate -Dorg.omg.CORBA.ORBSingletonClass=com.sun.corba.se.internal.corba.ORBSingleton
-Dorg.omg.CORBA.ORBClass=org.openejb.corba.sunorb.OpenEJBORB -Djavax.rmi.CORBA.PortableRemoteObjectClass=com.sun.corba.se.internal.javax.rmi.PortableRemoteObject
"/>-->
+<!--        <j:set var="geronimo.ssl.options" value="-Djavax.net.ssl.keyStore=${geronimo.home}/var/security/keystore
-Djavax.net.ssl.keyStorePassword=secret  -Djavax.net.ssl.trustStore=${geronimo.home}/var/security/keystore
-Djavax.net.ssl.trustStorePassword=secret  "/>-->
     </goal>
 
     <goal name="startServer" prereqs="initVars">

Modified: geronimo/trunk/modules/assembly/src/plan/client-system-plan.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/assembly/src/plan/client-system-plan.xml?rev=307336&r1=307335&r2=307336&view=diff
==============================================================================
--- geronimo/trunk/modules/assembly/src/plan/client-system-plan.xml (original)
+++ geronimo/trunk/modules/assembly/src/plan/client-system-plan.xml Sat Oct  8 17:46:22 2005
@@ -62,6 +62,25 @@
         <reference name="ServerInfo"><name>ServerInfo</name></reference>
     </gbean>
 
+    <gbean name="SystemProperties" class="org.apache.geronimo.system.properties.SystemProperties">
+        <attribute name="systemProperties">
+            javax.rmi.CORBA.UtilClass=org.openejb.corba.util.UtilDelegateImpl
+            org.openejb.corba.UtilDelegateClass=com.sun.corba.se.internal.POA.ShutdownUtilDelegate
+            org.omg.CORBA.ORBSingletonClass=com.sun.corba.se.internal.corba.ORBSingleton
+            org.omg.CORBA.ORBClass=org.openejb.corba.sunorb.OpenEJBORB
+            javax.rmi.CORBA.PortableRemoteObjectClass=com.sun.corba.se.internal.javax.rmi.PortableRemoteObject
+            javax.net.ssl.keyStorePassword=secret
+            javax.net.ssl.trustStorePassword=secret
+        </attribute>
+        <attribute name="systemPathProperties">
+            javax.net.ssl.keyStore=var/security/keystore
+            javax.net.ssl.trustStore=var/security/keystore
+        </attribute>
+        <reference name="ServerInfo">
+            <name>ServerInfo</name>
+        </reference>
+    </gbean>
+
     <!-- Logging service -->
     <gbean name="Logger" class="org.apache.geronimo.system.logging.log4j.Log4jService">
         <attribute name="configFileName">var/log/client-log4j.properties</attribute>

Modified: geronimo/trunk/modules/assembly/src/plan/naming-server-plan.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/assembly/src/plan/naming-server-plan.xml?rev=307336&r1=307335&r2=307336&view=diff
==============================================================================
--- geronimo/trunk/modules/assembly/src/plan/naming-server-plan.xml (original)
+++ geronimo/trunk/modules/assembly/src/plan/naming-server-plan.xml Sat Oct  8 17:46:22 2005
@@ -86,4 +86,25 @@
         <attribute name="namingFactoryUrlPkgs">org.apache.geronimo.naming</attribute>
         <attribute name="namingProviderUrl">rmi://${PlanServerHostname}:${PlanNamingPort}</attribute>
     </gbean>
+
+    <gbean name="SystemProperties" class="org.apache.geronimo.system.properties.SystemProperties">
+        <attribute name="systemProperties">
+            javax.rmi.CORBA.UtilClass=org.openejb.corba.util.UtilDelegateImpl
+            org.openejb.corba.UtilDelegateClass=com.sun.corba.se.internal.POA.ShutdownUtilDelegate
+            org.omg.CORBA.ORBSingletonClass=com.sun.corba.se.internal.corba.ORBSingleton
+            org.omg.CORBA.ORBClass=org.openejb.corba.sunorb.OpenEJBORB
+            javax.rmi.CORBA.PortableRemoteObjectClass=com.sun.corba.se.internal.javax.rmi.PortableRemoteObject
+            javax.net.ssl.keyStorePassword=secret
+            javax.net.ssl.trustStorePassword=secret
+        </attribute>
+        <attribute name="systemPathProperties">
+            javax.net.ssl.keyStore=var/security/keystore
+            javax.net.ssl.trustStore=var/security/keystore
+        </attribute>
+        <reference name="ServerInfo">
+            <module>org/apache/geronimo/System</module>
+            <name>ServerInfo</name>
+        </reference>
+    </gbean>
+
 </configuration>

Added: geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/properties/SystemProperties.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/properties/SystemProperties.java?rev=307336&view=auto
==============================================================================
--- geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/properties/SystemProperties.java
(added)
+++ geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/properties/SystemProperties.java
Sat Oct  8 17:46:22 2005
@@ -0,0 +1,73 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed 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.system.properties;
+
+import java.util.Iterator;
+import java.util.Properties;
+import java.util.Map;
+
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.system.serverinfo.ServerInfo;
+
+/**
+ * @version $Rev:  $ $Date:  $
+ */
+public class SystemProperties {
+
+
+    public SystemProperties(Properties properties, Properties pathProperties, ServerInfo
serverInfo) {
+        if (properties != null) {
+            for (Iterator iterator = properties.entrySet().iterator(); iterator.hasNext();)
{
+                Map.Entry entry = (Map.Entry) iterator.next();
+                String propertyName = (String) entry.getKey();
+                String propertyValue = (String) entry.getValue();
+                if (System.getProperty(propertyName) == null) {
+                    System.setProperty(propertyName, propertyValue);
+                }
+            }
+        }
+        if (pathProperties != null && serverInfo != null) {
+            for (Iterator iterator = pathProperties.entrySet().iterator(); iterator.hasNext();)
{
+                Map.Entry entry = (Map.Entry) iterator.next();
+                String propertyName = (String) entry.getKey();
+                String propertyValue = (String) entry.getValue();
+                propertyValue = serverInfo.resolvePath(propertyValue);
+                if (System.getProperty(propertyName) == null) {
+                    System.setProperty(propertyName, propertyValue);
+                }
+            }
+        }
+    }
+
+    public static final GBeanInfo GBEAN_INFO;
+
+    static {
+        GBeanInfoBuilder infoBuilder = new GBeanInfoBuilder(SystemProperties.class, "GBean");
+        infoBuilder.addAttribute("systemProperties", Properties.class, true, true);
+        infoBuilder.addAttribute("systemPathProperties", Properties.class, true, true);
+        infoBuilder.addReference("ServerInfo", ServerInfo.class, "GBean");
+        infoBuilder.setConstructor(new String[] {"systemProperties", "systemPathProperties",
"ServerInfo"});
+
+        GBEAN_INFO = infoBuilder.getBeanInfo();
+    }
+
+    public static GBeanInfo getGBeanInfo() {
+        return GBEAN_INFO;
+    }
+
+}



Mime
View raw message