Return-Path: X-Original-To: apmail-felix-commits-archive@www.apache.org Delivered-To: apmail-felix-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 518CB10D70 for ; Wed, 5 Mar 2014 15:35:35 +0000 (UTC) Received: (qmail 2736 invoked by uid 500); 5 Mar 2014 15:35:34 -0000 Delivered-To: apmail-felix-commits-archive@felix.apache.org Received: (qmail 2689 invoked by uid 500); 5 Mar 2014 15:35:34 -0000 Mailing-List: contact commits-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list commits@felix.apache.org Received: (qmail 2682 invoked by uid 99); 5 Mar 2014 15:35:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Mar 2014 15:35:34 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Mar 2014 15:35:32 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 8FEE1238897A; Wed, 5 Mar 2014 15:35:12 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1574527 - in /felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/admin: ./ ComponentAdmin.java ComponentDeclaration.java ComponentDependencyDeclaration.java packageinfo Date: Wed, 05 Mar 2014 15:35:12 -0000 To: commits@felix.apache.org From: pderop@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140305153512.8FEE1238897A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: pderop Date: Wed Mar 5 15:35:12 2014 New Revision: 1574527 URL: http://svn.apache.org/r1574527 Log: Introduced new singleton "ComponentAdmin" service, which provides access to all dependency manager components. Added: felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/admin/ 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/admin/packageinfo Added: felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/admin/ComponentAdmin.java URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/admin/ComponentAdmin.java?rev=1574527&view=auto ============================================================================== --- felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/admin/ComponentAdmin.java (added) +++ felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/admin/ComponentAdmin.java Wed Mar 5 15:35:12 2014 @@ -0,0 +1,30 @@ +package dm.admin; + +import java.util.List; + +import org.osgi.framework.Bundle; + +/** + * Service for administering Dependency Manager components. + * The main purpose of this interface is to provides access to the components declared by all + * dependency manager instances at runtime. + */ +public interface ComponentAdmin { + /** + * Returns components declared by all dependency managers instances. + * @return the list of components declared by all dependency managers instances. + */ + List getComponents(); + + /** + * Returns the component matching a given id. + * @return the component matching a given id or null. + */ + ComponentDeclaration getComponent(long componentId); + + /** + * Returns the components declared by dependency managers being part of a given bundle. + * @return the components declared by dependency managers being part of a given bundle. + */ + List getComponents(Bundle bundle); +} Added: felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/admin/ComponentDeclaration.java URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/admin/ComponentDeclaration.java?rev=1574527&view=auto ============================================================================== --- felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/admin/ComponentDeclaration.java (added) +++ felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/admin/ComponentDeclaration.java Wed Mar 5 15:35:12 2014 @@ -0,0 +1,60 @@ +/* + * 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.admin; + +import java.util.Dictionary; + +import org.osgi.framework.BundleContext; + +import dm.DependencyManager; + +/** + * 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 Felix Project Team + */ +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/admin/ComponentDependencyDeclaration.java URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/admin/ComponentDependencyDeclaration.java?rev=1574527&view=auto ============================================================================== --- felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/admin/ComponentDependencyDeclaration.java (added) +++ felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/admin/ComponentDependencyDeclaration.java Wed Mar 5 15:35:12 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.admin; + +/** + * 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 Felix Project Team + */ +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(); +} Added: felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/admin/packageinfo URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/admin/packageinfo?rev=1574527&view=auto ============================================================================== --- felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/admin/packageinfo (added) +++ felix/sandbox/pderop/dependencymanager-prototype/dm/src/dm/admin/packageinfo Wed Mar 5 15:35:12 2014 @@ -0,0 +1 @@ +version 1.0 \ No newline at end of file