felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pde...@apache.org
Subject svn commit: r1583071 - in /felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm: ./ admin/ impl/
Date Sat, 29 Mar 2014 22:13:13 GMT
Author: pderop
Date: Sat Mar 29 22:13:13 2014
New Revision: 1583071

URL: http://svn.apache.org/r1583071
Log:
- Removed ComponentAdmin service (we will possibly see later if it's worth providing this
service for retrieving ComponentDeclarations).
For now, and for simplicity reasons, I have removed the ComponentAdmin service.
- Moved *Declaration to toplevel dm package (The ComponentDeclaration can be retrieved by
calling Component.getComponentDeclaration() instead of 
casting Component to ComponentDeclaration).


Added:
    felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/ComponentDeclaration.java
    felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/ComponentDependencyDeclaration.java
Removed:
    felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/admin/ComponentAdmin.java
    felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/admin/ComponentDeclaration.java
    felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/admin/ComponentDependencyDeclaration.java
    felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/impl/Activator.java
    felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/impl/ComponentAdminImpl.java
Modified:
    felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/BundleDependency.java
    felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/ConfigurationDependency.java
    felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/ResourceDependency.java
    felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/ServiceDependency.java
    felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/impl/BundleDependencyImpl.java
    felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/impl/DependencyImpl.java
    felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/impl/ResourceDependencyImpl.java

Modified: felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/BundleDependency.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/BundleDependency.java?rev=1583071&r1=1583070&r2=1583071&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/BundleDependency.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/BundleDependency.java Sat Mar
29 22:13:13 2014
@@ -2,8 +2,6 @@ package dm;
 
 import org.osgi.framework.Bundle;
 
-import dm.admin.ComponentDependencyDeclaration;
-
 /**
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */

Added: felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/ComponentDeclaration.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/ComponentDeclaration.java?rev=1583071&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/ComponentDeclaration.java (added)
+++ felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/ComponentDeclaration.java Sat
Mar 29 22:13:13 2014
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package dm;
+
+import java.util.Dictionary;
+
+import org.osgi.framework.BundleContext;
+
+/**
+ * Describes a component. Component declarations form descriptions of components
+ * that are managed by the dependency manager. They can be used to query their state
+ * for monitoring tools. The dependency manager shell command is an example of
+ * such a tool.
+ * 
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
+public interface ComponentDeclaration {
+    /** Names for the states of this component. */
+    public static final String[] STATE_NAMES = { "unregistered", "registered" };
+    /** State constant for an unregistered component. */
+    public static final int STATE_UNREGISTERED = 0;
+    /** State constant for a registered component. */
+    public static final int STATE_REGISTERED = 1;
+    /** Returns a list of dependencies associated with this component. */
+    public ComponentDependencyDeclaration[] getComponentDependencies();
+    /** Returns the description of this component (the classname or the provided service(s))
*/
+    public String getName();
+    /** Returns the class name of the Component implementation. */
+    public String getClassName();
+    /** Returns the service optionally provided by this component, or null */
+    public String[] getServices();
+    /** Returns the service properties, or null */
+    public Dictionary getServiceProperties();     
+    /** Returns the state of this component. */
+    public int getState();
+    /** Returns the instance id of this component. */
+    public long getId();
+    /** Returns the bundle context associated with this component. */
+    public BundleContext getBundleContext();
+    /** Returns the dependency manager for this component */
+    public DependencyManager getDependencyManager();    
+}

Added: felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/ComponentDependencyDeclaration.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/ComponentDependencyDeclaration.java?rev=1583071&view=auto
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/ComponentDependencyDeclaration.java
(added)
+++ felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/ComponentDependencyDeclaration.java
Sat Mar 29 22:13:13 2014
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package dm;
+
+/**
+ * Describes a component dependency. They form descriptions of dependencies
+ * that are managed by the dependency manager. They can be used to query their state
+ * for monitoring tools. The dependency manager shell command is an example of
+ * such a tool.
+ * 
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
+public interface ComponentDependencyDeclaration {
+    /** Names for the states of this dependency. */
+    public static final String[] STATE_NAMES = { 
+        "optional unavailable", 
+        "optional available", 
+        "required unavailable", 
+        "required available",
+        "optional (not tracking)",
+        "required (not tracking)"
+        };
+    /** State constant for an unavailable, optional dependency. */
+    public static final int STATE_UNAVAILABLE_OPTIONAL = 0;
+    /** State constant for an available, optional dependency. */
+    public static final int STATE_AVAILABLE_OPTIONAL = 1;
+    /** State constant for an unavailable, required dependency. */
+    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. */
+    public String getType();
+    /** Returns the state of this dependency. */
+    public int getState();
+}

