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  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.
 Map<String,Object> getCachedAttributes()
           
 List<PackageAttribute> getDynamicImports()
          Get dynamic imports.
 List<PackageAttribute> getExportPackages()
          Get the export packages.
 String getFragmentAttachment()
           
 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.
protected abstract  String getMainAttribute(String key)
           
protected abstract  Map<Attributes.Name,String> getMainAttributes()
           
 List<ParameterizedAttribute> getProvidedCapabilities()
          Get the provided capabilities
 List<ParameterizedAttribute> getRequireBundles()
          Get the required exports
 List<ParameterizedAttribute> getRequiredCapabilities()
          Get the required capabilities
 List<String> getRequiredExecutionEnvironment()
          Get required exectuion envs
 boolean isFragment()
          Whether the bundle is a fragment
 boolean isSingleton()
          Whether the bundle is a singleton
protected  ParameterizedAttribute parseSymbolicName()
           
 String toString()
           
 OSGiMetaData validate()
          Validate the this metadata
 
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
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 manifest version

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 bundles

getProvidedCapabilities

public List<ParameterizedAttribute> getProvidedCapabilities()
Description copied from interface: OSGiMetaData
Get the provided capabilities

Specified by:
getProvidedCapabilities in interface OSGiMetaData
Returns:
provided capabilities

getRequiredCapabilities

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

Specified by:
getRequiredCapabilities in interface OSGiMetaData
Returns:
required capabilities

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

isFragment

public boolean isFragment()
Description copied from interface: OSGiMetaData
Whether the bundle is a fragment

Specified by:
isFragment in interface OSGiMetaData
Returns:
true when it is a fragment

getFragmentAttachment

public String getFragmentAttachment()

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)

getCachedAttributes

public Map<String,Object> getCachedAttributes()

validate

public OSGiMetaData validate()
                      throws org.osgi.framework.BundleException
Description copied from interface: OSGiMetaData
Validate the this metadata

Specified by:
validate in interface OSGiMetaData
Throws:
org.osgi.framework.BundleException

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012 JBoss by Red Hat. All Rights Reserved.