summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/tags/2.0.1-RC1/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/OSGiProperty.java
blob: ff889f85776796efa67d5d4750646f16d3014183 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.    
 */

package org.apache.tuscany.sca.implementation.osgi;

import javax.xml.namespace.QName;

/**
 * <tuscany:osgi.property> 
 */
public interface OSGiProperty {
    String NAME = "name";
    String TYPE = "type";
    String VALUE = "value";
    QName PROPERTY_QNAME = new QName(OSGiImplementation.SCA11_TUSCANY_NS, "osgi.property");

    String REMOTE_CONFIG_SCA = "org.osgi.sca";
    String SCA_BINDINGS = "org.osgi.sca.bindings";
    String SCA_REFERENCE = "sca.reference";
    String SCA_SERVICE = "sca.service";
    String SCA_REFERENCE_BINDING = "sca.reference.binding";
    String SCA_SERVICE_BINDING = "sca.service.binding";

    /**
     * Service property identifying the configuration types supported by a
     * distribution provider. Registered by the distribution provider on one of
     * its services to indicate the supported configuration types.
     * <p>
     * The value of this property must be of type <code>String</code>,
     * <code>String[]</code>, or <code>Collection&lt;String&gt;</code>.
     */
    public static final String REMOTE_CONFIGS_SUPPORTED = "remote.configs.supported";

    /**
     * Service property identifying the intents supported by a distribution
     * provider. Registered by the distribution provider on one of its services
     * to indicate the vocabulary of implemented intents.
     * 
     * <p>
     * The value of this property must be of type <code>String</code>,
     * <code>String[]</code>, or <code>Collection&lt;String&gt;</code>.
     */
    public static final String REMOTE_INTENTS_SUPPORTED = "remote.intents.supported";

    /**
     * Service property identifying the configuration types that should be used
     * to export the service. Each configuration type represents the
     * configuration parameters for an endpoint. A distribution provider should
     * create an endpoint for each configuration type that it supports.
     * 
     * <p>
     * This property may be supplied in the <code>properties</code>
     * <code>Dictionary</code> object passed to the
     * <code>BundleContext.registerService</code> method. The value of this
     * property must be of type <code>String</code>, <code>String[]</code>, or
     * <code>Collection&lt;String&gt;</code>.
     */
    public static final String SERVICE_EXPORTED_CONFIGS = "service.exported.configs";

    /**
     * Service property identifying the intents that the distribution provider
     * must implement to distribute the service. Intents listed in this property
     * are reserved for intents that are critical for the code to function
     * correctly, for example, ordering of messages. These intents should not be
     * configurable.
     * 
     * <p>
     * This property may be supplied in the <code>properties</code>
     * <code>Dictionary</code> object passed to the
     * <code>BundleContext.registerService</code> method. The value of this
     * property must be of type <code>String</code>, <code>String[]</code>, or
     * <code>Collection&lt;String&gt;</code>.
     */
    public static final String SERVICE_EXPORTED_INTENTS = "service.exported.intents";

    /**
     * Service property identifying the extra intents that the distribution
     * provider must implement to distribute the service. This property is
     * merged with the <code>service.exported.intents</code> property before the
     * distribution provider interprets the listed intents; it has therefore the
     * same semantics but the property should be configurable so the
     * administrator can choose the intents based on the topology. Bundles
     * should therefore make this property configurable, for example through the
     * Configuration Admin service.
     * 
     * <p>
     * This property may be supplied in the <code>properties</code>
     * <code>Dictionary</code> object passed to the
     * <code>BundleContext.registerService</code> method. The value of this
     * property must be of type <code>String</code>, <code>String[]</code>, or
     * <code>Collection&lt;String&gt;</code>.
     */
    public static final String SERVICE_EXPORTED_INTENTS_EXTRA = "service.exported.intents.extra";

