org.knopflerfish.util.metatype
public class SystemMetatypeProvider extends MTP implements MetaTypeService
When instantiated, SystemMetatypeProvider will listen for installed bundles and try to extract metatype and CM defaults XML from the bundle jar files. This data will then be available using the getServicePIDs, getFactoryPIDs and getObjectClassDefinition methods.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ATTRIB_CMDEFAULTSURL
Manifest attribute name specifying CM defaults XML URL.
|
static java.lang.String |
ATTRIB_METATYPEURL
Manifest attribute name specifying metatype XML URL.
|
static java.lang.String |
CMDEFAULTS_RESOURCE
Default URL to default CM values.
|
static java.lang.String |
METATYPE_RESOURCE
Default URL to metatype XML.
|
METATYPE_CAPABILITY_NAME, METATYPE_DOCUMENTS_LOCATIONMETATYPE_FACTORY_PID, METATYPE_PID| Constructor and Description |
|---|
SystemMetatypeProvider(BundleContext bc,
java.util.Map<ServiceRegistration<MetaTypeProvider>,MTP> confMtpRegs)
Create a SystemMetatypeProvider, using the specified bundle context for
listeners.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Stop listening for bundles.
|
java.lang.String[] |
getFactoryPids()
Return the Factory PIDs (for ManagedServiceFactories) for which
ObjectClassDefinition information is available.
|
java.lang.String[] |
getLocales()
Return a list of available locales.
|
MetaTypeInformation |
getMetaTypeInformation(Bundle bundle)
Return the MetaType information for the specified bundle.
|
MetaTypeInformation |
getMTP(Bundle b)
Get a loaded metatype provider, given a bundle.
|
ObjectClassDefinition |
getObjectClassDefinition(java.lang.String pid,
java.lang.String locale)
Get an ObjectClassDefinition given a PID.
|
java.lang.String[] |
getPids()
Return the PIDs (for ManagedServices) for which ObjectClassDefinition
information is available.
|
void |
loadMTP(Bundle b)
Explicitly load a metatype provider from a bundle and cache it for later
retrieval by
getMTP(Bundle). |
void |
open()
Start listening for bundles.
|
addFactory, addService, compareTo, equals, getBundle, getId, hashCode, toString, toStringpublic static final java.lang.String METATYPE_RESOURCE
Value is "!/metatype.xml"
public static final java.lang.String CMDEFAULTS_RESOURCE
Value is "!/cmdefaults.xml"
public static final java.lang.String ATTRIB_METATYPEURL
Value is "Bundle-MetatypeURL"
public static final java.lang.String ATTRIB_CMDEFAULTSURL
Value is "Bundle-CMDefaultsURL"
public SystemMetatypeProvider(BundleContext bc, java.util.Map<ServiceRegistration<MetaTypeProvider>,MTP> confMtpRegs)
bc - confMtpRegs - public void open()
public void close()
public void loadMTP(Bundle b) throws java.lang.Exception
getMTP(Bundle).java.lang.Exception - if loading failspublic java.lang.String[] getPids()
MetaTypeInformationgetPids in interface MetaTypeInformationgetPids in class MTPpublic java.lang.String[] getFactoryPids()
MetaTypeInformationgetFactoryPids in interface MetaTypeInformationgetFactoryPids in class MTPpublic java.lang.String[] getLocales()
MetaTypeProviderLocale class.getLocales in interface MetaTypeProvidergetLocales in class MTPnull if there is no locale
specific localization can be found.public MetaTypeInformation getMTP(Bundle b)
public ObjectClassDefinition getObjectClassDefinition(java.lang.String pid, java.lang.String locale)
getObjectClassDefinition in interface MetaTypeProvidergetObjectClassDefinition in class MTPpid - The ID of the requested object class. This can be a pid or
factory pid returned by getPids or getFactoryPids.locale - The locale of the definition or null for default
locale.public MetaTypeInformation getMetaTypeInformation(Bundle bundle)
MetaTypeServicegetMetaTypeInformation in interface MetaTypeServicebundle - The bundle for which meta type information is requested.