Knopflerfish OSGi 5.2.0

org.knopflerfish.util.metatype
Class MTP

java.lang.Object
  extended by org.knopflerfish.util.metatype.MTP
All Implemented Interfaces:
java.lang.Comparable<MTP>, MetaTypeInformation, MetaTypeProvider
Direct Known Subclasses:
SystemMetatypeProvider

public class MTP
extends java.lang.Object
implements MetaTypeInformation, java.lang.Comparable<MTP>

Implementation of the MetaTypeInformation interface.


Field Summary
 
Fields inherited from interface org.osgi.service.metatype.MetaTypeProvider
METATYPE_FACTORY_PID, METATYPE_PID
 
Constructor Summary
MTP(java.lang.String id)
           
 
Method Summary
 void addFactory(java.lang.String pid, ObjectClassDefinition ocd)
           
 void addService(java.lang.String pid, ObjectClassDefinition ocd)
           
 int compareTo(MTP o)
           
 boolean equals(java.lang.Object other)
           
 Bundle getBundle()
          Return the bundle for which this object provides meta type information.
 java.lang.String[] getFactoryPids()
          Return the Factory PIDs (for ManagedServiceFactories) for which ObjectClassDefinition information is available.
 java.lang.String getId()
           
 java.lang.String[] getLocales()
          Return a list of available locales.
 ObjectClassDefinition getObjectClassDefinition(java.lang.String pid, java.lang.String locale)
          Returns an object class definition for the specified id localized to the specified locale.
 java.lang.String[] getPids()
          Return the PIDs (for ManagedServices) for which ObjectClassDefinition information is available.
 int hashCode()
           
 java.lang.String toString()
           
 java.lang.String toString(boolean bFull)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MTP

public MTP(java.lang.String id)
Method Detail

addService

public void addService(java.lang.String pid,
                       ObjectClassDefinition ocd)

addFactory

public void addFactory(java.lang.String pid,
                       ObjectClassDefinition ocd)

getBundle

public Bundle getBundle()
Description copied from interface: MetaTypeInformation
Return the bundle for which this object provides meta type information.

Specified by:
getBundle in interface MetaTypeInformation
Returns:
Bundle for which this object provides meta type information.

getPids

public java.lang.String[] getPids()
Description copied from interface: MetaTypeInformation
Return the PIDs (for ManagedServices) for which ObjectClassDefinition information is available.

Specified by:
getPids in interface MetaTypeInformation
Returns:
Array of PIDs.

getFactoryPids

public java.lang.String[] getFactoryPids()
Description copied from interface: MetaTypeInformation
Return the Factory PIDs (for ManagedServiceFactories) for which ObjectClassDefinition information is available.

Specified by:
getFactoryPids in interface MetaTypeInformation
Returns:
Array of Factory PIDs.

getLocales

public java.lang.String[] getLocales()
Description copied from interface: MetaTypeProvider
Return a list of available locales. The results must be names that consists of language [ _ country [ _ variation ]] as is customary in the Locale class.

Specified by:
getLocales in interface MetaTypeProvider
Returns:
An array of locale strings or null if there is no locale specific localization can be found.

getObjectClassDefinition

public ObjectClassDefinition getObjectClassDefinition(java.lang.String pid,
                                                      java.lang.String locale)
Description copied from interface: MetaTypeProvider
Returns an object class definition for the specified id localized to the specified locale.

The locale parameter must be a name that consists of language[ "_" country[ "_" variation] ] as is customary in the Locale class. This Locale class is not used because certain profiles do not contain it.

Specified by:
getObjectClassDefinition in interface MetaTypeProvider
Parameters:
pid - 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.
Returns:
A ObjectClassDefinition object.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toString

public java.lang.String toString(boolean bFull)

getId

public java.lang.String getId()

compareTo

public int compareTo(MTP o)
Specified by:
compareTo in interface java.lang.Comparable<MTP>

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object

Knopflerfish OSGi 5.2.0