|
38 | 38 | import act.util.MissingAuthenticationHandler; |
39 | 39 | import act.view.ActErrorResult; |
40 | 40 | import act.view.RenderAny; |
| 41 | +import act.xio.WebSocketConnectionHandler; |
41 | 42 | import org.osgl.$; |
42 | 43 | import org.osgl.cache.CacheService; |
43 | 44 | import org.osgl.exception.UnexpectedException; |
@@ -99,6 +100,8 @@ public final class RequestHandlerProxy extends RequestHandlerBase { |
99 | 100 | private MissingAuthenticationHandler missingAuthenticationHandler; |
100 | 101 | private MissingAuthenticationHandler csrfFailureHandler; |
101 | 102 |
|
| 103 | + private WebSocketConnectionHandler webSocketConnectionHandler; |
| 104 | + |
102 | 105 | final GroupInterceptorWithResult BEFORE_INTERCEPTOR = new GroupInterceptorWithResult(beforeInterceptors); |
103 | 106 | final GroupAfterInterceptor AFTER_INTERCEPTOR = new GroupAfterInterceptor(afterInterceptors); |
104 | 107 | final GroupFinallyInterceptor FINALLY_INTERCEPTOR = new GroupFinallyInterceptor(finallyInterceptors); |
@@ -343,12 +346,20 @@ private ActionMethodMetaInfo findActionInfoFromParent(ControllerClassMetaInfo ct |
343 | 346 | return new ActionMethodMetaInfo($.notNull(actionInfo), ctrlInfo); |
344 | 347 | } |
345 | 348 |
|
| 349 | + private WebSocketConnectionHandler tryGenerateWebSocketConnectionHandler(ActionMethodMetaInfo methodInfo) { |
| 350 | + return Act.network().createWebSocketConnectionHandler(methodInfo); |
| 351 | + } |
| 352 | + |
346 | 353 | private void generateHandlers() { |
347 | 354 | ControllerClassMetaInfo ctrlInfo = app.classLoader().controllerClassMetaInfo(controllerClassName); |
348 | 355 | ActionMethodMetaInfo actionInfo = ctrlInfo.action(actionMethodName); |
349 | 356 | if (null == actionInfo) { |
350 | 357 | actionInfo = findActionInfoFromParent(ctrlInfo, actionMethodName); |
351 | 358 | } |
| 359 | + webSocketConnectionHandler = tryGenerateWebSocketConnectionHandler(actionInfo); |
| 360 | + if (null != webSocketConnectionHandler) { |
| 361 | + return; |
| 362 | + } |
352 | 363 | Act.Mode mode = Act.mode(); |
353 | 364 | actionHandler = mode.createRequestHandler(actionInfo, app); |
354 | 365 | sessionFree = actionHandler.sessionFree(); |
|
0 commit comments