Pierre De Rop | 8be5073 | 2009-12-04 22:18:54 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Licensed to the Apache Software Foundation (ASF) under one |
| 3 | * or more contributor license agreements. See the NOTICE file |
| 4 | * distributed with this work for additional information |
| 5 | * regarding copyright ownership. The ASF licenses this file |
| 6 | * to you under the Apache License, Version 2.0 (the |
| 7 | * "License"); you may not use this file except in compliance |
| 8 | * with the License. You may obtain a copy of the License at |
| 9 | * |
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | * |
| 12 | * Unless required by applicable law or agreed to in writing, |
| 13 | * software distributed under the License is distributed on an |
| 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | * KIND, either express or implied. See the License for the |
| 16 | * specific language governing permissions and limitations |
| 17 | * under the License. |
| 18 | */ |
Marcel Offermans | 8b93efa | 2010-07-02 18:27:21 +0000 | [diff] [blame] | 19 | package org.apache.felix.dm; |
Pierre De Rop | 8be5073 | 2009-12-04 22:18:54 +0000 | [diff] [blame] | 20 | |
Marcel Offermans | 5be5f14 | 2011-04-26 10:47:12 +0000 | [diff] [blame] | 21 | import org.osgi.framework.BundleContext; |
| 22 | |
Pierre De Rop | 8be5073 | 2009-12-04 22:18:54 +0000 | [diff] [blame] | 23 | /** |
Marcel Offermans | faaed47 | 2010-09-08 10:07:32 +0000 | [diff] [blame] | 24 | * Describes a component. Component declarations form descriptions of components |
Pierre De Rop | 8be5073 | 2009-12-04 22:18:54 +0000 | [diff] [blame] | 25 | * that are managed by the dependency manager. They can be used to query their state |
| 26 | * for monitoring tools. The dependency manager shell command is an example of |
| 27 | * such a tool. |
| 28 | * |
| 29 | * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a> |
| 30 | */ |
Marcel Offermans | faaed47 | 2010-09-08 10:07:32 +0000 | [diff] [blame] | 31 | public interface ComponentDeclaration { |
Pierre De Rop | 8be5073 | 2009-12-04 22:18:54 +0000 | [diff] [blame] | 32 | /** Names for the states of this component. */ |
| 33 | public static final String[] STATE_NAMES = { "unregistered", "registered" }; |
| 34 | /** State constant for an unregistered component. */ |
| 35 | public static final int STATE_UNREGISTERED = 0; |
| 36 | /** State constant for a registered component. */ |
| 37 | public static final int STATE_REGISTERED = 1; |
Marcel Offermans | faaed47 | 2010-09-08 10:07:32 +0000 | [diff] [blame] | 38 | /** Returns a list of dependencies associated with this component. */ |
| 39 | public ComponentDependencyDeclaration[] getComponentDependencies(); |
| 40 | /** Returns the name of this component. */ |
Pierre De Rop | 8be5073 | 2009-12-04 22:18:54 +0000 | [diff] [blame] | 41 | public String getName(); |
Marcel Offermans | faaed47 | 2010-09-08 10:07:32 +0000 | [diff] [blame] | 42 | /** Returns the state of this component. */ |
Pierre De Rop | 8be5073 | 2009-12-04 22:18:54 +0000 | [diff] [blame] | 43 | public int getState(); |
Marcel Offermans | 5be5f14 | 2011-04-26 10:47:12 +0000 | [diff] [blame] | 44 | /** Returns the bundle context associated with this component. */ |
| 45 | public BundleContext getBundleContext(); |
Pierre De Rop | 8be5073 | 2009-12-04 22:18:54 +0000 | [diff] [blame] | 46 | } |