org.springframework.osgi.util
Class OsgiPlatformDetector

java.lang.Object
  extended by org.springframework.osgi.util.OsgiPlatformDetector

public abstract class OsgiPlatformDetector
extends Object

Utility class that detects the running platform. Useful when certain quirks or tweaks have to made for a specific implementations. Currently we can detect Equinox, Knopflerfish and Felix platforms.

Author:
Adrian Colyer, Costin Leau

Constructor Summary
OsgiPlatformDetector()
           
 
Method Summary
static String getVersion(BundleContext bundleContext)
          Returns the OSGi platform version (using the manifest entries from the system bundle).
static boolean isEquinox(BundleContext bundleContext)
          Returns true if the given bundle context belongs to the Equinox platform.
static boolean isFelix(BundleContext bundleContext)
          Returns true if the given bundle context belongs to the Felix platform.
static boolean isKnopflerfish(BundleContext bundleContext)
          Returns true if the given bundle context belongs to the Knopflerfish platform.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OsgiPlatformDetector

public OsgiPlatformDetector()
Method Detail

isEquinox

public static boolean isEquinox(BundleContext bundleContext)
Returns true if the given bundle context belongs to the Equinox platform.

Parameters:
bundleContext - OSGi bundle context
Returns:
true if the context indicates Equinox platform, false otherwise

isKnopflerfish

public static boolean isKnopflerfish(BundleContext bundleContext)
Returns true if the given bundle context belongs to the Knopflerfish platform.

Parameters:
bundleContext - OSGi bundle context
Returns:
true if the context indicates Knopflerfish platform, false otherwise

isFelix

public static boolean isFelix(BundleContext bundleContext)
Returns true if the given bundle context belongs to the Felix platform.

Parameters:
bundleContext - OSGi bundle context
Returns:
true if the context indicates Felix platform, false otherwise

getVersion

public static String getVersion(BundleContext bundleContext)
Returns the OSGi platform version (using the manifest entries from the system bundle). The version can be empty.

Parameters:
bundleContext - bundle context to inspect
Returns:
not-null system bundle version


Copyright © 2006-2008 Spring Framework. All Rights Reserved.