felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1212507 - in /felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm: ./ impl/dependencies/
Date Fri, 09 Dec 2011 16:45:38 GMT
Author: marrs
Date: Fri Dec  9 16:45:38 2011
New Revision: 1212507

URL: http://svn.apache.org/viewvc?rev=1212507&view=rev
Log:
FELIX-3264 updated the shell command to show '(not tracking)' for dependencies that are not
started yet

Modified:
    felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/ComponentDependencyDeclaration.java
    felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/BundleDependencyImpl.java
    felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/ConfigurationDependencyImpl.java
    felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/DependencyBase.java
    felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/ResourceDependencyImpl.java
    felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/ServiceDependencyImpl.java

Modified: felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/ComponentDependencyDeclaration.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/ComponentDependencyDeclaration.java?rev=1212507&r1=1212506&r2=1212507&view=diff
==============================================================================
--- felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/ComponentDependencyDeclaration.java
(original)
+++ felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/ComponentDependencyDeclaration.java
Fri Dec  9 16:45:38 2011
@@ -32,7 +32,9 @@ public interface ComponentDependencyDecl
         "optional unavailable", 
         "optional available", 
         "required unavailable", 
-        "required available" 
+        "required available",
+        "optional (not tracking)",
+        "required (not tracking)"
         };
     /** State constant for an unavailable, optional dependency. */
     public static final int STATE_UNAVAILABLE_OPTIONAL = 0;
@@ -42,6 +44,10 @@ public interface ComponentDependencyDecl
     public static final int STATE_UNAVAILABLE_REQUIRED = 2;
     /** State constant for an available, required dependency. */
     public static final int STATE_AVAILABLE_REQUIRED = 3;
+    /** State constant for an optional dependency that has not been started yet. */
+    public static final int STATE_OPTIONAL = 4;
+    /** State constant for a required dependency that has not been started yet. */
+    public static final int STATE_REQUIRED = 5;
     /** Returns the name of this dependency. */
     public String getName();
     /** Returns the name of the type of this dependency. */

Modified: felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/BundleDependencyImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/BundleDependencyImpl.java?rev=1212507&r1=1212506&r2=1212507&view=diff
==============================================================================
--- felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/BundleDependencyImpl.java
(original)
+++ felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/BundleDependencyImpl.java
Fri Dec  9 16:45:38 2011
@@ -45,7 +45,6 @@ import org.osgi.service.log.LogService;
  */
 public class BundleDependencyImpl extends DependencyBase implements BundleDependency, BundleTrackerCustomizer,
ComponentDependencyDeclaration {
 	private final BundleContext m_context;
-	private boolean m_isStarted;
 	private BundleTracker m_tracker;
 	private int m_stateMask = Bundle.INSTALLED | Bundle.RESOLVED | Bundle.ACTIVE;
 	private List m_services = new ArrayList();
@@ -151,10 +150,6 @@ public class BundleDependencyImpl extend
         return sb.toString();
 	}
 
-	public int getState() {
-        return (isAvailable() ? 1 : 0) + (isRequired() ? 2 : 0);
-	}
-
 	public String getType() {
 		return "bundle";
 	}

Modified: felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/ConfigurationDependencyImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/ConfigurationDependencyImpl.java?rev=1212507&r1=1212506&r2=1212507&view=diff
==============================================================================
--- felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/ConfigurationDependencyImpl.java
(original)
+++ felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/ConfigurationDependencyImpl.java
Fri Dec  9 16:45:38 2011
@@ -69,7 +69,6 @@ public class ConfigurationDependencyImpl
     protected List m_services = new ArrayList();
 	private Dictionary m_settings;
     private String m_callback;
-    private boolean m_isStarted;
 	private final Set m_updateInvokedCache = new HashSet();
     private MetaTypeProviderImpl m_metaType;
     private boolean m_propagate;
@@ -287,10 +286,6 @@ public class ConfigurationDependencyImpl
         return m_pid;
     }
 
-    public int getState() {
-        return (isAvailable() ? 1 : 0) + (isRequired() ? 2 : 0);
-    }
-
     public String getType() {
         return "configuration";
     }

Modified: felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/DependencyBase.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/DependencyBase.java?rev=1212507&r1=1212506&r2=1212507&view=diff
==============================================================================
--- felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/DependencyBase.java
(original)
+++ felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/DependencyBase.java
Fri Dec  9 16:45:38 2011
@@ -18,6 +18,7 @@
  */
 package org.apache.felix.dm.impl.dependencies;
 
+import org.apache.felix.dm.ComponentDependencyDeclaration;
 import org.apache.felix.dm.Dependency;
 import org.apache.felix.dm.DependencyActivation;
 import org.apache.felix.dm.impl.Logger;
@@ -29,6 +30,7 @@ public abstract class DependencyBase imp
     private boolean m_isRequired;
     private boolean m_isInstanceBound;
     protected final Logger m_logger;
+    protected volatile boolean m_isStarted;
 
     public DependencyBase(Logger logger) {
         m_logger = logger;
@@ -55,4 +57,14 @@ public abstract class DependencyBase imp
     public final void setIsInstanceBound(boolean isInstanceBound) {
         m_isInstanceBound = isInstanceBound;
     }
+    
+    public int getState() {
+        if (m_isStarted) {
+            return (isAvailable() ? 1 : 0) + (isRequired() ? 2 : 0);
+        }
+        else {
+            return isRequired() ? ComponentDependencyDeclaration.STATE_REQUIRED : ComponentDependencyDeclaration.STATE_OPTIONAL;
+        }
+    }
+
 }

Modified: felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/ResourceDependencyImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/ResourceDependencyImpl.java?rev=1212507&r1=1212506&r2=1212507&view=diff
==============================================================================
--- felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/ResourceDependencyImpl.java
(original)
+++ felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/ResourceDependencyImpl.java
Fri Dec  9 16:45:38 2011
@@ -53,7 +53,6 @@ public class ResourceDependencyImpl exte
     protected List m_services = new ArrayList();
 	private String m_resourceFilter;
 	private URL m_trackedResource;
-    private boolean m_isStarted;
     private List m_resources = new ArrayList();
     private URL m_resourceInstance;
     private boolean m_propagate;
@@ -441,10 +440,6 @@ public class ResourceDependencyImpl exte
         return sb.toString();
     }
 
-    public int getState() {
-        return (isAvailable() ? 1 : 0) + (isRequired() ? 2 : 0);
-    }
-
     public String getType() {
         return "resource";
     }

Modified: felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/ServiceDependencyImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/ServiceDependencyImpl.java?rev=1212507&r1=1212506&r2=1212507&view=diff
==============================================================================
--- felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/ServiceDependencyImpl.java
(original)
+++ felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/ServiceDependencyImpl.java
Fri Dec  9 16:45:38 2011
@@ -65,7 +65,6 @@ public class ServiceDependencyImpl exten
     private volatile String m_trackedServiceFilter;
     private volatile String m_trackedServiceFilterUnmodified;
     private volatile ServiceReference m_trackedServiceReference;
-    private volatile boolean m_isStarted;
     private Object m_callbackInstance;
     private String m_callbackAdded;
     private String m_callbackChanged;
@@ -1047,10 +1046,6 @@ public class ServiceDependencyImpl exten
         return sb.toString();
     }
 
-    public int getState() {
-        return (isAvailable() ? 1 : 0) + (isRequired() ? 2 : 0);
-    }
-
     public String getType() {
         return "service";
     }



Mime
View raw message