Modified: felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/ConfigurationDependency.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/ConfigurationDependency.java?rev=1583071&r1=1583070&r2=1583071&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/ConfigurationDependency.java
(original)
+++ felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/ConfigurationDependency.java
Sat Mar 29 22:13:13 2014
@@ -1,6 +1,5 @@
 package dm;
 
-import dm.admin.ComponentDependencyDeclaration;
 
 public interface ConfigurationDependency extends Dependency, ComponentDependencyDeclaration
{
 	ConfigurationDependency setCallback(String callback);

Modified: felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/ResourceDependency.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/ResourceDependency.java?rev=1583071&r1=1583070&r2=1583071&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/ResourceDependency.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/ResourceDependency.java Sat
Mar 29 22:13:13 2014
@@ -2,8 +2,6 @@ package dm;
 
 import java.net.URL;
 
-import dm.admin.ComponentDependencyDeclaration;
-
 /**
  * A resource dependency is a dependency on a resource. A resource in this context is an
object that is
  * identified by a URL. Resources should somehow be provided by an external component, the
resource

Modified: felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/ServiceDependency.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/ServiceDependency.java?rev=1583071&r1=1583070&r2=1583071&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/ServiceDependency.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/ServiceDependency.java Sat
Mar 29 22:13:13 2014
@@ -2,8 +2,6 @@ package dm;
 
 import org.osgi.framework.ServiceReference;
 
-import dm.admin.ComponentDependencyDeclaration;
-
 public interface ServiceDependency extends Dependency, ComponentDependencyDeclaration {
 	public ServiceDependency setCallbacks(String add, String remove);
 	public ServiceDependency setCallbacks(String add, String change, String remove);

Modified: felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/impl/BundleDependencyImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/impl/BundleDependencyImpl.java?rev=1583071&r1=1583070&r2=1583071&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/impl/BundleDependencyImpl.java
(original)
+++ felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/impl/BundleDependencyImpl.java
Sat Mar 29 22:13:13 2014
@@ -14,7 +14,7 @@ import org.osgi.service.log.LogService;
 import tracker.BundleTracker;
 import tracker.BundleTrackerCustomizer;
 import dm.BundleDependency;
-import dm.admin.ComponentDependencyDeclaration;
+import dm.ComponentDependencyDeclaration;
 import dm.context.DependencyContext;
 import dm.context.Event;
 

Modified: felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/impl/DependencyImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/impl/DependencyImpl.java?rev=1583071&r1=1583070&r2=1583071&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/impl/DependencyImpl.java (original)
+++ felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/impl/DependencyImpl.java Sat
Mar 29 22:13:13 2014
@@ -4,8 +4,8 @@ import java.util.Dictionary;
 
 import org.osgi.framework.BundleContext;
 
+import dm.ComponentDependencyDeclaration;
 import dm.Dependency;
-import dm.admin.ComponentDependencyDeclaration;
 import dm.context.ComponentContext;
 import dm.context.DependencyContext;
 import dm.context.Event;

Modified: felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/impl/ResourceDependencyImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/impl/ResourceDependencyImpl.java?rev=1583071&r1=1583070&r2=1583071&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/impl/ResourceDependencyImpl.java
(original)
+++ felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/impl/ResourceDependencyImpl.java
Sat Mar 29 22:13:13 2014
@@ -11,9 +11,9 @@ import org.osgi.framework.ServiceRegistr
 import org.osgi.service.log.LogService;
 
 import dm.Component;
+import dm.ComponentDependencyDeclaration;
 import dm.ResourceDependency;
 import dm.ResourceHandler;
-import dm.admin.ComponentDependencyDeclaration;
 import dm.context.DependencyContext;
 import dm.context.Event;
 



Mime
View raw message