geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dwo...@apache.org
Subject svn commit: r554114 - in /geronimo/server/trunk: configs/j2ee-system/src/plan/ modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/runtime/ modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/
Date Sat, 07 Jul 2007 01:57:27 GMT
Author: dwoods
Date: Fri Jul  6 18:57:26 2007
New Revision: 554114

URL: http://svn.apache.org/viewvc?view=rev&rev=554114
Log:
GERONIMO-2385 server does not update any state when persistent configuration is loaded and
ready to serve applications

Added:
    geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/ServerStatus.java
  (with props)
    geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/ServerStatusGBean.java
  (with props)
Modified:
    geronimo/server/trunk/configs/j2ee-system/src/plan/plan.xml
    geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
    geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/EmbeddedDaemon.java

Modified: geronimo/server/trunk/configs/j2ee-system/src/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/j2ee-system/src/plan/plan.xml?view=diff&rev=554114&r1=554113&r2=554114
==============================================================================
--- geronimo/server/trunk/configs/j2ee-system/src/plan/plan.xml (original)
+++ geronimo/server/trunk/configs/j2ee-system/src/plan/plan.xml Fri Jul  6 18:57:26 2007
@@ -41,6 +41,11 @@
         </reference>
     </gbean>
 
+    <!-- Pinged and changed when the server completes loading when all the persistent
configuration is loaded -->
+    <gbean name="ServerStatus" class="org.apache.geronimo.system.main.ServerStatusGBean">
+        <attribute name="serverStarted">false</attribute>
+    </gbean>
+
     <!--Configuration Store service-->
     <gbean name="Local" class="org.apache.geronimo.system.configuration.RepositoryConfigurationStore">
         <reference name="Repository">

Modified: geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java?view=diff&rev=554114&r1=554113&r2=554114
==============================================================================
--- geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
(original)
+++ geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
Fri Jul  6 18:57:26 2007
@@ -882,7 +882,7 @@
             } else if (instanceState == DESTROYING) {
                 // this should never ever happen... this method is protected by the GBeanState
class which should
                 // prevent stuff like this happening, but check anyway
-                stateReason = "an internal error has occurred.  An was made to start an instance
that was still stopping which is an illegal state transition.";
+                stateReason = "an internal error has occurred.  An attempt was made to start
an instance that was still stopping which is an illegal state transition.";
                 throw new IllegalStateException("A stopping instance can not be started until
fully stopped");
             }
             assert instanceState == DESTROYED;

Modified: geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/EmbeddedDaemon.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/EmbeddedDaemon.java?view=diff&rev=554114&r1=554113&r2=554114
==============================================================================
--- geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/EmbeddedDaemon.java
(original)
+++ geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/EmbeddedDaemon.java
Fri Jul  6 18:57:26 2007
@@ -20,6 +20,7 @@
 import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 
@@ -154,6 +155,16 @@
                         monitor.moduleStarting(configID);
                         configurationManager.startConfiguration(configID, lifecycleMonitor);
                         monitor.moduleStarted(configID);
+                    }
+                    // the server has finished loading the persistent configuration so inform
the gbean
+                    AbstractNameQuery startedQuery = new AbstractNameQuery(ServerStatus.class.getName());
+                    Set statusBeans = kernel.listGBeans(startedQuery);
+                    for(Iterator itr = statusBeans.iterator();itr.hasNext();) {
+                        AbstractName statusName = (AbstractName)itr.next();
+                        ServerStatus status = (ServerStatus)kernel.getGBean(statusName);
+                        if(status != null) {
+                            status.setServerStarted(true);
+                        }
                     }
                 } finally {
                     ConfigurationUtil.releaseConfigurationManager(kernel, configurationManager);

Added: geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/ServerStatus.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/ServerStatus.java?view=auto&rev=554114
==============================================================================
--- geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/ServerStatus.java
(added)
+++ geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/ServerStatus.java
Fri Jul  6 18:57:26 2007
@@ -0,0 +1,28 @@
+/**
+ *  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.system.main;
+
+
+/**
+ * @version $Rev:385659 $ $Date: 2007-03-07 14:40:07 +1100 (Wed, 07 Mar 2007) $
+ */
+public interface ServerStatus {
+    public boolean isServerStarted();
+    public void setServerStarted(boolean flag);
+}
+

Propchange: geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/ServerStatus.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/ServerStatusGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/ServerStatusGBean.java?view=auto&rev=554114
==============================================================================
--- geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/ServerStatusGBean.java
(added)
+++ geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/ServerStatusGBean.java
Fri Jul  6 18:57:26 2007
@@ -0,0 +1,51 @@
+/**
+ *  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.system.main;
+
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+
+
+/**
+ * @version $Rev:385659 $ $Date: 2007-03-07 14:40:07 +1100 (Wed, 07 Mar 2007) $
+ */
+public class ServerStatusGBean implements ServerStatus {
+    public static final String SERVER_STATUS = "ServerStatus";
+    private boolean serverStarted = false;
+
+    public boolean isServerStarted() {
+        return serverStarted;
+    }
+
+    public void setServerStarted(boolean flag) {
+        serverStarted = flag;
+    }
+
+    public static final GBeanInfo GBEAN_INFO;
+
+    static {
+        GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(SERVER_STATUS, ServerStatusGBean.class);
+        infoFactory.addAttribute("serverStarted", Boolean.TYPE, true);
+        GBEAN_INFO = infoFactory.getBeanInfo();
+    }
+
+    public static GBeanInfo getGBeanInfo() {
+        return GBEAN_INFO;
+    }
+}
+

Propchange: geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/ServerStatusGBean.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message