001 /*
002 * Copyright (c) OSGi Alliance (2004, 2009). All Rights Reserved.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016
017 package org.osgi.service.component;
018
019 /**
020 * Defines standard names for Service Component constants.
021 *
022 * @version $Revision: 6454 $
023 */
024 public interface ComponentConstants {
025 /**
026 * Manifest header specifying the XML documents within a bundle that contain
027 * the bundle's Service Component descriptions.
028 * <p>
029 * The attribute value may be retrieved from the <code>Dictionary</code>
030 * object returned by the <code>Bundle.getHeaders</code> method.
031 */
032 public static final String SERVICE_COMPONENT = "Service-Component";
033
034 /**
035 * A component property for a component configuration that contains the name
036 * of the component as specified in the <code>name</code> attribute of the
037 * <code>component</code> element. The value of this property must be of
038 * type <code>String</code>.
039 */
040 public final static String COMPONENT_NAME = "component.name";
041
042 /**
043 * A component property that contains the generated id for a component
044 * configuration. The value of this property must be of type
045 * <code>Long</code>.
046 *
047 * <p>
048 * The value of this property is assigned by the Service Component Runtime
049 * when a component configuration is created. The Service Component Runtime
050 * assigns a unique value that is larger than all previously assigned values
051 * since the Service Component Runtime was started. These values are NOT
052 * persistent across restarts of the Service Component Runtime.
053 */
054 public final static String COMPONENT_ID = "component.id";
055
056 /**
057 * A service registration property for a Component Factory that contains the
058 * value of the <code>factory</code> attribute. The value of this property
059 * must be of type <code>String</code>.
060 */
061 public final static String COMPONENT_FACTORY = "component.factory";
062
063 /**
064 * The suffix for reference target properties. These properties contain the
065 * filter to select the target services for a reference. The value of this
066 * property must be of type <code>String</code>.
067 */
068 public final static String REFERENCE_TARGET_SUFFIX = ".target";
069
070 /**
071 * The reason the component configuration was deactivated is unspecified.
072 *
073 * @since 1.1
074 */
075 public static final int DEACTIVATION_REASON_UNSPECIFIED = 0;
076
077 /**
078 * The component configuration was deactivated because the component was disabled.
079 *
080 * @since 1.1
081 */
082 public static final int DEACTIVATION_REASON_DISABLED = 1;
083
084 /**
085 * The component configuration was deactivated because a reference became unsatisfied.
086 *
087 * @since 1.1
088 */
089 public static final int DEACTIVATION_REASON_REFERENCE = 2;
090
091 /**
092 * The component configuration was deactivated because its configuration was changed.
093 *
094 * @since 1.1
095 */
096 public static final int DEACTIVATION_REASON_CONFIGURATION_MODIFIED = 3;
097
098 /**
099 * The component configuration was deactivated because its configuration was deleted.
100 *
101 * @since 1.1
102 */
103 public static final int DEACTIVATION_REASON_CONFIGURATION_DELETED = 4;
104
105 /**
106 * The component configuration was deactivated because the component was disposed.
107 *
108 * @since 1.1
109 */
110 public static final int DEACTIVATION_REASON_DISPOSED = 5;
111
112 /**
113 * The component configuration was deactivated because the bundle was stopped.
114 *
115 * @since 1.1
116 */
117 public static final int DEACTIVATION_REASON_BUNDLE_STOPPED = 6;
118 }