geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r179874 - in /geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime: AbstractGBeanReference.java GBeanInstance.java GBeanInstanceState.java GBeanSingleReference.java
Date Fri, 03 Jun 2005 19:58:56 GMT
Author: dain
Date: Fri Jun  3 12:58:55 2005
New Revision: 179874

URL: http://svn.apache.org/viewcvs?rev=179874&view=rev
Log:
Always log why a component fails

Modified:
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/AbstractGBeanReference.java
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstanceState.java
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanSingleReference.java

Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/AbstractGBeanReference.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/AbstractGBeanReference.java?rev=179874&r1=179873&r2=179874&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/AbstractGBeanReference.java
(original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/AbstractGBeanReference.java
Fri Jun  3 12:58:55 2005
@@ -277,9 +277,9 @@
     }
 
     protected final String getDescription() {
-        return "Reference Name: " + getName() +
+        return "GBeanInstance: " + gbeanInstance.getName() +
+                ", Reference Name: " + getName() +
                 ", Reference Type: " + getReferenceType() +
-                ", Proxy Type: " + getProxy() +
-                ", GBeanInstance: " + gbeanInstance.getName();
+                ", Proxy Type: " + getProxy();
     }
 }

Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java?rev=179874&r1=179873&r2=179874&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
(original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
Fri Jun  3 12:58:55 2005
@@ -329,6 +329,11 @@
         }
 
         // if the bean is already stopped or failed, this will do nothing; otherwise it will
shutdown the bean
+        int state = getState();
+        if (state == State.STOPPED_INDEX || state == State.FAILED_INDEX) {
+            log.error("GBeanInstance should already be stopped before die() is called: objectName="
+ objectName);
+        }
+
         gbeanInstanceState.fail();
 
         // tell everyone we are done

Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstanceState.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstanceState.java?rev=179874&r1=179873&r2=179874&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstanceState.java
(original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstanceState.java
Fri Jun  3 12:58:55 2005
@@ -334,11 +334,12 @@
             }
         } catch (Throwable t) {
             // oops there was a problem and the gbean failed
+            log.error("Error while starting; GBean is now in the FAILED state: objectName=\""
+ objectName + "\"", t);
             setStateInstance(State.FAILED);
             lifecycleBroadcaster.fireFailedEvent();
 
             if (t instanceof Exception) {
-                log.error("Error while starting; GBean is now in the FAILED state: objectName=\""
+ objectName + "\"", t);
+                // ignore - we only rethrow errors
             } else if (t instanceof Error) {
                 throw (Error) t;
             } else {
@@ -402,11 +403,12 @@
                 return;
             }
         } catch (Throwable t) {
+            log.error("Error while stopping; GBean is now in the FAILED state: objectName=\""
+ objectName + "\"", t);
             setStateInstance(State.FAILED);
             lifecycleBroadcaster.fireFailedEvent();
 
             if (t instanceof Exception) {
-                log.error("Error while stopping; GBean is now in the FAILED state: objectName=\""
+ objectName + "\"", t);
+                // ignore - we only rethrow errors
             } else if (t instanceof Error) {
                 throw (Error) t;
             } else {

Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanSingleReference.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanSingleReference.java?rev=179874&r1=179873&r2=179874&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanSingleReference.java
(original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanSingleReference.java
Fri Jun  3 12:58:55 2005
@@ -116,6 +116,9 @@
         // if we are running, and we now have two valid targets, which is an illegal state
so we need to fail
         GBeanInstance gbeanInstance = getGBeanInstance();
         if (gbeanInstance.getStateInstance() == State.RUNNING) {
+            log.error("Illegal state: two or more targets are not running for a signle valued
reference: " + getDescription() +
+                    ", currentTarget=" + proxyTarget +
+                    ", newTarget=" + target);
             gbeanInstance.referenceFailed();
         } else if (waitingForMe) {
             Set targets = getTargets();
@@ -130,6 +133,8 @@
         GBeanInstance gbeanInstance = getGBeanInstance();
         if (gbeanInstance.getStateInstance() == State.RUNNING) {
             // we no longer have a valid target, which is an illegal state so we need to
fail
+            log.error("Illegal state: current target for a signle valued reference stopped:
" + getDescription() +
+                    ", currentTarget=" + target);
             gbeanInstance.referenceFailed();
         } else if (waitingForMe) {
             Set targets = getTargets();



Mime
View raw message