1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.eclipse.jetty.websocket.jsr356.annotations;
20
21 import java.lang.reflect.Method;
22
23 import javax.websocket.Decoder;
24 import javax.websocket.EndpointConfig;
25 import javax.websocket.OnOpen;
26
27 import org.eclipse.jetty.websocket.jsr356.JsrSession;
28 import org.eclipse.jetty.websocket.jsr356.annotations.Param.Role;
29
30
31
32
33 public class OnOpenCallable extends JsrCallable
34 {
35 private int idxEndpointConfig = -1;
36
37 public OnOpenCallable(Class<?> pojo, Method method)
38 {
39 super(pojo,method);
40 }
41
42 public OnOpenCallable(OnOpenCallable copy)
43 {
44 super(copy);
45 this.idxEndpointConfig = copy.idxEndpointConfig;
46 }
47
48 public void call(Object endpoint, EndpointConfig config)
49 {
50
51 if (idxEndpointConfig >= 0)
52 {
53 super.args[idxEndpointConfig] = config;
54 }
55 super.call(endpoint,super.args);
56 }
57
58 @Override
59 public void init(JsrSession session)
60 {
61 idxEndpointConfig = findIndexForRole(Role.ENDPOINT_CONFIG);
62 super.init(session);
63 }
64
65 @Override
66 public void setDecoderClass(Class<? extends Decoder> decoderClass)
67 {
68
69 }
70 }