crdPlurals;
diff --git a/annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/KubernetesBootstrapper.java b/annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/KubernetesBootstrapper.java
index c8e76865fe..f75d6a7ad4 100644
--- a/annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/KubernetesBootstrapper.java
+++ b/annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/KubernetesBootstrapper.java
@@ -32,6 +32,6 @@ public KubernetesBootstrapper(final ProcessingEnvironment processingEnv) {
public void boot(final Model model) throws IOException {
new K8sYamlGenerator(processingEnv).write(model);
new K8sJsonSchemaGenerator(processingEnv).write(model);
- new K8sHelperGenerator(processingEnv).write(model);
+ new Grammar(processingEnv).write(model);
}
}
diff --git a/annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/AbstractSchema.java b/annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/AbstractSchema.java
index 88a0cae5fa..2eb71330bc 100644
--- a/annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/AbstractSchema.java
+++ b/annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/AbstractSchema.java
@@ -14,7 +14,7 @@
package com.predic8.membrane.annot.generator.kubernetes.model;
-import com.fasterxml.jackson.databind.node.*;
+import tools.jackson.databind.node.*;
import java.util.*;
diff --git a/annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/AnyOf.java b/annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/AnyOf.java
index 960f37ac08..075b642cdf 100644
--- a/annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/AnyOf.java
+++ b/annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/AnyOf.java
@@ -14,8 +14,8 @@
package com.predic8.membrane.annot.generator.kubernetes.model;
-import com.fasterxml.jackson.databind.*;
-import com.fasterxml.jackson.databind.node.*;
+import tools.jackson.databind.*;
+import tools.jackson.databind.node.*;
import java.util.*;
diff --git a/annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/ISchema.java b/annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/ISchema.java
index e24d2490ec..693e65d822 100644
--- a/annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/ISchema.java
+++ b/annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/ISchema.java
@@ -13,7 +13,7 @@
limitations under the License. */
package com.predic8.membrane.annot.generator.kubernetes.model;
-import com.fasterxml.jackson.databind.node.*;
+import tools.jackson.databind.node.*;
public interface ISchema {
diff --git a/annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/Schema.java b/annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/Schema.java
index 3253c48659..c0b5650b48 100644
--- a/annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/Schema.java
+++ b/annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/Schema.java
@@ -13,9 +13,9 @@
limitations under the License. */
package com.predic8.membrane.annot.generator.kubernetes.model;
-import com.fasterxml.jackson.databind.*;
-import com.fasterxml.jackson.databind.node.*;
-import com.fasterxml.jackson.databind.util.*;
+import tools.jackson.databind.*;
+import tools.jackson.databind.node.*;
+import tools.jackson.databind.util.*;
import java.util.*;
diff --git a/annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/SchemaArray.java b/annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/SchemaArray.java
index ec436f8c78..e5d3261a22 100644
--- a/annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/SchemaArray.java
+++ b/annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/SchemaArray.java
@@ -14,7 +14,7 @@
package com.predic8.membrane.annot.generator.kubernetes.model;
-import com.fasterxml.jackson.databind.node.*;
+import tools.jackson.databind.node.*;
import static com.predic8.membrane.annot.generator.kubernetes.model.SchemaFactory.ARRAY;
diff --git a/annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/SchemaObject.java b/annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/SchemaObject.java
index cd13b028a5..5af31f73bd 100644
--- a/annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/SchemaObject.java
+++ b/annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/SchemaObject.java
@@ -13,7 +13,7 @@
limitations under the License. */
package com.predic8.membrane.annot.generator.kubernetes.model;
-import com.fasterxml.jackson.databind.node.*;
+import tools.jackson.databind.node.*;
import java.util.*;
diff --git a/annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/SchemaRef.java b/annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/SchemaRef.java
index 478297db2e..3650bd35f3 100644
--- a/annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/SchemaRef.java
+++ b/annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/SchemaRef.java
@@ -14,8 +14,8 @@
package com.predic8.membrane.annot.generator.kubernetes.model;
-import com.fasterxml.jackson.databind.*;
-import com.fasterxml.jackson.databind.node.*;
+import tools.jackson.databind.*;
+import tools.jackson.databind.node.*;
public class SchemaRef extends SchemaObject {
diff --git a/annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/SchemaString.java b/annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/SchemaString.java
index 726c1526dd..5aee594e8c 100644
--- a/annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/SchemaString.java
+++ b/annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/SchemaString.java
@@ -14,7 +14,7 @@
package com.predic8.membrane.annot.generator.kubernetes.model;
-import com.fasterxml.jackson.databind.node.*;
+import tools.jackson.databind.node.*;
import java.util.*;
diff --git a/annot/src/main/java/com/predic8/membrane/annot/yaml/BeanCacheObserver.java b/annot/src/main/java/com/predic8/membrane/annot/yaml/BeanCacheObserver.java
new file mode 100644
index 0000000000..39175601bd
--- /dev/null
+++ b/annot/src/main/java/com/predic8/membrane/annot/yaml/BeanCacheObserver.java
@@ -0,0 +1,56 @@
+/* Copyright 2025 predic8 GmbH, www.predic8.com
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. */
+
+package com.predic8.membrane.annot.yaml;
+
+import java.io.IOException;
+
+/**
+ * Observer for {@link BeanRegistryImplementation} events.
+ *
+ * Implementations are notified when the cache has finished its asynchronous
+ * initial load and whenever a bean is added, modified, or deleted.
+ */
+public interface BeanCacheObserver {
+ /**
+ * Called when the cache finished its asynchronous initial load.
+ *
+ * @param empty {@code true} if no activatable beans are present afterwards,
+ * {@code false} otherwise
+ */
+ void handleAsynchronousInitializationResult(boolean empty);
+
+ /**
+ * Called for an add/modify/delete event of a bean.
+ *
+ * @param bd the bean definition
+ * @param bean the current instance (on ADD/MODIFY) or {@code null} (on DELETE)
+ * @param oldBean the previous instance (on MODIFY) or {@code null}
+ * @throws IOException if handling the event performs I/O and it fails
+ *
+ *
+ * TODO: Make event visible: enum and add to signature?
+ *
+ */
+ void handleBeanEvent(BeanDefinition bd, Object bean, Object oldBean) throws IOException;
+
+ /**
+ * Whether beans of the given definition should be considered activatable/usable
+ * by the runtime.
+ *
+ * @param bd the bean definition
+ * @return {@code true} if activatable, {@code false} otherwise
+ */
+ boolean isActivatable(BeanDefinition bd);
+}
diff --git a/annot/src/main/java/com/predic8/membrane/annot/yaml/BeanDefinition.java b/annot/src/main/java/com/predic8/membrane/annot/yaml/BeanDefinition.java
new file mode 100644
index 0000000000..40c6d5cd56
--- /dev/null
+++ b/annot/src/main/java/com/predic8/membrane/annot/yaml/BeanDefinition.java
@@ -0,0 +1,109 @@
+/* Copyright 2022 predic8 GmbH, www.predic8.com
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. */
+package com.predic8.membrane.annot.yaml;
+
+import tools.jackson.databind.JsonNode;
+
+import java.util.*;
+
+public class BeanDefinition {
+
+ public static final String PROTOTYPE = "prototype";
+
+ private final String name;
+ private final String namespace;
+ private final String uid;
+ private final JsonNode node;
+ private final WatchAction action;
+ private final String kind;
+ private Object bean;
+
+ /**
+ * Only called from K8S.
+ */
+ private BeanDefinition(WatchAction action, JsonNode node) {
+ this.action = action;
+ this.node = node;
+ JsonNode metadata = node.get("metadata");
+ var kind2 = node.get("kind").asText();
+ if (kind2 == null)
+ kind2 = "api";
+ kind = kind2;
+ name = metadata.get("name").asText();
+ if (name == null)
+ throw new IllegalArgumentException("name is null");
+ namespace = metadata.get("namespace").asText();
+ uid = metadata.get("uid").asText();
+ }
+
+ public static BeanDefinition create4Kubernetes(WatchAction action, JsonNode node) {
+ return new BeanDefinition(action, node);
+ }
+
+ public BeanDefinition(String kind, String name, String namespace, String uid, JsonNode node) {
+ this.kind = kind;
+ this.name = name;
+ this.namespace = namespace;
+ this.uid = uid;
+ this.node = node;
+ this.action = WatchAction.ADDED;
+ }
+
+ public JsonNode getNode() {
+ return node;
+ }
+
+ public WatchAction getAction() {
+ return action;
+ }
+
+ public String getNamespace() {
+ return namespace;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getUid() {
+ return uid;
+ }
+
+ public String getKind() {
+ return kind;
+ }
+
+ public Object getBean() {
+ return bean;
+ }
+
+ // TODO: Rest is immutable - can we make this also?
+ public void setBean(Object bean) {
+ this.bean = bean;
+ }
+
+ public String getScope() {
+ JsonNode meta = node.get("metadata");
+ if (meta == null)
+ return null;
+ JsonNode annotations = meta.get("annotations");
+ if (annotations == null)
+ return null;
+ return annotations.get("membrane-soa.org/scope").asText(); // TODO migrate to membrane-api.io
+ }
+
+ public boolean isPrototype() {
+ return PROTOTYPE.equals(getScope());
+ }
+}
diff --git a/annot/src/main/java/com/predic8/membrane/annot/yaml/BeanRegistry.java b/annot/src/main/java/com/predic8/membrane/annot/yaml/BeanRegistry.java
index 843d8a38e6..01f56ed6b6 100644
--- a/annot/src/main/java/com/predic8/membrane/annot/yaml/BeanRegistry.java
+++ b/annot/src/main/java/com/predic8/membrane/annot/yaml/BeanRegistry.java
@@ -13,6 +13,18 @@
limitations under the License. */
package com.predic8.membrane.annot.yaml;
+import com.predic8.membrane.annot.*;
+
+import java.util.List;
+
public interface BeanRegistry {
+
Object resolveReference(String url);
+
+ List