[johnzon] branch master updated: [JOHNZON-340] ensure javax.websocket is properly shaded

2021-04-22 Thread rmannibucau
This is an automated email from the ASF dual-hosted git repository.

rmannibucau pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/johnzon.git


The following commit(s) were added to refs/heads/master by this push:
 new 5820eba  [JOHNZON-340] ensure javax.websocket is properly shaded
5820eba is described below

commit 5820eba48518b07701951b03128e9cd9d18edd51
Author: Romain Manni-Bucau 
AuthorDate: Thu Apr 22 13:46:32 2021 +0200

[JOHNZON-340] ensure javax.websocket is properly shaded
---
 pom.xml | 4 
 1 file changed, 4 insertions(+)

diff --git a/pom.xml b/pom.xml
index 476b905..4d6987c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -126,6 +126,10 @@
 javax.json
 jakarta.json
   
+  
+javax.websocket
+jakarta.websocket
+  
 
   
 


[johnzon] branch master updated: [JOHNZON-340] add JSON-B support in websocket module

2021-04-22 Thread rmannibucau
This is an automated email from the ASF dual-hosted git repository.

rmannibucau pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/johnzon.git


The following commit(s) were added to refs/heads/master by this push:
 new 73eb0fb  [JOHNZON-340] add JSON-B support in websocket module
73eb0fb is described below

commit 73eb0fbaac15d837432ca6f6531c5e811ef918b1
Author: Romain Manni-Bucau 
AuthorDate: Thu Apr 22 10:08:15 2021 +0200

[JOHNZON-340] add JSON-B support in websocket module
---
 johnzon-websocket/pom.xml  | 14 
 .../TypeAwareDecoder.java} | 43 ++-
 .../lazy/LazySupplier.java}| 38 +-
 .../websocket/internal/mapper/MapperLocator.java   | 42 ++-
 .../internal/mapper/MapperLocatorDelegate.java | 86 ++
 .../servlet/IgnoreIfMissing.java}  | 37 +-
 .../JsonbLocator.java} | 31 ++--
 .../websocket/jsonb/JsonbLocatorDelegate.java  | 83 +
 .../johnzon/websocket/jsonb/JsonbTextDecoder.java  | 70 ++
 .../JsonbTextEncoder.java} | 24 +++---
 .../websocket/mapper/JohnzonTextDecoder.java   | 10 +--
 .../websocket/mapper/JohnzonTextEncoder.java   |  6 +-
 .../apache/johnzon/websocket/MapperCodecTest.java  |  4 +-
 src/site/markdown/index.md | 17 +
 14 files changed, 354 insertions(+), 151 deletions(-)

diff --git a/johnzon-websocket/pom.xml b/johnzon-websocket/pom.xml
index c73c2f1..7568633 100644
--- a/johnzon-websocket/pom.xml
+++ b/johnzon-websocket/pom.xml
@@ -49,9 +49,23 @@
 
 
 
+  org.apache.geronimo.specs
+  geronimo-jsonb_1.0_spec
+  provided
+
+
+
   org.apache.johnzon
   johnzon-mapper
   ${project.version}
+  provided
+  true
+
+
+  org.apache.johnzon
+  johnzon-jsonb
+  ${project.version}
+  test
 
 
 
diff --git 
a/johnzon-websocket/src/main/java/org/apache/johnzon/websocket/mapper/JohnzonTextDecoder.java
 
b/johnzon-websocket/src/main/java/org/apache/johnzon/websocket/internal/TypeAwareDecoder.java
similarity index 74%
copy from 
johnzon-websocket/src/main/java/org/apache/johnzon/websocket/mapper/JohnzonTextDecoder.java
copy to 
johnzon-websocket/src/main/java/org/apache/johnzon/websocket/internal/TypeAwareDecoder.java
index 4530966..0e92215 100644
--- 
a/johnzon-websocket/src/main/java/org/apache/johnzon/websocket/mapper/JohnzonTextDecoder.java
+++ 
b/johnzon-websocket/src/main/java/org/apache/johnzon/websocket/internal/TypeAwareDecoder.java
@@ -16,51 +16,29 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.johnzon.websocket.mapper;
+package org.apache.johnzon.websocket.internal;
 
-import org.apache.johnzon.mapper.Mapper;
-import org.apache.johnzon.websocket.internal.mapper.MapperLocator;
-
-import java.io.Reader;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-import java.lang.reflect.Type;
-import javax.websocket.DecodeException;
-import javax.websocket.Decoder;
 import javax.websocket.EndpointConfig;
 import javax.websocket.OnMessage;
 import javax.websocket.Session;
 import javax.websocket.server.PathParam;
 import javax.websocket.server.ServerEndpointConfig;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+import java.lang.reflect.Type;
 
-public class JohnzonTextDecoder implements Decoder.TextStream {
-protected Mapper mapper;
+public abstract class TypeAwareDecoder {
 protected Type type;
 
-public JohnzonTextDecoder() {
+public TypeAwareDecoder() {
 // no-op
 }
 
-// for client side no way to guess the type so let the user provide it 
easily
-public JohnzonTextDecoder(final Type type) {
-this(null, type);
-}
-
-public JohnzonTextDecoder(final Mapper mapper, final Type type) {
-this.mapper = mapper;
+public TypeAwareDecoder(final Type type) {
 this.type = type;
 }
 
-@Override
-public Object decode(final Reader stream) throws DecodeException {
-return mapper.readObject(stream, type);
-}
-
-@Override
-public void init(final EndpointConfig endpointConfig) {
-if (mapper == null) {
-mapper = MapperLocator.locate();
-}
+protected void init(final EndpointConfig endpointConfig) {
 if (type != null) {
 return;
 }
@@ -102,9 +80,4 @@ public class JohnzonTextDecoder implements 
Decoder.TextStream {
 }
 }
 }
-
-@Override
-public void destroy() {
-// no-op
-}
 }
diff --git 
a/johnzon-websocket/src/main/java/org/apache/johnzon/websocket/mapper/JohnzonTextEncoder.java
 
b/johnzon-websocket/src/main/java/org/apache/johnzon/websocket/internal/lazy/LazySupplier.java
similarity index 53%
copy from