This commit is contained in:
Redkale
2017-05-22 20:20:29 +08:00
parent 03ac849451
commit 95c53f99e0
3 changed files with 5 additions and 71 deletions

View File

@@ -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 "";
}

View File

@@ -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 "";
}

View File

@@ -130,6 +130,7 @@ public abstract class WebSocketServlet extends HttpServlet implements Resourcabl
webSocket._jsonConvert = jsonConvert;
webSocket._remoteAddress = request.getRemoteAddress();
webSocket._remoteAddr = request.getRemoteAddr();
initWebSocket(webSocket);
CompletableFuture<Serializable> sessionFuture = webSocket.onOpen(request);
if (sessionFuture == null) {
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() {
return null;
}