Class McpToolsetOsgiBridge

java.lang.Object
com.xebialabs.xlrelease.mcp.config.McpToolsetOsgiBridge
All Implemented Interfaces:
com.xebialabs.xlrelease.booter.osgi.OsgiServiceWhiteboard

@Component public class McpToolsetOsgiBridge extends Object implements com.xebialabs.xlrelease.booter.osgi.OsgiServiceWhiteboard
The bundle-to-host half of OSGi whiteboard: OsgiHostServiceBridge (core/xlr-server) already bridges host APIs INTO bundles; this bridges McpToolset services a bundle registers back OUT into the running McpSyncServer, live, no restart.

A ServiceTracker is the whiteboard pattern's consumer side: a bundle just registers a McpToolset service (typically via a Declarative Services @Component, see xlr-hello-osgi-plugin) with no knowledge of this class, and attach(org.osgi.framework.BundleContext) below discovers it - both services already present when the tracker opens and ones registered/unregistered later.

Adding/removing a tool on McpSyncServer pushes tools/list_changed to clients on its own (the server is built with the listChanged capability), so this class does not notify explicitly. After each change it re-runs McpReadOnlyToolReconciler.reconcile() so a bundle installed while read-only mode is on does not leak a mutating tool onto tools/list.

  • Constructor Details

  • Method Details

    • attach

      public void attach(org.osgi.framework.BundleContext context)
      Specified by:
      attach in interface com.xebialabs.xlrelease.booter.osgi.OsgiServiceWhiteboard
    • detach

      public void detach()
      Specified by:
      detach in interface com.xebialabs.xlrelease.booter.osgi.OsgiServiceWhiteboard