Skip to content
This repository was archived by the owner on Jan 30, 2019. It is now read-only.

Commit 96bae87

Browse files
author
Arun Gupta
committed
Migrated most of the samples to 82
Former-commit-id: 0513fe821265041f9aaa7ad9d2a2ed543462a0a4
1 parent 97b05ef commit 96bae87

File tree

5 files changed

+51
-7
lines changed

5 files changed

+51
-7
lines changed

samples/websocket/encoder-client/src/main/java/org/glassfish/encoder/client/MyMessageDecoder.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,12 @@
4343
import javax.json.Json;
4444
import javax.websocket.DecodeException;
4545
import javax.websocket.Decoder;
46+
import javax.websocket.EndpointConfig;
4647

4748
/**
4849
* @author Arun Gupta
4950
*/
50-
public class MyMessageDecoder extends Decoder.Adapter implements Decoder.Text<MyMessage> {
51+
public class MyMessageDecoder implements Decoder.Text<MyMessage> {
5152

5253
@Override
5354
public MyMessage decode(String string) throws DecodeException {
@@ -58,4 +59,14 @@ public MyMessage decode(String string) throws DecodeException {
5859
public boolean willDecode(String string) {
5960
return true;
6061
}
62+
63+
@Override
64+
public void init(EndpointConfig ec) {
65+
System.out.println("init");
66+
}
67+
68+
@Override
69+
public void destroy() {
70+
System.out.println("desroy");
71+
}
6172
}

samples/websocket/encoder-client/src/main/java/org/glassfish/encoder/client/MyMessageEncoder.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,24 @@
4141

4242
import javax.websocket.EncodeException;
4343
import javax.websocket.Encoder;
44+
import javax.websocket.EndpointConfig;
4445

4546
/**
4647
* @author Arun Gupta
4748
*/
48-
public class MyMessageEncoder extends Encoder.Adapter implements Encoder.Text<MyMessage> {
49+
public class MyMessageEncoder implements Encoder.Text<MyMessage> {
4950
@Override
5051
public String encode(MyMessage myMessage) throws EncodeException {
5152
return myMessage.getJsonObject().toString();
5253
}
54+
55+
@Override
56+
public void init(EndpointConfig ec) {
57+
System.out.println("init");
58+
}
59+
60+
@Override
61+
public void destroy() {
62+
System.out.println("desroy");
63+
}
5364
}

samples/websocket/encoder/src/main/java/org/sample/encoder/MyMessageDecoder.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,12 @@
4343
import javax.json.Json;
4444
import javax.websocket.DecodeException;
4545
import javax.websocket.Decoder;
46+
import javax.websocket.EndpointConfig;
4647

4748
/**
4849
* @author Arun Gupta
4950
*/
50-
public class MyMessageDecoder extends Decoder.Adapter implements Decoder.Text<MyMessage> {
51+
public class MyMessageDecoder implements Decoder.Text<MyMessage> {
5152

5253
@Override
5354
public MyMessage decode(String string) throws DecodeException {
@@ -62,4 +63,14 @@ public MyMessage decode(String string) throws DecodeException {
6263
public boolean willDecode(String string) {
6364
return true;
6465
}
66+
67+
@Override
68+
public void init(EndpointConfig ec) {
69+
System.out.println("init");
70+
}
71+
72+
@Override
73+
public void destroy() {
74+
System.out.println("desroy");
75+
}
6576
}

samples/websocket/encoder/src/main/java/org/sample/encoder/MyMessageEncoder.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,25 @@
4141

4242
import javax.websocket.EncodeException;
4343
import javax.websocket.Encoder;
44+
import javax.websocket.EndpointConfig;
4445

4546
/**
4647
* @author Arun Gupta
4748
*/
48-
public class MyMessageEncoder extends Encoder.Adapter implements Encoder.Text<MyMessage> {
49+
public class MyMessageEncoder implements Encoder.Text<MyMessage> {
4950
@Override
5051
public String encode(MyMessage myMessage) throws EncodeException {
5152
// return this.getClass().getName();
5253
return myMessage.getJsonObject().toString();
5354
}
55+
56+
@Override
57+
public void init(EndpointConfig ec) {
58+
System.out.println("init");
59+
}
60+
61+
@Override
62+
public void destroy() {
63+
System.out.println("destroy");
64+
}
5465
}

samples/websocket/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121
<module>client</module>
2222
<module>encoder</module>
2323
<module>encoder-client</module>
24-
<!--<module>encoder-programmatic</module>-->
24+
<module>encoder-programmatic</module>
2525
<module>endpoint</module>
2626
<module>endpoint-javatypes</module>
2727
<module>endpoint-multipart</module>
28-
<!-- <module>endpoint-multipart-programmatic</module>
28+
<!--<module>endpoint-multipart-programmatic</module>-->
2929
<module>endpoint-programmatic</module>
30-
<module>httpsession</module>-->
30+
<module>httpsession</module>
3131
<module>injection</module>
3232
<module>javase-client</module>
3333
<module>messagesize</module>

0 commit comments

Comments
 (0)