private long getBlockingSendTimeout() { Object obj = wsSession.getUserProperties().get(Constants.BLOCKING_SEND_TIMEOUT_PROPERTY); Long userTimeout = null; if (obj instanceof Long) { userTimeout = (Long) obj; } if (userTimeout == null) { return Constants.DEFAULT_BLOCKING_SEND_TIMEOUT; } else { return userTimeout.longValue(); } }
private long getBlockingSendTimeout() { Object obj = wsSession.getUserProperties().get( BLOCKING_SEND_TIMEOUT_PROPERTY); Long userTimeout = null; if (obj instanceof Long) { userTimeout = (Long) obj; } if (userTimeout == null) { return DEFAULT_BLOCKING_SEND_TIMEOUT; } else { return userTimeout.longValue(); } }
private long getBlockingSendTimeout() { Object obj = wsSession.getUserProperties().get(Constants.BLOCKING_SEND_TIMEOUT_PROPERTY); Long userTimeout = null; if (obj instanceof Long) { userTimeout = (Long) obj; } if (userTimeout == null) { return Constants.DEFAULT_BLOCKING_SEND_TIMEOUT; } else { return userTimeout.longValue(); } }
private long getBlockingSendTimeout() { Object obj = wsSession.getUserProperties().get( BLOCKING_SEND_TIMEOUT_PROPERTY); Long userTimeout = null; if (obj instanceof Long) { userTimeout = (Long) obj; } if (userTimeout == null) { return DEFAULT_BLOCKING_SEND_TIMEOUT; } else { return userTimeout.longValue(); } }
private long getBlockingSendTimeout() { Object obj = wsSession.getUserProperties().get( BLOCKING_SEND_TIMEOUT_PROPERTY); Long userTimeout = null; if (obj instanceof Long) { userTimeout = (Long) obj; } if (userTimeout == null) { return DEFAULT_BLOCKING_SEND_TIMEOUT; } else { return userTimeout.longValue(); } }
@Override protected void sendMessageBinary(ByteBuffer msg, boolean last) throws WsIOException { ClassLoader cl = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(applicationClassLoader); // set connection local to the message handler so WSMessage will contain the connection ((DefaultWebSocketEndpoint) wsSession.getLocal()).setConnectionLocal((WebSocketConnection) wsSession.getUserProperties().get(WSConstants.WS_CONNECTION)); // super! super.sendMessageBinary(msg, last); } finally { // clear thread local ((DefaultWebSocketEndpoint) wsSession.getLocal()).setConnectionLocal(null); Thread.currentThread().setContextClassLoader(cl); } }
@Override protected void sendMessageText(boolean last) throws WsIOException { ClassLoader cl = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(applicationClassLoader); // set connection local to the message handler so WSMessage will contain the connection ((DefaultWebSocketEndpoint) wsSession.getLocal()).setConnectionLocal((WebSocketConnection) wsSession.getUserProperties().get(WSConstants.WS_CONNECTION)); // super! super.sendMessageText(last); } finally { // clear thread local ((DefaultWebSocketEndpoint) wsSession.getLocal()).setConnectionLocal(null); Thread.currentThread().setContextClassLoader(cl); } }
log.debug("pathParameters: {}", pathParameters); Map<String, Object> userProps = wsSession.getUserProperties(); log.debug("userProps: {}", userProps);
wsSession.getUserProperties().put(WSConstants.WS_CONNECTION, conn);