blob: 53c13ac123ae91fc332fba5cb1995b7889ba83d1 [file] [log] [blame]
Marcel Offermans7738dfc2008-11-25 00:10:50 +00001/*
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 Offermans50be2552008-09-18 21:13:20 +000019package org.apache.felix.dependencymanager;
20
Marcel Offermans7738dfc2008-11-25 00:10:50 +000021/**
Marcel Offermansabca7852009-01-28 20:48:16 +000022 * Describes a service component dependency. They form descriptions of dependencies
23 * that are managed by the dependency manager. They can be used to query their state
24 * for monitoring tools. The dependency manager shell command is an example of
25 * such a tool.
Marcel Offermans7738dfc2008-11-25 00:10:50 +000026 *
27 * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
28 */
Marcel Offermans50be2552008-09-18 21:13:20 +000029public interface ServiceComponentDependency {
Marcel Offermansabca7852009-01-28 20:48:16 +000030 /** Names for the states of this dependency. */
Marcel Offermans7738dfc2008-11-25 00:10:50 +000031 public static final String[] STATE_NAMES = {
32 "optional unavailable",
33 "optional available",
34 "required unavailable",
35 "required available"
36 };
Marcel Offermansabca7852009-01-28 20:48:16 +000037 /** State constant for an unavailable, optional dependency. */
Marcel Offermans50be2552008-09-18 21:13:20 +000038 public static final int STATE_UNAVAILABLE_OPTIONAL = 0;
Marcel Offermansabca7852009-01-28 20:48:16 +000039 /** State constant for an available, optional dependency. */
Marcel Offermans50be2552008-09-18 21:13:20 +000040 public static final int STATE_AVAILABLE_OPTIONAL = 1;
Marcel Offermansabca7852009-01-28 20:48:16 +000041 /** State constant for an unavailable, required dependency. */
Marcel Offermans50be2552008-09-18 21:13:20 +000042 public static final int STATE_UNAVAILABLE_REQUIRED = 2;
Marcel Offermansabca7852009-01-28 20:48:16 +000043 /** State constant for an available, required dependency. */
Marcel Offermans50be2552008-09-18 21:13:20 +000044 public static final int STATE_AVAILABLE_REQUIRED = 3;
Marcel Offermansabca7852009-01-28 20:48:16 +000045 /** Returns the name of this dependency. */
Marcel Offermans50be2552008-09-18 21:13:20 +000046 public String getName();
Marcel Offermansabca7852009-01-28 20:48:16 +000047 /** Returns the name of the type of this dependency. */
Marcel Offermans50be2552008-09-18 21:13:20 +000048 public String getType();
Marcel Offermansabca7852009-01-28 20:48:16 +000049 /** Returns the state of this dependency. */
Marcel Offermans50be2552008-09-18 21:13:20 +000050 public int getState();
51}