You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@excalibur.apache.org by cr...@apache.org on 2004/12/04 17:22:27 UTC

svn commit: r109810 - /excalibur/trunk/fortress/container-impl/src/java/org/apache/avalon/fortress/impl/AbstractContainer.java

Author: crafterm
Date: Sat Dec  4 08:22:27 2004
New Revision: 109810

URL: http://svn.apache.org/viewcvs?view=rev&rev=109810
Log:
Applying patch from Jira FORTRESS-11.

Adds extra startup/shutdown information regarding component dependencies
to the fortress logs.

Modified:
   excalibur/trunk/fortress/container-impl/src/java/org/apache/avalon/fortress/impl/AbstractContainer.java

Modified: excalibur/trunk/fortress/container-impl/src/java/org/apache/avalon/fortress/impl/AbstractContainer.java
Url: http://svn.apache.org/viewcvs/excalibur/trunk/fortress/container-impl/src/java/org/apache/avalon/fortress/impl/AbstractContainer.java?view=diff&rev=109810&p1=excalibur/trunk/fortress/container-impl/src/java/org/apache/avalon/fortress/impl/AbstractContainer.java&r1=109809&p2=excalibur/trunk/fortress/container-impl/src/java/org/apache/avalon/fortress/impl/AbstractContainer.java&r2=109810
==============================================================================
--- excalibur/trunk/fortress/container-impl/src/java/org/apache/avalon/fortress/impl/AbstractContainer.java	(original)
+++ excalibur/trunk/fortress/container-impl/src/java/org/apache/avalon/fortress/impl/AbstractContainer.java	Sat Dec  4 08:22:27 2004
@@ -752,8 +752,13 @@
             int i = 1;
             for ( Iterator iter = vertices.iterator(); iter.hasNext(); i++ )
             {
-                Vertex v = (Vertex) iter.next();
-                getLogger().debug( "  #" + i + " (" + v.getOrder() + ") : " + v.getName() );
+                final Vertex v = (Vertex) iter.next();
+                final int o = v.getOrder();
+                
+                getLogger().debug(
+                    "  #" + i + " (" + o + ") : " + v.getName() 
+                    + ( o > 0 ? ( " [ " + getVertexDeps(v) + " ]" ) : "" )
+                );
             }
         }
 
@@ -774,8 +779,13 @@
             int i = 1;
             for ( Iterator iter = m_shutDownOrder.iterator(); iter.hasNext(); i++ )
             {
-                Vertex v = (Vertex) iter.next();
-                getLogger().debug( "  #" + i + " (" + v.getOrder() + ") : " + v.getName() );
+                final Vertex v = (Vertex) iter.next();
+                final int o = v.getOrder();
+                
+                getLogger().debug(
+                    "  #" + i + " (" + o + ") : " + v.getName() 
+                    + ( o > 0 ? ( " [ " + getVertexDeps(v) + " ]" ) : "" )
+                );
             }
         }
 
@@ -789,6 +799,30 @@
             ContainerUtil.dispose( handler );
             if ( getLogger().isDebugEnabled() ) getLogger().debug( "Done." );
         }
+    }
+    
+    /**
+     * Obtain the names of the dependencies for a given vertex.
+     * 
+     * @param vertex vertex to examine
+     * @return comma separated String listing the dependencies for this vertex
+     */
+    private String getVertexDeps( final Vertex vertex )
+    {
+        final List deps = vertex.getDependencies();
+        final StringBuffer buf = new StringBuffer( "" );
+        
+        for ( Iterator i = deps.iterator(); i.hasNext(); )
+        {
+            final Vertex dep = ( Vertex ) i.next();
+            buf.append( dep.getName() );
+
+            if ( i.hasNext() ) {
+                buf.append( ", " );
+            }
+        }
+        
+        return buf.toString();
     }
 
     /**

---------------------------------------------------------------------
To unsubscribe, e-mail: scm-unsubscribe@excalibur.apache.org
For additional commands, e-mail: scm-help@excalibur.apache.org