org.jboss.osgi.metadata.internal
Class AbstractOSGiMetaData

java.lang.Object
  extended by org.jboss.osgi.metadata.internal.AbstractOSGiMetaData
All Implemented Interfaces:
OSGiMetaData

public abstract class AbstractOSGiMetaData
extends Object
implements OSGiMetaData

Abstract OSGi meta data.

Author:
Ales Justin, Thomas.Diesler@jboss.com, David Bosschaert

Field Summary
protected  Map<String,Object> cachedAttributes
           
protected  int initialStartLevel
           
protected  ParameterizedAttribute parameters
           
 
Fields inherited from interface org.jboss.osgi.metadata.OSGiMetaData
ANONYMOUS_BUNDLE_SYMBOLIC_NAME
 
Constructor Summary
AbstractOSGiMetaData()
           
 
Method Summary
protected
<T> T
get(String key, ValueCreator<T> creator)
           
protected
<T> T
get(String key, ValueCreator<T> creator, T defaultValue)
           
 ActivationPolicyMetaData getBundleActivationPolicy()
          Get bundle activation policy.
 String getBundleActivator()
          Get bundle activator class name.
 List<String> getBundleCategory()
          Get the bundle category
 List<String> getBundleClassPath()
          Get the bundle classpath
 String getBundleDescription()
          Get the description
 String getBundleLocalization()
          Get the localization's location
 int getBundleManifestVersion()
          Get the bundle manifest version
 String getBundleName()
          Get the name
 List<ParameterizedAttribute> getBundleNativeCode()
          Get native code libs
 ParameterizedAttribute getBundleParameters()
          Get the bundle parameters
 String getBundleSymbolicName()
          Get bundle symbolic name.
 URL getBundleUpdateLocation()
          Get the update url.
 org.osgi.framework.Version getBundleVersion()
          Get bundle's version.
 List<PackageAttribute> getDynamicImports()
          Get dynamic imports.
 List<PackageAttribute> getExportPackages()
          Get the export packages.
 String getFragmentAttachment()
          Get the fragment attrachment todo fragments
 ParameterizedAttribute getFragmentHost()
          Get the fragment host.
 String getHeader(String key)
          Extension point to read custom manifest headers.
 Dictionary<String,String> getHeaders()
          Get the headers in raw unlocalized format.
 List<PackageAttribute> getImportPackages()
          Get the import packages.
 int getInitialStartLevel()
          Returns the initial start level of the bundle.
protected abstract  String getMainAttribute(String key)
           
protected abstract  Map<Attributes.Name,String> getMainAttributes()
           
 List<ParameterizedAttribute> getRequireBundles()
          Get the required exports
 List<String> getRequiredExecutionEnvironment()
          Get required exectuion envs
 boolean isSingleton()
          Whether the bundle is a singleton
protected  ParameterizedAttribute parseSymbolicName()
           
 void setInitialStartLevel(int sl)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

cachedAttributes

protected transient Map<String,Object> cachedAttributes

parameters

protected transient ParameterizedAttribute parameters

initialStartLevel

protected transient int initialStartLevel
Constructor Detail

AbstractOSGiMetaData

public AbstractOSGiMetaData()
Method Detail

getMainAttributes

protected abstract Map<Attributes.Name,String> getMainAttributes()

getMainAttribute

protected abstract String getMainAttribute(String key)

getHeaders

public Dictionary<String,String> getHeaders()
Description copied from interface: OSGiMetaData
Get the headers in raw unlocalized format.

Specified by:
getHeaders in interface OSGiMetaData
Returns:
the headers

getHeader

public String getHeader(String key)
Description copied from interface: OSGiMetaData
Extension point to read custom manifest headers.

Specified by:
getHeader in interface OSGiMetaData
Parameters:
key - the header key
Returns:
value or null of no such header

getBundleActivationPolicy

public ActivationPolicyMetaData getBundleActivationPolicy()
Description copied from interface: OSGiMetaData
Get bundle activation policy.

Specified by:
getBundleActivationPolicy in interface OSGiMetaData
Returns:
bundle activation policy

getBundleActivator

public String getBundleActivator()
Description copied from interface: OSGiMetaData
Get bundle activator class name.

Specified by:
getBundleActivator in interface OSGiMetaData
Returns:
bundle activator classname or null if no such attribute

getBundleCategory

public List<String> getBundleCategory()
Description copied from interface: OSGiMetaData
Get the bundle category

Specified by:
getBundleCategory in interface OSGiMetaData
Returns:
list of category names

getBundleClassPath

public List<String> getBundleClassPath()
Description copied from interface: OSGiMetaData
Get the bundle classpath

Specified by:
getBundleClassPath in interface OSGiMetaData
Returns:
list of JAR file path names or directories inside bundle

