org.springframework.osgi.util
Class OsgiStringUtils

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

public abstract class OsgiStringUtils
extends Object

Utility class for creating nice string representations of various OSGi classes.

Author:
Costin Leau

Field Summary
static Constants BUNDLE_EVENTS
           
static Constants BUNDLE_STATES
           
static Constants FRAMEWORK_EVENTS
           
static Constants SERVICE_EVENTS
           
 
Constructor Summary
OsgiStringUtils()
           
 
Method Summary
static String bundleStateAsString(Bundle bundle)
          Return the Bundle state as a String.
static String nullSafeBundleEventToString(int eventType)
          Return a null-safe String representation for the given bundle event.
static String nullSafeName(Bundle bundle)
           
static String nullSafeNameAndSymName(Bundle bundle)
          Return the bundle name and symbolic name - useful when logging bundle info.
static String nullSafeSymbolicName(Bundle bundle)
          Return the bundle symbolic name in a null safe manner (null will never be returned).
static String nullSafeToString(BundleEvent event)
          Return a null-safe String representation for the given bundle event.
static String nullSafeToString(FrameworkEvent event)
          Return a null-safe String representation for the given FrameworkEvent.
static String nullSafeToString(ServiceEvent event)
          Return a null-safe String representation for the given ServiceEvent.
static String nullSafeToString(ServiceReference reference)
          Produce a nice string representation of the given ServiceReference.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUNDLE_EVENTS

public static final Constants BUNDLE_EVENTS

FRAMEWORK_EVENTS

public static final Constants FRAMEWORK_EVENTS

SERVICE_EVENTS

public static final Constants SERVICE_EVENTS

BUNDLE_STATES

public static final Constants BUNDLE_STATES
Constructor Detail

OsgiStringUtils

public OsgiStringUtils()
Method Detail

nullSafeBundleEventToString

public static String nullSafeBundleEventToString(int eventType)
Return a null-safe String representation for the given bundle event.

Parameters:
eventType - bundle event given as an int
Returns:
String representation for the bundle event

nullSafeToString

public static String nullSafeToString(BundleEvent event)
Return a null-safe String representation for the given bundle event.

Parameters:
event - OSGi BundleEvent
Returns:
String representation for the given bundle event

nullSafeToString

public static String nullSafeToString(ServiceEvent event)
Return a null-safe String representation for the given ServiceEvent.

Parameters:
event - OSGi ServiceEvent
Returns:
String representation for the given ServiceEvent

nullSafeToString

public static String nullSafeToString(FrameworkEvent event)
Return a null-safe String representation for the given FrameworkEvent.

Parameters:
event - OSGi FrameworkEvent
Returns:
String representation for the given FrameworkEvent

nullSafeToString

public static String nullSafeToString(ServiceReference reference)
Produce a nice string representation of the given ServiceReference.

Parameters:
reference - OSGi service reference
Returns:
String representation for the ServiceReference

bundleStateAsString

public static String bundleStateAsString(Bundle bundle)
Return the Bundle state as a String.

Parameters:
bundle - OSGi bundle
Returns:
bundle state as a string

nullSafeSymbolicName

public static String nullSafeSymbolicName(Bundle bundle)
Return the bundle symbolic name in a null safe manner (null will never be returned).

Parameters:
bundle - OSGi bundle
Returns:
the bundle, symbolic name

nullSafeName

public static String nullSafeName(Bundle bundle)

nullSafeNameAndSymName

public static String nullSafeNameAndSymName(Bundle bundle)
Return the bundle name and symbolic name - useful when logging bundle info.

Parameters:
bundle - OSGi bundle
Returns:
the bundle name and symbolic name


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