    /**
     * Service property marking the service for export. It defines the
     * interfaces under which this service can be exported. This list must be a
     * subset of the types under which the service was registered. The single
     * value of an asterisk (&quot;*&quot;, &#92;u002A) indicates all the
     * interface types under which the service was registered excluding the
     * non-interface types. It is strongly recommended to only export interface
     * types and not concrete classes due to the complexity of creating proxies
     * for some type of concrete classes.
     * 
     * <p>
     * This property may be supplied in the <code>properties</code>
     * <code>Dictionary</code> object passed to the
     * <code>BundleContext.registerService</code> method. The value of this
     * property must be of type <code>String</code>, <code>String[]</code>, or
     * <code>Collection&lt;String&gt;</code>.
     */
    public static final String SERVICE_EXPORTED_INTERFACES = "service.exported.interfaces";

    /**
     * Service property identifying the service as imported. This service
     * property must be set by a distribution provider to any value when it
     * registers the endpoint proxy as an imported service. A bundle can use
     * this property to filter out imported services.
     * 
     * <p>
     * The value of this property may be of any type.
     */
    public static final String SERVICE_IMPORTED = "service.imported";

    /**
     * Service property identifying the configuration types used to import the
     * service. Any associated properties for this configuration types must be
     * properly mapped to the importing system. For example, a URL in these
     * properties must point to a valid resource when used in the importing
     * framework. If multiple configuration types are listed in this property,
     * then they must be synonyms for exactly the same remote endpoint that is
     * used to export this service.
     * 
     * <p>
     * The value of this property must be of type <code>String</code>,
     * <code>String[]</code>, or <code>Collection&lt;String&gt;</code>.
     * 
     * @see #SERVICE_EXPORTED_CONFIGS
     */
    public static final String SERVICE_IMPORTED_CONFIGS = "service.imported.configs";

    /**
     * Service property identifying the intents that this service implement.
     * This property has a dual purpose:
     * <ul>
     * <li>A bundle can use this service property to notify the distribution
     * provider that these intents are already implemented by the exported
     * service object.</li>
     * <li>A distribution provider must use this property to convey the combined
     * intents of: The exporting service, and, the intents that the exporting
     * distribution provider adds, and the intents that the importing
     * distribution provider adds.</li>
     * </ul>
     * To export a service, a distribution provider must expand any qualified
     * intents. Both the exporting and importing distribution providers must
     * recognize all intents before a service can be distributed.
     * 
     * <p>
     * The value of this property must be of type <code>String</code>,
     * <code>String[]</code>, or <code>Collection&lt;String&gt;</code>.
     */
    public static final String SERVICE_INTENTS = "service.intents";

    /* above are from Ch 13 Remote Service spec. */

    /**
     * Endpoint property identifying the id for this endpoint. This service
     * property must always be set.
     * 
     * <p>
     * The value of this property must be of type <code>String</code>.
     */
    String ENDPOINT_ID = "endpoint.id";

    /**
     * Endpoint property identifying the service id of the exported service. Can
     * be absent or 0 if the corresponding endpoint is not for an OSGi service.
     * 
     * <p>
     * The value of this property must be of type <code>Long</code>.
     */
    String ENDPOINT_SERVICE_ID = "endpoint.service.id";

    /**
     * Endpoint property identifying the universally unique id of the exporting
     * framework. Can be absent if the corresponding endpoint is not for an OSGi
     * service.
     * 
     * <p>
     * The value of this property must be of type <code>String</code>.
     */
    String ENDPOINT_FRAMEWORK_UUID = "endpoint.framework.uuid";

    /**
     * Prefix for an endpoint property identifying the interface Java package
     * version for an interface. For example, the property
     * endpoint.package.version.com.acme=1.3 describes the version of the
     * package for the com.acme.Foo interface. This endpoint property for an
     * interface package does not have to be set. If not set, the value must be
     * assumed to be 0.
     * 
     * <p>
     * Since endpoint properties are stored in a case insensitive map, case
     * variants of a package name are folded together.
     * 
     * <p>
     * The value of this property must be of type <code>String</code>.
     */
    String ENDPOINT_PACKAGE_VERSION_ = "endpoint.package.version.";

    Object getValue();

    void setValue(Object value);

    String getName();

    void setName(String name);

    String getType();

    void setType(String type);

    String getStringValue();

    void setStringValue(String value);
}