PlatformStatus

public class PlatformStatus implements Serializable

Represents the status of the platform startup. It contains information about which bundles were started by Gemini Blueprint, it also carries information about both OSGi level and Spring context level errors that occurred in the system.

Fields

REQUIRED_FOR_STARTUP

public static final int REQUIRED_FOR_STARTUP

Methods

addBundleError

void addBundleError(String bundleSymbolicName, String error)

addContextError

void addContextError(String bundleSymbolicName, String error)

addOSGiStartedBundle

void addOSGiStartedBundle(String symbolicName)

addStartedBundle

void addStartedBundle(String bundleSymbolicName)

errorsOccurred

public boolean errorsOccurred()

Returns true if we faced any errors context/bundle. This doesn’t necessarily mean a startup failure.

Returns:true if errors occurred, false otherwise

getBundleErrorsByBundle

public Map<String, String> getBundleErrorsByBundle()

Returns bundles errors that occurred in the system in a form of a map. The keys in the map are bundle symbolic names. The values are error messages. Bundle errors are errors that occurred on the OSGi level, and prevented the bundle itself from starting.

Returns:bundle errors that occurred in the system

getContextErrorsByBundle

public Map<String, String> getContextErrorsByBundle()

Returns context errors that occurred in the system in a form of a map. The keys in the map are bundle symbolic names. The values are error messages. Context errors are errors that occurred during the creation of the Blueprint context.

Returns:context errors that occurred in the system

getOsgiStartedBundles

public List<String> getOsgiStartedBundles()

Returns bundles started in the OSGi meaning of the term. Although context startup is not tied to this, it requires the bundle to be started first.

Returns:bundles started in the OSGi framework

getStartedBundles

public List<String> getStartedBundles()

Returns started bundles. To be considered started a bundle must had its Spring context successfully created by Gemini Blueprint. We do not track non-blueprint enabled bundles here.

Returns:the started bundles.

getStartupProgressPercentage

public int getStartupProgressPercentage()

Returns the startup progress in percent. The startup progress represents the number of started bundles in relation to the number of bundles that is required for the server to be fully started. This is capped at 100%.

Returns:the startup progress in percent

inFatalError

public boolean inFatalError()

Returns true if we faced a fatal error during startup, meaning a platform bundle failed to start. This means a startup failure.

Returns:true if we occurred such an error, false otherwise

removeOSGiStartedBundle

void removeOSGiStartedBundle(String symbolicName)

removeStartedBundle

void removeStartedBundle(String bundleSymbolicName)

setBundleErrorsByBundle

public void setBundleErrorsByBundle(Map<String, String> bundleErrorsByBundle)

Sets the bundles errors that occurred in the system in a form of a map. The keys in the map are bundle symbolic names. The values are error messages. Bundle errors are errors that occurred on the OSGi level, and prevented the bundle itself from starting. Failed bundles will be removed from the started bundle list.

Parameters:
  • bundleErrorsByBundle – bundle errors that occurred in the system

setContextErrorsByBundle

public void setContextErrorsByBundle(Map<String, String> contextErrorsByBundle)

Sets the context errors that occurred in the system in a form of a map. The keys in the map are bundle symbolic names. The values are error messages. Context errors are errors that occurred during the creation of the Blueprint context. Failed bundles will be removed from the started bundle list.

Parameters:
  • contextErrorsByBundle – context errors that occurred in the system

setOsgiStartedBundles

public void setOsgiStartedBundles(List<String> osgiStartedBundles)

Returns bundles started in the OSGi meaning of the term. Although context startup is not tied to this, it requires the bundle to be started first.

Parameters:
  • osgiStartedBundles – started in the OSGi framework

setStartedBundles

public void setStartedBundles(List<String> startedBundles)

Sets the started bundles. To be considered started a bundle must had its Spring context successfully created by Gemini Blueprint. We do not track non-blueprint enabled bundles here.

Parameters:
  • startedBundles – the started bundles.