3838import io .undertow .websockets .core .StreamSourceFrameChannel ;
3939import io .undertow .websockets .core .WebSocketChannel ;
4040import io .undertow .websockets .spi .WebSocketHttpExchange ;
41- import org .osgl .logging .LogManager ;
42- import org .osgl .logging .Logger ;
4341
4442import java .io .IOException ;
4543
4644class UndertowWebSocketConnectionHandler extends WebSocketConnectionHandler {
4745
48- private static final Logger LOGGER = LogManager .get (UndertowWebSocketConnectionHandler .class );
49-
5046 UndertowWebSocketConnectionHandler (WebSocketConnectionManager manager ) {
5147 super (manager );
5248 }
@@ -57,8 +53,8 @@ class UndertowWebSocketConnectionHandler extends WebSocketConnectionHandler {
5753
5854 @ Override
5955 public void handle (final ActionContext context ) {
60- if (LOGGER .isTraceEnabled ()) {
61- LOGGER .trace ("handle websocket connection request to %s" , context .req ().url ());
56+ if (logger .isTraceEnabled ()) {
57+ logger .trace ("handle websocket connection request to %s" , context .req ().url ());
6258 }
6359 final UndertowRequest req = (UndertowRequest ) context .req ();
6460 HttpServerExchange exchange = req .exchange ();
@@ -70,24 +66,24 @@ public void onConnect(WebSocketHttpExchange exchange, WebSocketChannel channel)
7066 channel .setAttribute ("act_conn" , connection );
7167 connectionManager .registerNewConnection (connection , context );
7268 final WebSocketContext wsCtx = new WebSocketContext (req .url (), connection , connectionManager , context , connectionManager .app ());
73- if (LOGGER .isTraceEnabled ()) {
74- LOGGER .trace ("websocket context[%s] created for %s" , connection .sessionId (), context .req ().url ());
69+ if (logger .isTraceEnabled ()) {
70+ logger .trace ("websocket context[%s] created for %s" , connection .sessionId (), context .req ().url ());
7571 }
7672 channel .getReceiveSetter ().set (new AbstractReceiveListener () {
7773 @ Override
7874 protected void onFullTextMessage (WebSocketChannel channel , BufferedTextMessage message ) throws IOException {
7975 String payload = message .getData ();
80- if (LOGGER .isTraceEnabled ()) {
81- LOGGER .trace ("websocket message received: %s" , payload );
76+ if (logger .isTraceEnabled ()) {
77+ logger .trace ("websocket message received: %s" , payload );
8278 }
8379 wsCtx .messageReceived (payload );
8480 invoke (wsCtx );
8581 }
8682
8783 @ Override
8884 protected void onClose (WebSocketChannel webSocketChannel , StreamSourceFrameChannel channel ) throws IOException {
89- if (LOGGER .isTraceEnabled ()) {
90- LOGGER .trace ("websocket closed: " , connection .sessionId ());
85+ if (logger .isTraceEnabled ()) {
86+ logger .trace ("websocket closed: " , connection .sessionId ());
9187 }
9288 super .onClose (webSocketChannel , channel );
9389 connection .destroy ();
0 commit comments