diff --git a/demo/GreetingController.java b/sample-java-entity-decorators/demo/GreetingController.java similarity index 100% rename from demo/GreetingController.java rename to sample-java-entity-decorators/demo/GreetingController.java diff --git a/demo/GreetingService.java b/sample-java-entity-decorators/demo/GreetingService.java similarity index 100% rename from demo/GreetingService.java rename to sample-java-entity-decorators/demo/GreetingService.java diff --git a/sample-java-entity-decorators/demo/extension/ExtensionConsumer.java b/sample-java-entity-decorators/demo/extension/ExtensionConsumer.java deleted file mode 100644 index 98eaf90..0000000 --- a/sample-java-entity-decorators/demo/extension/ExtensionConsumer.java +++ /dev/null @@ -1,30 +0,0 @@ -package demo.extension; - -import java.util.List; - -import org.eclipse.dirigible.sdk.extensions.Extensions; -import org.eclipse.dirigible.sdk.http.Controller; -import org.eclipse.dirigible.sdk.http.Get; - -/** - * REST endpoint that exercises the typed extension API end-to-end. Every implementor of - * {@link SampleExtensionPoint} registered by {@code ExtensionClassConsumer} on publish is - * returned by {@code Extensions.find(...)} as the interface type, so {@link #listContributions()} - * calls {@link SampleExtensionPoint#describe()} directly — no reflection, no Map payloads. - * - *

- * {@code GET /services/java/sample-java-entity-decorators/demo/extension/ExtensionConsumer/contributions} - * returns a JSON array of the descriptions produced by each contribution. - */ -@Controller -public class ExtensionConsumer { - - @Get("/contributions") - public List listContributions() throws Exception { - return Extensions.find(SampleExtensionPoint.class) - .stream() - .map(SampleExtensionPoint::describe) - .toList(); - } - -} diff --git a/sample-java-entity-decorators/demo/extension/SampleContribution.java b/sample-java-entity-decorators/demo/extension/SampleContribution.java deleted file mode 100644 index f7d729d..0000000 --- a/sample-java-entity-decorators/demo/extension/SampleContribution.java +++ /dev/null @@ -1,19 +0,0 @@ -package demo.extension; - -import org.eclipse.dirigible.sdk.extensions.Extension; - -/** - * Demonstrates {@code @Extension}: registers this class as a typed contribution to - * {@link SampleExtensionPoint}. The runtime validates the implementation at registration time — - * consumers that call {@code Extensions.find(SampleExtensionPoint.class)} receive a - * {@code List} that they can invoke directly. - */ -@Extension(target = SampleExtensionPoint.class, name = "sample-contribution") -public class SampleContribution implements SampleExtensionPoint { - - @Override - public String describe() { - return "Hello from SampleContribution!"; - } - -} diff --git a/sample-java-entity-decorators/demo/extension/SampleExtensionPoint.java b/sample-java-entity-decorators/demo/extension/SampleExtensionPoint.java deleted file mode 100644 index 8b6ffc4..0000000 --- a/sample-java-entity-decorators/demo/extension/SampleExtensionPoint.java +++ /dev/null @@ -1,16 +0,0 @@ -package demo.extension; - -import org.eclipse.dirigible.sdk.extensions.ExtensionPoint; - -/** - * Demonstrates {@code @ExtensionPoint}: declares the typed contract that contributing classes - * implement. Consumers retrieve every registered implementor via - * {@code Extensions.find(SampleExtensionPoint.class)} and call {@link #describe()} directly, - * with no reflection. - */ -@ExtensionPoint("Sample Java extension point") -public interface SampleExtensionPoint { - - String describe(); - -} diff --git a/sample-java-entity-decorators/demo/listener/OrderListener.java b/sample-java-entity-decorators/demo/listener/OrderListener.java deleted file mode 100644 index 89a1154..0000000 --- a/sample-java-entity-decorators/demo/listener/OrderListener.java +++ /dev/null @@ -1,26 +0,0 @@ -package demo.listener; - -import org.eclipse.dirigible.sdk.messaging.Listener; -import org.eclipse.dirigible.sdk.messaging.ListenerKind; -import org.eclipse.dirigible.sdk.messaging.MessageHandler; - -/** - * Demonstrates {@code @Listener} + the typed {@link MessageHandler} contract: connects to the - * ActiveMQ queue {@code "java-order-queue"} and logs every inbound text message. Implementing - * {@code MessageHandler} gives compile-time signature checking and a direct, non-reflective - * dispatch path; the default {@code onError} no-op is overridden here for demonstration. - */ -@Listener(name = "java-order-queue", kind = ListenerKind.QUEUE) -public class OrderListener implements MessageHandler { - - @Override - public void onMessage(String message) { - System.out.println("OrderListener received: " + message); - } - - @Override - public void onError(String error) { - System.out.println("OrderListener error: " + error); - } - -} diff --git a/sample-java-entity-decorators/demo/listener/trigger.mjs b/sample-java-entity-decorators/demo/listener/trigger.mjs deleted file mode 100644 index 03258bb..0000000 --- a/sample-java-entity-decorators/demo/listener/trigger.mjs +++ /dev/null @@ -1,3 +0,0 @@ -import { producer } from "@aerokit/sdk/messaging"; - -producer.queue("java-order-queue").send("Hello from Java @Listener trigger!"); \ No newline at end of file diff --git a/sample-java-entity-decorators/demo/scheduled/CleanupJob.java b/sample-java-entity-decorators/demo/scheduled/CleanupJob.java deleted file mode 100644 index cade31c..0000000 --- a/sample-java-entity-decorators/demo/scheduled/CleanupJob.java +++ /dev/null @@ -1,20 +0,0 @@ -package demo.scheduled; - -import org.eclipse.dirigible.sdk.job.JobHandler; -import org.eclipse.dirigible.sdk.job.Scheduled; - -/** - * Demonstrates {@code @Scheduled} + the typed {@link JobHandler} contract: fires every second via - * Quartz. Each execution logs a line that the integration test asserts on to confirm the job was - * picked up by the runtime. Implementing {@code JobHandler} gives compile-time signature checking - * and lets the runtime dispatch the callback directly (no reflection). - */ -@Scheduled(expression = "* * * * * ?") -public class CleanupJob implements JobHandler { - - @Override - public void run() { - System.out.println("CleanupJob executed!"); - } - -} diff --git a/sample-java-entity-decorators/demo/websocket/ChatHandler.java b/sample-java-entity-decorators/demo/websocket/ChatHandler.java deleted file mode 100644 index 75f00be..0000000 --- a/sample-java-entity-decorators/demo/websocket/ChatHandler.java +++ /dev/null @@ -1,43 +0,0 @@ -package demo.websocket; - -import org.eclipse.dirigible.sdk.net.Websocket; -import org.eclipse.dirigible.sdk.net.WebsocketHandler; - -/** - * Demonstrates {@code @Websocket} + the typed {@link WebsocketHandler} contract: registers this - * class as the handler for the {@code "java-chat"} WebSocket endpoint. Clients connect via - * {@code ws:///websockets/stomp/java-chat}. - * - *

- * Implementing {@code WebsocketHandler} gives compile-time signature checking and lets each - * lifecycle callback be omitted — the interface provides empty default implementations, so a - * handler that only cares about {@code onMessage} doesn't have to declare empty stubs for - * {@code onOpen} / {@code onError} / {@code onClose}. All four are overridden here to keep the - * existing log output the integration test relies on. - */ -@Websocket(name = "Java Chat", endpoint = "java-chat") -public class ChatHandler implements WebsocketHandler { - - static final String ENDPOINT = "java-chat"; - - @Override - public void onOpen() { - System.out.println("ChatHandler: client connected"); - } - - @Override - public void onMessage(String message, String from) { - System.out.println("ChatHandler: " + from + " says: " + message); - } - - @Override - public void onError(String error) { - System.out.println("ChatHandler: error: " + error); - } - - @Override - public void onClose() { - System.out.println("ChatHandler: client disconnected"); - } - -} diff --git a/sample-java-entity-decorators/demo/websocket/WebsocketStatus.java b/sample-java-entity-decorators/demo/websocket/WebsocketStatus.java deleted file mode 100644 index bc1178a..0000000 --- a/sample-java-entity-decorators/demo/websocket/WebsocketStatus.java +++ /dev/null @@ -1,27 +0,0 @@ -package demo.websocket; - -import java.util.Map; - -import org.eclipse.dirigible.components.base.spring.BeanProvider; -import org.eclipse.dirigible.sdk.http.Controller; -import org.eclipse.dirigible.sdk.http.Get; -import org.eclipse.dirigible.engine.java.websocket.JavaWebsocketRegistry; - -/** - * REST endpoint that reports whether {@link ChatHandler} was registered in the - * {@code JavaWebsocketRegistry} after publish. - * - *

- * {@code GET /services/java/sample-java-entity-decorators/demo/websocket/WebsocketStatus/status} - * returns {@code {"registered": true}} when the {@code "java-chat"} handler is active. - */ -@Controller -public class WebsocketStatus { - - @Get("/status") - public Map status() { - JavaWebsocketRegistry registry = BeanProvider.getBean(JavaWebsocketRegistry.class); - return Map.of("registered", registry.contains(ChatHandler.ENDPOINT)); - } - -} \ No newline at end of file