org.osgi.jmx.codec
Class OSGiPackage

java.lang.Object
  extended by org.osgi.jmx.codec.OSGiPackage

public class OSGiPackage
extends java.lang.Object

Author:
Hal Hildebrand Date: Nov 24, 2008 Time: 6:48:30 AM

This class represents the CODEC for the composite data representing an OSGi ExportedPackage

It serves as both the documentation of the type structure and as the codification of the mechanism to convert to/from the CompositeData.

The structure of the composite data is:

Name String
Version String
PendingRemoval boolean
BundleIdentifier long
ImportingBundles Array of long

Field Summary
static javax.management.openmbean.CompositeType PACKAGE
          The CompositeType representation of the package
static javax.management.openmbean.TabularType PACKAGE_TABLE
          The TabularType representation of a list of packages
 
Constructor Summary
OSGiPackage(javax.management.openmbean.CompositeData data)
          Construct an OSGiPackage from the encoded CompositeData
OSGiPackage(org.osgi.service.packageadmin.ExportedPackage pkg)
          Construct an OSGiPackage from the ExporetedPackage
OSGiPackage(java.lang.String name, java.lang.String version, boolean removalPending, long exportingBundle, long[] importingBundles)
          Construct and OSGiPackage from the supplied data
 
Method Summary
 javax.management.openmbean.CompositeData asCompositeData()
          Answer the receiver encoded as CompositeData
 long getExportingBundle()
           
 long[] getImportingBundles()
           
 java.lang.String getName()
           
 java.lang.String getVersion()
           
 boolean isRemovalPending()
           
static javax.management.openmbean.TabularData tableFrom(java.util.ArrayList<OSGiPackage> packages)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PACKAGE

public static final javax.management.openmbean.CompositeType PACKAGE
The CompositeType representation of the package


PACKAGE_TABLE

public static final javax.management.openmbean.TabularType PACKAGE_TABLE
The TabularType representation of a list of packages

Constructor Detail

OSGiPackage

public OSGiPackage(javax.management.openmbean.CompositeData data)
Construct an OSGiPackage from the encoded CompositeData

Parameters:
data - - the CompositeData encoding the OSGiPackage

OSGiPackage

public OSGiPackage(org.osgi.service.packageadmin.ExportedPackage pkg)
Construct an OSGiPackage from the ExporetedPackage

Parameters:
pkg - - the ExporetedPackage

OSGiPackage

public OSGiPackage(java.lang.String name,
                   java.lang.String version,
                   boolean removalPending,
                   long exportingBundle,
                   long[] importingBundles)
Construct and OSGiPackage from the supplied data

Parameters:
name -
version -
removalPending -
exportingBundle -
importingBundles -
Method Detail

tableFrom

public static javax.management.openmbean.TabularData tableFrom(java.util.ArrayList<OSGiPackage> packages)

asCompositeData

public javax.management.openmbean.CompositeData asCompositeData()
Answer the receiver encoded as CompositeData

Returns:
the CompositeData encoding of the receiver.

getExportingBundle

public long getExportingBundle()
Returns:
the identifier of the exporting bundle

getImportingBundles

public long[] getImportingBundles()
Returns:
the list of identifiers of the bundles importing this package

getName

public java.lang.String getName()
Returns:
the name of the package

getVersion

public java.lang.String getVersion()
Returns:
the version of the package

isRemovalPending

public boolean isRemovalPending()
Returns:
true if the package is pending removal


Copyright © 2009. All Rights Reserved.