blob: b320f62fe2fb153262d5ea6e60cd39c48b7d631d [file] [log] [blame]
David Jenckse165efc2014-06-15 01:09:26 +00001/*
2 * Copyright (c) OSGi Alliance (2013, 2014). 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
17package org.osgi.service.component.runtime.dto;
18
19import java.util.Map;
20import org.osgi.dto.DTO;
21import org.osgi.service.component.ComponentContext;
22
23/**
24 * A representation of an actual instance of a declared component description
25 * parameterized by component properties.
26 *
27 * @since 1.3
28 * @NotThreadSafe
David Jencks1cc2ef72014-08-07 02:11:22 +000029 * @author $Id: f519b5fddd8002ffc252d039856acc8ba6f422d6 $
David Jenckse165efc2014-06-15 01:09:26 +000030 */
31public class ComponentConfigurationDTO extends DTO {
32 /**
David Jencks1cc2ef72014-08-07 02:11:22 +000033 * The component configuration is unsatisfied due to a missing required
34 * configuration.
David Jenckse165efc2014-06-15 01:09:26 +000035 */
David Jencks1cc2ef72014-08-07 02:11:22 +000036 public static final int UNSATISFIED_CONFIGURATION = 1;
37
38 /**
39 * The component configuration is unsatisfied due to an unsatisfied
40 * reference.
41 */
42 public static final int UNSATISFIED_REFERENCE = 2;
David Jenckse165efc2014-06-15 01:09:26 +000043
44 /**
45 * The component configuration is satisfied.
46 *
47 * <p>
David Jencks1cc2ef72014-08-07 02:11:22 +000048 * Any {@link ComponentDescriptionDTO#serviceInterfaces services} declared
49 * by the component description are registered.
David Jenckse165efc2014-06-15 01:09:26 +000050 */
David Jencks1cc2ef72014-08-07 02:11:22 +000051 public static final int SATISFIED = 4;
David Jenckse165efc2014-06-15 01:09:26 +000052
53 /**
54 * The component configuration is active.
55 *
56 * <p>
David Jencks1cc2ef72014-08-07 02:11:22 +000057 * This is the normal operational state of a component configuration.
David Jenckse165efc2014-06-15 01:09:26 +000058 */
David Jencks1cc2ef72014-08-07 02:11:22 +000059 public static final int ACTIVE = 8;
David Jenckse165efc2014-06-15 01:09:26 +000060
61 /**
62 * The representation of the component configuration's component
63 * description.
64 */
65 public ComponentDescriptionDTO description;
66
67 /**
David Jencksbae44842014-06-21 20:15:24 +000068 * The id of the component configuration.
69 *
70 * <p>
71 * The id is a non-persistent, unique value assigned at runtime. The id is
72 * also available as the {@code component.id} component property.
73 */
74 public long id;
75
76 /**
David Jenckse165efc2014-06-15 01:09:26 +000077 * The current state of the component configuration.
78 *
79 * <p>
David Jencks1cc2ef72014-08-07 02:11:22 +000080 * This is one of {@link #UNSATISFIED_CONFIGURATION},
81 * {@link #UNSATISFIED_REFERENCE}, {@link #SATISFIED} or {@link #ACTIVE}.
David Jenckse165efc2014-06-15 01:09:26 +000082 */
83 public int state;
84
85 /**
86 * The component properties for the component configuration.
87 *
88 * @see ComponentContext#getProperties()
89 */
90 public Map<String, Object> properties;
91
92 /**
David Jencks1cc2ef72014-08-07 02:11:22 +000093 * The satisfied references.
David Jenckse165efc2014-06-15 01:09:26 +000094 *
95 * <p>
David Jencks1cc2ef72014-08-07 02:11:22 +000096 * Each {@link SatisfiedReferenceDTO} in the array represents a satisfied
97 * reference of the component configuration. The array must be empty if the
98 * component configuration has no satisfied references.
David Jenckse165efc2014-06-15 01:09:26 +000099 */
David Jencks1cc2ef72014-08-07 02:11:22 +0000100 public SatisfiedReferenceDTO[] satisfiedReferences;
101
102 /**
103 * The unsatisfied references.
104 *
105 * <p>
106 * Each {@link UnsatisfiedReferenceDTO} in the array represents an
107 * unsatisfied reference of the component configuration. The array must be
108 * empty if the component configuration has no unsatisfied references.
109 */
110 public UnsatisfiedReferenceDTO[] unsatisfiedReferences;
David Jenckse165efc2014-06-15 01:09:26 +0000111}