getBundleDescription

public String getBundleDescription()
Description copied from interface: OSGiMetaData
Get the description

Specified by:
getBundleDescription in interface OSGiMetaData
Returns:
a description

getBundleLocalization

public String getBundleLocalization()
Description copied from interface: OSGiMetaData
Get the localization's location

Specified by:
getBundleLocalization in interface OSGiMetaData
Returns:
location in the bundle for localization files

getBundleManifestVersion

public int getBundleManifestVersion()
Description copied from interface: OSGiMetaData
Get the bundle manifest version

Specified by:
getBundleManifestVersion in interface OSGiMetaData
Returns:
bundle's specification number

getBundleName

public String getBundleName()
Description copied from interface: OSGiMetaData
Get the name

Specified by:
getBundleName in interface OSGiMetaData
Returns:
readable name

getBundleNativeCode

public List<ParameterizedAttribute> getBundleNativeCode()
Description copied from interface: OSGiMetaData
Get native code libs

Specified by:
getBundleNativeCode in interface OSGiMetaData
Returns:
native libs contained in the bundle

getRequiredExecutionEnvironment

public List<String> getRequiredExecutionEnvironment()
Description copied from interface: OSGiMetaData
Get required exectuion envs

Specified by:
getRequiredExecutionEnvironment in interface OSGiMetaData
Returns:
list of execution envs that must be present on the Service Platform

getBundleSymbolicName

public String getBundleSymbolicName()
Description copied from interface: OSGiMetaData
Get bundle symbolic name.

Specified by:
getBundleSymbolicName in interface OSGiMetaData
Returns:
bundle's symbolic name

getBundleVersion

public org.osgi.framework.Version getBundleVersion()
Description copied from interface: OSGiMetaData
Get bundle's version. Note, R3 does not define a specific syntax for Bundle-Version.

Specified by:
getBundleVersion in interface OSGiMetaData
Returns:
version of this bundle

getBundleParameters

public ParameterizedAttribute getBundleParameters()
Description copied from interface: OSGiMetaData
Get the bundle parameters

Specified by:
getBundleParameters in interface OSGiMetaData
Returns:
the bundle parameters

getBundleUpdateLocation

public URL getBundleUpdateLocation()
Description copied from interface: OSGiMetaData
Get the update url.

Specified by:
getBundleUpdateLocation in interface OSGiMetaData
Returns:
URL of an update bundle location

getDynamicImports

public List<PackageAttribute> getDynamicImports()
Description copied from interface: OSGiMetaData
Get dynamic imports.

Specified by:
getDynamicImports in interface OSGiMetaData
Returns:
package names that should be dynamically imported when needed

getExportPackages

public List<PackageAttribute> getExportPackages()
Description copied from interface: OSGiMetaData
Get the export packages.

Specified by:
getExportPackages in interface OSGiMetaData
Returns:
exported packages

getFragmentHost

public ParameterizedAttribute getFragmentHost()
Description copied from interface: OSGiMetaData
Get the fragment host.

Specified by:
getFragmentHost in interface OSGiMetaData
Returns:
host bundle for this fragment

getImportPackages

public List<PackageAttribute> getImportPackages()
Description copied from interface: OSGiMetaData
Get the import packages.

Specified by:
getImportPackages in interface OSGiMetaData
Returns:
imported packages.

getRequireBundles

public List<ParameterizedAttribute> getRequireBundles()
Description copied from interface: OSGiMetaData
Get the required exports

Specified by:
getRequireBundles in interface OSGiMetaData
Returns:
required exports from anoter bundle

isSingleton

public boolean isSingleton()
Description copied from interface: OSGiMetaData
Whether the bundle is a singleton

Specified by:
isSingleton in interface OSGiMetaData
Returns:
true when it is a singleton

getFragmentAttachment

public String getFragmentAttachment()
Description copied from interface: OSGiMetaData
Get the fragment attrachment todo fragments

Specified by:
getFragmentAttachment in interface OSGiMetaData
Returns:
the fragment attachment

parseSymbolicName

protected ParameterizedAttribute parseSymbolicName()

get

protected <T> T get(String key,
                    ValueCreator<T> creator)

get

protected <T> T get(String key,
                    ValueCreator<T> creator,
                    T defaultValue)

getInitialStartLevel

public int getInitialStartLevel()
Description copied from interface: OSGiMetaData
Returns the initial start level of the bundle.

Specified by:
getInitialStartLevel in interface OSGiMetaData
Returns:
The initial start level of the bundle or -1 when the initial bundle start level has not been defined for this bundle.

setInitialStartLevel

public void setInitialStartLevel(int sl)

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012. All Rights Reserved.