1 /* 2 * Copyright (c) OSGi Alliance (2004, 2017). All Rights Reserved. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package org.osgi.service.component; 18 19 import org.osgi.annotation.versioning.ProviderType; 20 21 /** 22 * Defines standard names for Service Component constants. 23 * 24 * @author $Id: 1638661479ccb1e96861465dbd9d86b2c698214b $ 25 */ 26 @ProviderType 27 public interface ComponentConstants { 28 /** 29 * Manifest header specifying the XML documents within a bundle that contain 30 * the bundle's Service Component descriptions. 31 * <p> 32 * The attribute value may be retrieved from the {@code Dictionary} object 33 * returned by the {@code Bundle.getHeaders} method. 34 */ 35 public static final String SERVICE_COMPONENT = "Service-Component"; 36 37 /** 38 * A component property for a component configuration that contains the name 39 * of the component as specified in the {@code name} attribute of the 40 * {@code component} element. The value of this property must be of type 41 * {@code String}. 42 */ 43 public final static String COMPONENT_NAME = "component.name"; 44 45 /** 46 * A component property that contains the generated id for a component 47 * configuration. The value of this property must be of type {@code Long}. 48 * 49 * <p> 50 * The value of this property is assigned by Service Component Runtime when 51 * a component configuration is created. Service Component Runtime assigns a 52 * unique value that is larger than all previously assigned values since 53 * Service Component Runtime was started. These values are NOT persistent 54 * across restarts of Service Component Runtime. 55 */ 56 public final static String COMPONENT_ID = "component.id"; 57 58 /** 59 * A service registration property for a Component Factory that contains the 60 * value of the {@code factory} attribute. The value of this property must 61 * be of type {@code String}. 62 */ 63 public final static String COMPONENT_FACTORY = "component.factory"; 64 65 /** 66 * The suffix for reference target properties. These properties contain the 67 * filter to select the target services for a reference. The value of this 68 * property must be of type {@code String}. 69 */ 70 public final static String REFERENCE_TARGET_SUFFIX = ".target"; 71 72 /** 73 * The reason the component configuration was deactivated is unspecified. 74 * 75 * @since 1.1 76 */ 77 public static final int DEACTIVATION_REASON_UNSPECIFIED = 0; 78 79 /** 80 * The component configuration was deactivated because the component was 81 * disabled. 82 * 83 * @since 1.1 84 */ 85 public static final int DEACTIVATION_REASON_DISABLED = 1; 86 87 /** 88 * The component configuration was deactivated because a reference became 89 * unsatisfied. 90 * 91 * @since 1.1 92 */ 93 public static final int DEACTIVATION_REASON_REFERENCE = 2; 94 95 /** 96 * The component configuration was deactivated because its configuration was 97 * changed. 98 * 99 * @since 1.1 100 */ 101 public static final int DEACTIVATION_REASON_CONFIGURATION_MODIFIED = 3; 102 103 /** 104 * The component configuration was deactivated because its configuration was 105 * deleted. 106 * 107 * @since 1.1 108 */ 109 public static final int DEACTIVATION_REASON_CONFIGURATION_DELETED = 4; 110 111 /** 112 * The component configuration was deactivated because the component was 113 * disposed. 114 * 115 * @since 1.1 116 */ 117 public static final int DEACTIVATION_REASON_DISPOSED = 5; 118 119 /** 120 * The component configuration was deactivated because the bundle was 121 * stopped. 122 * 123 * @since 1.1 124 */ 125 public static final int DEACTIVATION_REASON_BUNDLE_STOPPED = 6; 126 127 /** 128 * Capability name for Service Component Runtime. 129 * <p> 130 * Used in {@code Provide-Capability} and {@code Require-Capability} 131 * manifest headers with the {@code osgi.extender} namespace. For example: 132 * 133 * <pre> 134 * Require-Capability: osgi.extender; 135 * filter:="(&(osgi.extender=osgi.component)(version>=1.4)(!(version>=2.0)))" 136 * </pre> 137 * 138 * @since 1.3 139 */ 140 public static final String COMPONENT_CAPABILITY_NAME = "osgi.component"; 141 142 /** 143 * Compile time constant for the Specification Version of Declarative 144 * Services. 145 * <p> 146 * Used in {@code Version} and {@code Requirement} annotations. The value of 147 * this compile time constant will change when the specification version of 148 * Declarative Services is updated. 149 * 150 * @since 1.4 151 */ 152 public static final String COMPONENT_SPECIFICATION_VERSION = "1.4.0"; 153 } 154