1 //
2 // ========================================================================
3 // Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
4 // ------------------------------------------------------------------------
5 // All rights reserved. This program and the accompanying materials
6 // are made available under the terms of the Eclipse Public License v1.0
7 // and Apache License v2.0 which accompanies this distribution.
8 //
9 // The Eclipse Public License is available at
10 // http://www.eclipse.org/legal/epl-v10.html
11 //
12 // The Apache License v2.0 is available at
13 // http://www.opensource.org/licenses/apache2.0.php
14 //
15 // You may elect to redistribute this code under either of these licenses.
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.OnMessage;
25
26 import org.eclipse.jetty.websocket.jsr356.MessageType;
27
28 public interface IJsrMethod
29 {
30 /**
31 * Indicate that partial message support is desired
32 */
33 void enablePartialMessageSupport();
34
35 /**
36 * Get the fully qualifed method name {classname}.{methodname}({params}) suitable for using in error messages.
37 *
38 * @return the fully qualified method name for end users
39 */
40 String getFullyQualifiedMethodName();
41
42 /**
43 * Get the Decoder to use for message decoding
44 *
45 * @return the decoder class to use for message decoding
46 */
47 Class<? extends Decoder> getMessageDecoder();
48
49 /**
50 * The type of message this method can handle
51 *
52 * @return the message type if @{@link OnMessage} annotated, null if unknown/unspecified
53 */
54 MessageType getMessageType();
55
56 /**
57 * The reflected method
58 *
59 * @return the method itself
60 */
61 Method getMethod();
62
63 /**
64 * Indicator that partial message support is enabled
65 *
66 * @return true if enabled
67 */
68 boolean isPartialMessageSupportEnabled();
69
70 /**
71 * The message decoder class to use.
72 *
73 * @param decoderClass
74 */
75 void setMessageDecoder(Class<? extends Decoder> decoderClass);
76
77 /**
78 * The type of message this method can handle
79 *
80 * @param type
81 * the type of message
82 */
83 void setMessageType(MessageType type);
84 }