1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one or more 3 * contributor license agreements. See the NOTICE file distributed with 4 * this work for additional information regarding copyright ownership. 5 * The ASF licenses this file to You under the Apache License, Version 2.0 6 * (the "License"); you may not use this file except in compliance with 7 * the License. You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 package nginx.unit.websocket; 18 19 import java.nio.ByteBuffer; 20 import java.util.concurrent.Future; 21 22 import javax.websocket.RemoteEndpoint; 23 import javax.websocket.SendHandler; 24 25 public class WsRemoteEndpointAsync extends WsRemoteEndpointBase 26 implements RemoteEndpoint.Async { 27 WsRemoteEndpointAsync(WsRemoteEndpointImplBase base)28 WsRemoteEndpointAsync(WsRemoteEndpointImplBase base) { 29 super(base); 30 } 31 32 33 @Override getSendTimeout()34 public long getSendTimeout() { 35 return base.getSendTimeout(); 36 } 37 38 39 @Override setSendTimeout(long timeout)40 public void setSendTimeout(long timeout) { 41 base.setSendTimeout(timeout); 42 } 43 44 45 @Override sendText(String text, SendHandler completion)46 public void sendText(String text, SendHandler completion) { 47 base.sendStringByCompletion(text, completion); 48 } 49 50 51 @Override sendText(String text)52 public Future<Void> sendText(String text) { 53 return base.sendStringByFuture(text); 54 } 55 56 57 @Override sendBinary(ByteBuffer data)58 public Future<Void> sendBinary(ByteBuffer data) { 59 return base.sendBytesByFuture(data); 60 } 61 62 63 @Override sendBinary(ByteBuffer data, SendHandler completion)64 public void sendBinary(ByteBuffer data, SendHandler completion) { 65 base.sendBytesByCompletion(data, completion); 66 } 67 68 69 @Override sendObject(Object obj)70 public Future<Void> sendObject(Object obj) { 71 return base.sendObjectByFuture(obj); 72 } 73 74 75 @Override sendObject(Object obj, SendHandler completion)76 public void sendObject(Object obj, SendHandler completion) { 77 base.sendObjectByCompletion(obj, completion); 78 } 79 } 80