OPS4J Pax Swissbox :: OSGi Core 1.3.1

org.ops4j.pax.swissbox.core
Class BundleUtils

java.lang.Object
  extended by org.ops4j.pax.swissbox.core.BundleUtils

public class BundleUtils
extends Object

Utilities related to bundles.

Since:
0.1.0, January 11, 2008
Author:
Alin Dreghiciu

Constructor Summary
BundleUtils()
           
 
Method Summary
static org.osgi.framework.BundleContext getBundleContext(org.osgi.framework.Bundle bundle)
          Discovers the bundle context for a bundle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BundleUtils

public BundleUtils()
Method Detail

getBundleContext

public static org.osgi.framework.BundleContext getBundleContext(org.osgi.framework.Bundle bundle)
Discovers the bundle context for a bundle. If the bundle is an 4.1.0 or greather bundle it should have a method that just returns the bundle context. Otherwise uses reflection to look for an internal bundle context.

Parameters:
bundle - the bundle from which the bundle context is needed
Returns:
corresponding bundle context or null if bundle context cannot be discovered

OPS4J Pax Swissbox :: OSGi Core 1.3.1

Copyright © 2006-2011 OPS4J - Open Participation Software for Java. All Rights Reserved.