From edbd23075e848358c360b828754ed8655129bbe4 Mon Sep 17 00:00:00 2001 From: "Jonathan S. Fisher" Date: Fri, 14 Feb 2020 11:31:29 -0600 Subject: [PATCH] add proposed interfaces/annotations --- .../jakarta/jms/InboundMessageBodyConverter.java | 16 ++++++++++++++++ .../java/jakarta/jms/MessageBodyConverter.java | 5 +++++ .../jms/OutboundMessageBodyConverter.java | 16 ++++++++++++++++ 3 files changed, 37 insertions(+) create mode 100644 api/src/main/java/jakarta/jms/InboundMessageBodyConverter.java create mode 100644 api/src/main/java/jakarta/jms/MessageBodyConverter.java create mode 100644 api/src/main/java/jakarta/jms/OutboundMessageBodyConverter.java diff --git a/api/src/main/java/jakarta/jms/InboundMessageBodyConverter.java b/api/src/main/java/jakarta/jms/InboundMessageBodyConverter.java new file mode 100644 index 0000000..25439b7 --- /dev/null +++ b/api/src/main/java/jakarta/jms/InboundMessageBodyConverter.java @@ -0,0 +1,16 @@ +package jakarta.jms; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Documented +@Target({ElementType.METHOD, ElementType.TYPE}) +@Inherited +@Retention(RetentionPolicy.RUNTIME) +public @interface InboundMessageBodyConverter { + Class> messageBodyConverter(); +} diff --git a/api/src/main/java/jakarta/jms/MessageBodyConverter.java b/api/src/main/java/jakarta/jms/MessageBodyConverter.java new file mode 100644 index 0000000..d08c0df --- /dev/null +++ b/api/src/main/java/jakarta/jms/MessageBodyConverter.java @@ -0,0 +1,5 @@ +package jakarta.jms; + +public interface MessageBodyConverter { + K convert(T message, Class targetClass); +} diff --git a/api/src/main/java/jakarta/jms/OutboundMessageBodyConverter.java b/api/src/main/java/jakarta/jms/OutboundMessageBodyConverter.java new file mode 100644 index 0000000..c3d66db --- /dev/null +++ b/api/src/main/java/jakarta/jms/OutboundMessageBodyConverter.java @@ -0,0 +1,16 @@ +package jakarta.jms; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Documented +@Target({ElementType.METHOD, ElementType.TYPE}) +@Inherited +@Retention(RetentionPolicy.RUNTIME) +public @interface OutboundMessageBodyConverter { + Class> messageBodyConverter(); +}