private void removeExtensions(Bundle bundle) {
            bundleExtensions.entrySet().stream().filter(entry -> entry.getValue() ==
                    bundle.getBundleId()).forEachOrdered(entry -> {
                siddhiExtensionsMap.remove(entry.getKey());
            });
            bundleExtensions.entrySet().removeIf(entry -> entry.getValue() ==
                    bundle.getBundleId());
            BundleWiring bundleWiring = bundle.adapt(BundleWiring.class);
            if (bundleWiring != null) {
                ClassLoader classLoader = bundleWiring.getClassLoader();
                Iterable<Class<?>> extensions = ClassIndex.getAnnotated(Extension.class, classLoader);
                for (Class extension : extensions) {
                    Extension siddhiExtensionAnnotation = (Extension) extension.getAnnotation(Extension.class);
                    if (!siddhiExtensionAnnotation.namespace().isEmpty()) {
                        String key = siddhiExtensionAnnotation.namespace() + SiddhiConstants.EXTENSION_SEPARATOR +
                                siddhiExtensionAnnotation.name();
                        removeFromExtensionHolderMap(key, extension, extensionHolderConcurrentHashMap);
                    }
                }
            }
        }
Class to listen to Bundle changes to update available extensions.
modules/siddhi-core/src/main/java/io/siddhi/core/util/SiddhiExtensionLoader.java