blob: dc3227d208c3c883ca1f80cfdaa44e92804f4f4b [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 Jencks11dbd172014-10-28 19:27:03 +000029 * @author $Id: a3e98bbac97a1d79805f9be0ed7f2ae811f112d0 $
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 /**
68 * The current state of the component configuration.
69 *
70 * <p>
David Jencks1cc2ef72014-08-07 02:11:22 +000071 * This is one of {@link #UNSATISFIED_CONFIGURATION},
72 * {@link #UNSATISFIED_REFERENCE}, {@link #SATISFIED} or {@link #ACTIVE}.
David Jenckse165efc2014-06-15 01:09:26 +000073 */
David Jencks11dbd172014-10-28 19:27:03 +000074 public int state;
75
76 /**
77 * The id of the component configuration.
78 *
79 * <p>
80 * The id is a non-persistent, unique value assigned at runtime. The id is
81 * also available as the {@code component.id} component property. The value
82 * of this field is unspecified if the state of this component configuration
83 * is unsatisfied.
84 */
85 public long id;
David Jenckse165efc2014-06-15 01:09:26 +000086
87 /**
88 * The component properties for the component configuration.
89 *
90 * @see ComponentContext#getProperties()
91 */
92 public Map<String, Object> properties;
93
94 /**
David Jencks1cc2ef72014-08-07 02:11:22 +000095 * The satisfied references.
David Jenckse165efc2014-06-15 01:09:26 +000096 *
97 * <p>
David Jencks1cc2ef72014-08-07 02:11:22 +000098 * Each {@link SatisfiedReferenceDTO} in the array represents a satisfied
99 * reference of the component configuration. The array must be empty if the
100 * component configuration has no satisfied references.
David Jenckse165efc2014-06-15 01:09:26 +0000101 */
David Jencks1cc2ef72014-08-07 02:11:22 +0000102 public SatisfiedReferenceDTO[] satisfiedReferences;
103
104 /**
105 * The unsatisfied references.
106 *
107 * <p>
108 * Each {@link UnsatisfiedReferenceDTO} in the array represents an
109 * unsatisfied reference of the component configuration. The array must be
110 * empty if the component configuration has no unsatisfied references.
111 */
112 public UnsatisfiedReferenceDTO[] unsatisfiedReferences;
David Jenckse165efc2014-06-15 01:09:26 +0000113}