blob: fbed36dbbc82649150bd5b7abcbf42e5a1e7df7c [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
29 * @author $Id: b3f49d694f497e55dc7ffed0e7d910fb3bab83da $
30 */
31public class ComponentConfigurationDTO extends DTO {
32 /**
33 * The component configuration is unsatisfied.
34 *
35 * <p>
36 * This is the initial state of a component configuration. When the
37 * component configuration becomes satisfied it enters the
38 * {@link #SATISFIED} state.
39 */
40 public static final int UNSATISFIED = 1;
41
42 /**
43 * The component configuration is satisfied.
44 *
45 * <p>
46 * Any {@link ComponentDescriptionDTO#serviceInterfaces services} declared by
47 * the component description are registered.
48 *
49 * If the component configuration becomes unsatisfied for any reason, any
50 * declared services must be unregistered and the component configuration
51 * returns to the {@link #UNSATISFIED} state.
52 */
53 public static final int SATISFIED = 2;
54
55 /**
56 * The component configuration is active.
57 *
58 * <p>
59 * This is the normal operational state of a component configuration. The
60 * component configuration will move to the {@link #SATISFIED} state when it
61 * is deactivated.
62 */
63 public static final int ACTIVE = 4;
64
65 /**
66 * The representation of the component configuration's component
67 * description.
68 */
69 public ComponentDescriptionDTO description;
70
71 /**
72 * The current state of the component configuration.
73 *
74 * <p>
75 * This is one of {@link #UNSATISFIED}, {@link #SATISFIED} or
76 * {@link #ACTIVE}.
77 */
78 public int state;
79
80 /**
81 * The component properties for the component configuration.
82 *
83 * @see ComponentContext#getProperties()
84 */
85 public Map<String, Object> properties;
86
87 /**
88 * The currently bound references.
89 *
90 * <p>
91 * Each {@link BoundReferenceDTO} in the array represents a service bound to a
92 * reference of the component configuration. The array will be empty if the
93 * component configuration has no bound references.
94 */
95 public BoundReferenceDTO[] boundReferences;
96
97 /**
98 * The id of the component description.
99 *
100 * <p>
101 * The id is a non-persistent, unique value assigned at runtime. The id is
102 * also available as the {@code component.id} component property.
103 */
104 public long id;
105}