David Jencks | e165efc | 2014-06-15 01:09:26 +0000 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package org.osgi.service.component.runtime.dto; |
| 18 | |
| 19 | import java.util.Map; |
| 20 | import org.osgi.dto.DTO; |
| 21 | import 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 Jencks | 11dbd17 | 2014-10-28 19:27:03 +0000 | [diff] [blame^] | 29 | * @author $Id: a3e98bbac97a1d79805f9be0ed7f2ae811f112d0 $ |
David Jencks | e165efc | 2014-06-15 01:09:26 +0000 | [diff] [blame] | 30 | */ |
| 31 | public class ComponentConfigurationDTO extends DTO { |
| 32 | /** |
David Jencks | 1cc2ef7 | 2014-08-07 02:11:22 +0000 | [diff] [blame] | 33 | * The component configuration is unsatisfied due to a missing required |
| 34 | * configuration. |
David Jencks | e165efc | 2014-06-15 01:09:26 +0000 | [diff] [blame] | 35 | */ |
David Jencks | 1cc2ef7 | 2014-08-07 02:11:22 +0000 | [diff] [blame] | 36 | 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 Jencks | e165efc | 2014-06-15 01:09:26 +0000 | [diff] [blame] | 43 | |
| 44 | /** |
| 45 | * The component configuration is satisfied. |
| 46 | * |
| 47 | * <p> |
David Jencks | 1cc2ef7 | 2014-08-07 02:11:22 +0000 | [diff] [blame] | 48 | * Any {@link ComponentDescriptionDTO#serviceInterfaces services} declared |
| 49 | * by the component description are registered. |
David Jencks | e165efc | 2014-06-15 01:09:26 +0000 | [diff] [blame] | 50 | */ |
David Jencks | 1cc2ef7 | 2014-08-07 02:11:22 +0000 | [diff] [blame] | 51 | public static final int SATISFIED = 4; |
David Jencks | e165efc | 2014-06-15 01:09:26 +0000 | [diff] [blame] | 52 | |
| 53 | /** |
| 54 | * The component configuration is active. |
| 55 | * |
| 56 | * <p> |
David Jencks | 1cc2ef7 | 2014-08-07 02:11:22 +0000 | [diff] [blame] | 57 | * This is the normal operational state of a component configuration. |
David Jencks | e165efc | 2014-06-15 01:09:26 +0000 | [diff] [blame] | 58 | */ |
David Jencks | 1cc2ef7 | 2014-08-07 02:11:22 +0000 | [diff] [blame] | 59 | public static final int ACTIVE = 8; |
David Jencks | e165efc | 2014-06-15 01:09:26 +0000 | [diff] [blame] | 60 | |
| 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 Jencks | 1cc2ef7 | 2014-08-07 02:11:22 +0000 | [diff] [blame] | 71 | * This is one of {@link #UNSATISFIED_CONFIGURATION}, |
| 72 | * {@link #UNSATISFIED_REFERENCE}, {@link #SATISFIED} or {@link #ACTIVE}. |
David Jencks | e165efc | 2014-06-15 01:09:26 +0000 | [diff] [blame] | 73 | */ |
David Jencks | 11dbd17 | 2014-10-28 19:27:03 +0000 | [diff] [blame^] | 74 | 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 Jencks | e165efc | 2014-06-15 01:09:26 +0000 | [diff] [blame] | 86 | |
| 87 | /** |
| 88 | * The component properties for the component configuration. |
| 89 | * |
| 90 | * @see ComponentContext#getProperties() |
| 91 | */ |
| 92 | public Map<String, Object> properties; |
| 93 | |
| 94 | /** |
David Jencks | 1cc2ef7 | 2014-08-07 02:11:22 +0000 | [diff] [blame] | 95 | * The satisfied references. |
David Jencks | e165efc | 2014-06-15 01:09:26 +0000 | [diff] [blame] | 96 | * |
| 97 | * <p> |
David Jencks | 1cc2ef7 | 2014-08-07 02:11:22 +0000 | [diff] [blame] | 98 | * 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 Jencks | e165efc | 2014-06-15 01:09:26 +0000 | [diff] [blame] | 101 | */ |
David Jencks | 1cc2ef7 | 2014-08-07 02:11:22 +0000 | [diff] [blame] | 102 | 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 Jencks | e165efc | 2014-06-15 01:09:26 +0000 | [diff] [blame] | 113 | } |