This commit is contained in:
@@ -1,39 +0,0 @@
|
|||||||
/*
|
|
||||||
* To change this license header, choose License Headers in Project Properties.
|
|
||||||
* To change this template file, choose Tools | Templates
|
|
||||||
* and open the template in the editor.
|
|
||||||
*/
|
|
||||||
package org.redkale.net.http;
|
|
||||||
|
|
||||||
import java.lang.annotation.*;
|
|
||||||
import static java.lang.annotation.ElementType.METHOD;
|
|
||||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 标记在RestWebSocket的接收消息方法上
|
|
||||||
*
|
|
||||||
* <br><p>
|
|
||||||
* 详情见: https://redkale.org
|
|
||||||
*
|
|
||||||
* @author zhangjx
|
|
||||||
*/
|
|
||||||
@Inherited
|
|
||||||
@Documented
|
|
||||||
@Target({METHOD})
|
|
||||||
@Retention(RUNTIME)
|
|
||||||
public @interface RestOnMessage {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 请求的方法名, 不能含特殊字符
|
|
||||||
*
|
|
||||||
* @return String
|
|
||||||
*/
|
|
||||||
String name() default "";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注描述
|
|
||||||
*
|
|
||||||
* @return String
|
|
||||||
*/
|
|
||||||
String comment() default "";
|
|
||||||
}
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
/*
|
|
||||||
* To change this license header, choose License Headers in Project Properties.
|
|
||||||
* To change this template file, choose Tools | Templates
|
|
||||||
* and open the template in the editor.
|
|
||||||
*/
|
|
||||||
package org.redkale.net.http;
|
|
||||||
|
|
||||||
import java.lang.annotation.*;
|
|
||||||
import static java.lang.annotation.ElementType.METHOD;
|
|
||||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 标记在RestWebSocket的方法上
|
|
||||||
*
|
|
||||||
* <br><p>
|
|
||||||
* 详情见: https://redkale.org
|
|
||||||
*
|
|
||||||
* @author zhangjx
|
|
||||||
*/
|
|
||||||
@Inherited
|
|
||||||
@Documented
|
|
||||||
@Target({METHOD})
|
|
||||||
@Retention(RUNTIME)
|
|
||||||
public @interface RestOnOpen {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注描述
|
|
||||||
*
|
|
||||||
* @return String
|
|
||||||
*/
|
|
||||||
String comment() default "";
|
|
||||||
}
|
|
||||||
@@ -130,6 +130,7 @@ public abstract class WebSocketServlet extends HttpServlet implements Resourcabl
|
|||||||
webSocket._jsonConvert = jsonConvert;
|
webSocket._jsonConvert = jsonConvert;
|
||||||
webSocket._remoteAddress = request.getRemoteAddress();
|
webSocket._remoteAddress = request.getRemoteAddress();
|
||||||
webSocket._remoteAddr = request.getRemoteAddr();
|
webSocket._remoteAddr = request.getRemoteAddr();
|
||||||
|
initWebSocket(webSocket);
|
||||||
CompletableFuture<Serializable> sessionFuture = webSocket.onOpen(request);
|
CompletableFuture<Serializable> sessionFuture = webSocket.onOpen(request);
|
||||||
if (sessionFuture == null) {
|
if (sessionFuture == null) {
|
||||||
if (debug) logger.finest("WebSocket connect abort, Not found sessionid. request=" + request);
|
if (debug) logger.finest("WebSocket connect abort, Not found sessionid. request=" + request);
|
||||||
@@ -187,6 +188,10 @@ public abstract class WebSocketServlet extends HttpServlet implements Resourcabl
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void initWebSocket(WebSocket websocket) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
protected WebSocketNode createWebSocketNode() {
|
protected WebSocketNode createWebSocketNode() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user