avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nic...@apache.org
Subject svn commit: rev 30713 - avalon/trunk/runtime/merlin/impl/src/java/org/apache/avalon/merlin/impl
Date Mon, 26 Jul 2004 11:51:52 GMT
Author: niclas
Date: Mon Jul 26 04:51:51 2004
New Revision: 30713

Modified:
   avalon/trunk/runtime/merlin/impl/src/java/org/apache/avalon/merlin/impl/DefaultFactory.java
Log:
Removed the indirect dependency/consumption in the Audit report. Submitted by Stephen.

Modified: avalon/trunk/runtime/merlin/impl/src/java/org/apache/avalon/merlin/impl/DefaultFactory.java
==============================================================================
--- avalon/trunk/runtime/merlin/impl/src/java/org/apache/avalon/merlin/impl/DefaultFactory.java
(original)
+++ avalon/trunk/runtime/merlin/impl/src/java/org/apache/avalon/merlin/impl/DefaultFactory.java
Mon Jul 26 04:51:51 2004
@@ -447,7 +447,7 @@
         factory.setLoggingManager( logging );
         factory.setDefaultDeploymentTimeout( criteria.getDeploymentTimeout() );
         factory.setTraceEnabled( criteria.isDebugEnabled() );
-        factory.setDefaultProxyPolicy( criteria.isProxyEnabled() );
+        factory.setDefaultProxyPolicy( criteria.isProxyEnabled() );
         factory.setWorkingDirectory( criteria.getContextDirectory() );
         factory.setTemporaryDirectory( criteria.getTempDirectory() );
         factory.setAnchorDirectory( criteria.getAnchorDirectory() );
@@ -945,7 +945,7 @@
     public void printDeploymentModel( 
       StringBuffer buffer, String lead, DeploymentModel model )
     {
-        DeploymentModel[] providers = model.getProviderGraph();
+        DeploymentModel[] providers = model.getProviders();
         DeploymentModel[] consumers = model.getConsumerGraph();
 
         if(( providers.length == 0 ) && ( consumers.length == 0 ))
@@ -956,13 +956,28 @@
         if( providers.length > 0 ) for( int i=0; i<providers.length; i++ )
         {
             DeploymentModel m = providers[i];
-            buffer.append( "\n" + lead + "  <-- " + m );
+            buffer.append( "\n" + lead + "  <-- consumes: " + m  );
         }
 
         if( consumers.length > 0 ) for( int i=0; i<consumers.length; i++ )
         {
             DeploymentModel m = consumers[i];
-            buffer.append( "\n" + lead + "  --> " + m );
+            if( isDirectProvider( m, model ) )
+            {
+                buffer.append( "\n" + lead + "  --> supplies: " + m );
+            }
+        }
+    }
+
+    private boolean isDirectProvider( DeploymentModel consumer, DeploymentModel model )
+    {
+        String name = model.getQualifiedName();
+        DeploymentModel[] providers = consumer.getProviders();
+        for( int i=0; i<providers.length; i++ )
+        {
+             DeploymentModel m = providers[i];
+             if( m.getQualifiedName().equals( name ) ) return true;
         }
+        return false;
     }
 }

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org


Mime
View raw message