this.pathParameters = pathParameters == null ? Collections.<String, String>emptyMap() : Collections.unmodifiableMap(new HashMap<String, String>(pathParameters)); this.basicRemote = new TyrusRemoteEndpoint.Basic(this, socket, endpointWrapper); this.asyncRemote = new TyrusRemoteEndpoint.Async(this, socket, endpointWrapper); this.handlerManager = MessageHandlerManager.fromDecoderInstances(endpointWrapper.getDecoders());
@Override public void sendObject(Object data) throws IOException, EncodeException { checkNotNull(data, "data"); final Future<?> future = sendSyncObject(data); try { future.get(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } catch (ExecutionException e) { if (e.getCause() instanceof IOException) { throw (IOException) e.getCause(); } else if (e.getCause() instanceof EncodeException) { throw (EncodeException) e.getCause(); } else { throw new IOException(e.getCause()); } } session.restartIdleTimeoutExecutor(); }
this.pathParameters = pathParameters == null ? Collections.<String, String>emptyMap() : Collections.unmodifiableMap(new HashMap<String, String>(pathParameters)); this.basicRemote = new TyrusRemoteEndpoint.Basic(this, socket, endpointWrapper); this.asyncRemote = new TyrusRemoteEndpoint.Async(this, socket, endpointWrapper); this.handlerManager = MessageHandlerManager.fromDecoderInstances(endpointWrapper.getDecoders());
@Override public void sendObject(Object data) throws IOException, EncodeException { checkNotNull(data, "data"); final Future<?> future = sendSyncObject(data); try { future.get(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } catch (ExecutionException e) { if (e.getCause() instanceof IOException) { throw (IOException) e.getCause(); } else if (e.getCause() instanceof EncodeException) { throw (EncodeException) e.getCause(); } else { throw new IOException(e.getCause()); } } session.restartIdleTimeoutExecutor(); }
@Override public void sendText(String text) throws IOException { checkNotNull(text, "text"); session.getDebugContext() .appendLogMessage(LOGGER, Level.FINEST, DebugContext.Type.MESSAGE_OUT, "Sending text message: ", text); final Future<?> future = webSocket.sendText(text); try { processFuture(future); } finally { session.restartIdleTimeoutExecutor(); } }
@Override public void sendBinary(ByteBuffer partialByte, boolean isLast) throws IOException { checkNotNull(partialByte, "partialByte"); session.getDebugContext().appendLogMessage(LOGGER, Level.FINEST, DebugContext.Type.MESSAGE_OUT, "Sending partial binary message"); final Future<?> future = webSocket.sendBinary(Utils.getRemainingArray(partialByte), isLast); try { processFuture(future); } finally { session.restartIdleTimeoutExecutor(); } }
@Override public void sendText(String partialMessage, boolean isLast) throws IOException { checkNotNull(partialMessage, "partialMessage"); session.getDebugContext().appendLogMessage(LOGGER, Level.FINEST, DebugContext.Type.MESSAGE_OUT, "Sending partial text message: ", partialMessage); final Future<?> future = webSocket.sendText(partialMessage, isLast); try { processFuture(future); } finally { session.restartIdleTimeoutExecutor(); } }
@Override public void close(CloseReason closeReason) throws IOException { cleanAfterClose(); checkConnectionState(State.CLOSED); changeStateToClosed(); basicRemote.close(closeReason); }
@Override public void sendText(String text) throws IOException { checkNotNull(text, "text"); session.getDebugContext() .appendLogMessage(LOGGER, Level.FINEST, DebugContext.Type.MESSAGE_OUT, "Sending text message: ", text); final Future<?> future = webSocket.sendText(text); try { processFuture(future); } finally { session.restartIdleTimeoutExecutor(); } }
@Override public void sendBinary(ByteBuffer data) throws IOException { checkNotNull(data, "data"); session.getDebugContext() .appendLogMessage(LOGGER, Level.FINEST, DebugContext.Type.MESSAGE_OUT, "Sending binary message"); final Future<?> future = webSocket.sendBinary(Utils.getRemainingArray(data)); try { processFuture(future); } finally { session.restartIdleTimeoutExecutor(); } }
@Override public void sendBinary(ByteBuffer data) throws IOException { checkNotNull(data, "data"); session.getDebugContext() .appendLogMessage(LOGGER, Level.FINEST, DebugContext.Type.MESSAGE_OUT, "Sending binary message"); final Future<?> future = webSocket.sendBinary(Utils.getRemainingArray(data)); try { processFuture(future); } finally { session.restartIdleTimeoutExecutor(); } }
@Override public void sendBinary(ByteBuffer partialByte, boolean isLast) throws IOException { checkNotNull(partialByte, "partialByte"); session.getDebugContext().appendLogMessage(LOGGER, Level.FINEST, DebugContext.Type.MESSAGE_OUT, "Sending partial binary message"); final Future<?> future = webSocket.sendBinary(Utils.getRemainingArray(partialByte), isLast); try { processFuture(future); } finally { session.restartIdleTimeoutExecutor(); } }
@Override public void sendText(String partialMessage, boolean isLast) throws IOException { checkNotNull(partialMessage, "partialMessage"); session.getDebugContext().appendLogMessage(LOGGER, Level.FINEST, DebugContext.Type.MESSAGE_OUT, "Sending partial text message: ", partialMessage); final Future<?> future = webSocket.sendText(partialMessage, isLast); try { processFuture(future); } finally { session.restartIdleTimeoutExecutor(); } }
@Override public void close(CloseReason closeReason) throws IOException { cleanAfterClose(); checkConnectionState(State.CLOSED); changeStateToClosed(); basicRemote.close(closeReason); }
@Override public void close() throws IOException { cleanAfterClose(); changeStateToClosed(); basicRemote.close(new CloseReason(CloseReason.CloseCodes.NORMAL_CLOSURE, null)); }
@Override public void close() throws IOException { cleanAfterClose(); changeStateToClosed(); basicRemote.close(new CloseReason(CloseReason.CloseCodes.NORMAL_CLOSURE, null)); }