001 /*
002 * Copyright (c) OSGi Alliance (2005, 2008). All Rights Reserved.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016 package org.osgi.service.metatype;
017
018 import org.osgi.framework.Bundle;
019
020 /**
021 * The MetaType Service can be used to obtain meta type information for a
022 * bundle. The MetaType Service will examine the specified bundle for meta type
023 * documents to create the returned <code>MetaTypeInformation</code> object.
024 *
025 * <p>
026 * If the specified bundle does not contain any meta type documents, then a
027 * <code>MetaTypeInformation</code> object will be returned that wrappers any
028 * <code>ManagedService</code> or <code>ManagedServiceFactory</code>
029 * services registered by the specified bundle that implement
030 * <code>MetaTypeProvider</code>. Thus the MetaType Service can be used to
031 * retrieve meta type information for bundles which contain a meta type
032 * documents or which provide their own <code>MetaTypeProvider</code> objects.
033 *
034 * @version $Revision: 5673 $
035 * @since 1.1
036 */
037 public interface MetaTypeService {
038 /**
039 * Return the MetaType information for the specified bundle.
040 *
041 * @param bundle The bundle for which meta type information is requested.
042 * @return A MetaTypeInformation object for the specified bundle.
043 */
044 public MetaTypeInformation getMetaTypeInformation(Bundle bundle);
045
046 /**
047 * Location of meta type documents. The MetaType Service will process each
048 * entry in the meta type documents directory.
049 */
050 public final static String METATYPE_DOCUMENTS_LOCATION = "OSGI-INF/metatype";
051 }