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
26 import org.eclipse.jetty.websocket.jsr356.JsrSession;
27 import org.eclipse.jetty.websocket.jsr356.annotations.Param.Role;
28
29
30
31
32 public class OnOpenCallable extends JsrCallable
33 {
34 private int idxEndpointConfig = -1;
35
36 public OnOpenCallable(Class<?> pojo, Method method)
37 {
38 super(pojo,method);
39 }
40
41 public OnOpenCallable(OnOpenCallable copy)
42 {
43 super(copy);
44 this.idxEndpointConfig = copy.idxEndpointConfig;
45 }
46
47 public void call(Object endpoint, EndpointConfig config)
48 {
49
50 if (idxEndpointConfig >= 0)
51 {
52 super.args[idxEndpointConfig] = config;
53 }
54 super.call(endpoint,super.args);
55 }
56
57 @Override
58 public void init(JsrSession session)
59 {
60 idxEndpointConfig = findIndexForRole(Role.ENDPOINT_CONFIG);
61 super.init(session);
62 }
63
64 @Override
65 public void setDecoderClass(Class<? extends Decoder> decoderClass)
66 {
67
68 }
69 }