1 // 2 // ======================================================================== 3 // Copyright (c) 1995-2014 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 25 import org.eclipse.jetty.websocket.jsr356.MessageType; 26 27 public interface IJsrMethod 28 { 29 /** 30 * Indicate that partial message support is desired 31 */ 32 void enablePartialMessageSupport(); 33 34 /** 35 * Get the fully qualifed method name {classname}.{methodname}({params}) suitable for using in error messages. 36 * 37 * @return the fully qualified method name for end users 38 */ 39 String getFullyQualifiedMethodName(); 40 41 /** 42 * Get the Decoder to use for message decoding 43 * 44 * @return the decoder class to use for message decoding 45 */ 46 Class<? extends Decoder> getMessageDecoder(); 47 48 /** 49 * The type of message this method can handle 50 * 51 * @return the message type if @{@link OnMessage} annotated, null if unknown/unspecified 52 */ 53 MessageType getMessageType(); 54 55 /** 56 * The reflected method 57 * 58 * @return the method itself 59 */ 60 Method getMethod(); 61 62 /** 63 * Indicator that partial message support is enabled 64 * 65 * @return true if enabled 66 */ 67 boolean isPartialMessageSupportEnabled(); 68 69 /** 70 * The message decoder class to use. 71 * 72 * @param decoderClass 73 */ 74 void setMessageDecoder(Class<? extends Decoder> decoderClass); 75 76 /** 77 * The type of message this method can handle 78 * 79 * @param type 80 * the type of message 81 */ 82 void setMessageType(MessageType type); 83 }