felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r994975 - /felix/trunk/dependencymanager/shell/src/main/java/org/apache/felix/dm/shell/DMCommand.java
Date Wed, 08 Sep 2010 10:33:02 GMT
Author: marrs
Date: Wed Sep  8 10:33:01 2010
New Revision: 994975

URL: http://svn.apache.org/viewvc?rev=994975&view=rev
Log:
Big refactoring, renamed "Service" to "Component" whenever it was referring to the thing that
has dependencies and registers itself as a service.

Modified:
    felix/trunk/dependencymanager/shell/src/main/java/org/apache/felix/dm/shell/DMCommand.java

Modified: felix/trunk/dependencymanager/shell/src/main/java/org/apache/felix/dm/shell/DMCommand.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/shell/src/main/java/org/apache/felix/dm/shell/DMCommand.java?rev=994975&r1=994974&r2=994975&view=diff
==============================================================================
--- felix/trunk/dependencymanager/shell/src/main/java/org/apache/felix/dm/shell/DMCommand.java
(original)
+++ felix/trunk/dependencymanager/shell/src/main/java/org/apache/felix/dm/shell/DMCommand.java
Wed Sep  8 10:33:01 2010
@@ -24,8 +24,8 @@ import java.util.Arrays;
 import java.util.Comparator;
 import java.util.StringTokenizer;
 
-import org.apache.felix.dm.ServiceComponent;
-import org.apache.felix.dm.ServiceComponentDependency;
+import org.apache.felix.dm.ComponentDeclaration;
+import org.apache.felix.dm.ComponentDependencyDeclaration;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.InvalidSyntaxException;
@@ -79,21 +79,21 @@ public class DMCommand {
             }
             // lookup all dependency manager service components
             try {
-                ServiceReference[] references = m_context.getServiceReferences(ServiceComponent.class.getName(),
null);
+                ServiceReference[] references = m_context.getServiceReferences(ComponentDeclaration.class.getName(),
null);
                 // show their state
                 if (references != null) {
                     Arrays.sort(references, SORTER);
                     long lastBundleId = -1;
                     for (int i = 0; i < references.length; i++) {
                         ServiceReference ref = references[i];
-                        ServiceComponent sc = (ServiceComponent) m_context.getService(ref);
+                        ComponentDeclaration sc = (ComponentDeclaration) m_context.getService(ref);
                         if (sc != null) {
                             String name = sc.getName();
                             int state = sc.getState();
                             Bundle bundle = ref.getBundle();
                             long bundleId = bundle.getBundleId();
                             if (ids.size() == 0 || ids.contains(Long.valueOf(bundleId)))
{
-                                if (!notavail || (notavail && sc.getState() == ServiceComponent.STATE_UNREGISTERED))
{
+                                if (!notavail || (notavail && sc.getState() == ComponentDeclaration.STATE_UNREGISTERED))
{
                                     if (lastBundleId != bundleId) {
                                         lastBundleId = bundleId;
                                         if (compact) {
@@ -104,19 +104,19 @@ public class DMCommand {
                                         }
                                     }
                                     if (compact) {
-                                        out.print(" " + compactName(name) + " " + compactState(ServiceComponent.STATE_NAMES[state]));
+                                        out.print(" " + compactName(name) + " " + compactState(ComponentDeclaration.STATE_NAMES[state]));
                                     }
                                     else {
-                                        out.println("  " + name + " " + ServiceComponent.STATE_NAMES[state]);
+                                        out.println("  " + name + " " + ComponentDeclaration.STATE_NAMES[state]);
                                     }
                                     if (!nodeps) {
-                                        ServiceComponentDependency[] dependencies = sc.getComponentDependencies();
+                                        ComponentDependencyDeclaration[] dependencies = sc.getComponentDependencies();
                                         if (dependencies != null && dependencies.length
> 0) {
                                             if (compact) {
                                                 out.print('(');
                                             }
                                             for (int j = 0; j < dependencies.length; j++)
{
-                                                ServiceComponentDependency dep = dependencies[j];
+                                                ComponentDependencyDeclaration dep = dependencies[j];
                                                 String depName = dep.getName();
                                                 String depType = dep.getType();
                                                 int depState = dep.getState();
@@ -124,10 +124,10 @@ public class DMCommand {
                                                     if (j > 0) {
                                                         out.print(' ');
                                                     }
-                                                    out.print(compactName(depName) + " "
+ compactState(depType) + " " + compactState(ServiceComponentDependency.STATE_NAMES[depState]));
+                                                    out.print(compactName(depName) + " "
+ compactState(depType) + " " + compactState(ComponentDependencyDeclaration.STATE_NAMES[depState]));
                                                 }
                                                 else {
-                                                    out.println("    " + depName + " " +
depType + " " + ServiceComponentDependency.STATE_NAMES[depState]);
+                                                    out.println("    " + depName + " " +
depType + " " + ComponentDependencyDeclaration.STATE_NAMES[depState]);
                                                 }
                                             }
                                             if (compact) {



Mime
View raw message