Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: c5c96a364698f8908d8c3e7a44e21b3240cac047 (plain) (blame)
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
/*
 * Copyright (c) OSGi Alliance (2005, 2017). All Rights Reserved.
 * 
 * Licensed 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.osgi.service.metatype;

import org.osgi.annotation.versioning.ProviderType;
import org.osgi.framework.Bundle;

/**
 * The MetaType Service can be used to obtain meta type information for a
 * bundle. The MetaType Service will examine the specified bundle for meta type
 * documents to create the returned {@code MetaTypeInformation} object.
 * 
 * <p>
 * If the specified bundle does not contain any meta type documents, then a
 * {@code MetaTypeInformation} object will be returned that wrappers any
 * {@code ManagedService} or {@code ManagedServiceFactory} services registered
 * by the specified bundle that implement {@code MetaTypeProvider}. Thus the
 * MetaType Service can be used to retrieve meta type information for bundles
 * which contain a meta type documents or which provide their own
 * {@code MetaTypeProvider} objects.
 * 
 * @ThreadSafe
 * @author $Id$
 * @since 1.1
 */
@ProviderType
public interface MetaTypeService {
	/**
	 * Return the MetaType information for the specified bundle.
	 * 
	 * @param bundle The bundle for which meta type information is requested.
	 * @return A MetaTypeInformation object for the specified bundle.
	 */
	public MetaTypeInformation getMetaTypeInformation(Bundle bundle);

	/**
	 * Location of meta type documents. The MetaType Service will process each
	 * entry in the meta type documents directory.
	 */
	public final static String	METATYPE_DOCUMENTS_LOCATION	= "OSGI-INF/metatype";

	/**
	 * Capability name for meta type document processors.
	 * <p>
	 * Used in {@code Provide-Capability} and {@code Require-Capability}
	 * manifest headers with the {@code osgi.extender} namespace. For example:
	 * 
	 * <pre>
	 * Require-Capability: osgi.extender;
	 *  filter:="(&amp;(osgi.extender=osgi.metatype)(version&gt;=1.4)(!(version&gt;=2.0)))"
	 * </pre>
	 * 
	 * @since 1.3
	 */
	public static final String	METATYPE_CAPABILITY_NAME	= "osgi.metatype";

	/**
	 * Compile time constant for the Specification Version of MetaType Service.
	 * <p>
	 * Used in {@code Version} and {@code Requirement} annotations. The value of
	 * this compile time constant will change when the specification version of
	 * MetaType Service is updated.
	 * 
	 * @since 1.4
	 */
	public static final String	METATYPE_SPECIFICATION_VERSION	= "1.4.0";
}

Back to the top