Top Inners Fields Constructors Methods
org.apache.tomcat.websocket

public abstract Class WsRemoteEndpointImplBase

extends Object
implements RemoteEndpoint
Class Inheritance
All Implemented Interfaces
jakarta.websocket.RemoteEndpoint
Known Direct Subclasses
org.apache.tomcat.websocket.WsRemoteEndpointImplClient, org.apache.tomcat.websocket.server.WsRemoteEndpointImplServer
Imports
java.io.IOException, .OutputStream, .Writer, java.lang.reflect.InvocationTargetException, java.net.SocketTimeoutException, java.nio.ByteBuffer, .CharBuffer, java.nio.charset.CharsetEncoder, .CoderResult, java.util.ArrayDeque, .ArrayList, .List, .Queue, java.util.concurrent.Future, .Semaphore, .TimeUnit, java.util.concurrent.atomic.AtomicBoolean, java.util.concurrent.locks.Lock, javax.naming.NamingException, jakarta.websocket.CloseReason, .CloseReason.CloseCodes, .DeploymentException, .EncodeException, .Encoder, .EndpointConfig, .RemoteEndpoint, .SendHandler, .SendResult, org.apache.juli.logging.Log, .LogFactory, org.apache.tomcat.InstanceManager, org.apache.tomcat.util.ExceptionUtils, org.apache.tomcat.util.buf.Utf8Encoder, org.apache.tomcat.util.res.StringManager

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class
private static class
WsRemoteEndpointImplBase.EndMessageHandler

Wraps the user provided handler so that the end point is notified when the message is complete.

private static class
WsRemoteEndpointImplBase.IntermediateMessageHandler

If a transformation needs to split a MessagePart into multiple MessageParts, it uses this handler as the end handler for each of the additional MessageParts.

private static class
WsRemoteEndpointImplBase.OutputBufferFlushSendHandler

Ensures that the output buffer is cleared after it has been flushed.

private static class
WsRemoteEndpointImplBase.OutputBufferSendHandler

Used to write data to the output buffer, flushing the buffer if it fills up.

private static enum
private static class
private static class
private class
private static class
private static class

Field Summary

Modifier and TypeField and Description
private final AtomicBoolean
private volatile boolean
private final CharsetEncoder
private final ByteBuffer
private List<WsRemoteEndpointImplBase.EncoderEntry>
private boolean
private final ByteBuffer
private final WsRemoteEndpointImplBase.IntermediateMessageHandler
private final Log
protected final Semaphore
private final Object
private final Queue<MessagePart>
private boolean
private boolean
private final ByteBuffer
protected static final SendResult
private volatile long
protected static final StringManager
private final WsRemoteEndpointImplBase.StateMachine
private boolean
private Transformation
private WsSession

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected boolean

Returns:

true if the semaphore is obtained, otherwise false.
acquireMessagePartInProgressSemaphore
(byte
The OPCODE for the message to be written
opCode
,
long
The time when the attempt to acquire the semaphore should expire
timeoutExpiry
)

Acquire the semaphore that allows a message part to be written.

public final void
protected abstract void
protected abstract void
doWrite(SendHandler handler, long blockingWriteTimeoutExpiry, ByteBuffer... data)

pack-priv void
private Encoder
public void
flushBatch()

Implements jakarta.websocket.RemoteEndpoint.flushBatch.

Flush any currently batched messages to the remote endpoint.

public boolean
getBatchingAllowed()

Implements jakarta.websocket.RemoteEndpoint.getBatchingAllowed.

Obtains the current batching status of the endpoint.

private long
protected abstract Lock
public OutputStream
public long
public Writer
private long
protected abstract boolean
public void
public void
public Future<Void>
pack-priv void
sendMessageBlock(CharBuffer part, boolean last)

pack-priv void
sendMessageBlock(byte opCode, ByteBuffer payload, boolean last)

private void
sendMessageBlock(byte opCode, ByteBuffer payload, boolean last, long timeoutExpiry)

public void
public void
public Future<Void>
public void
sendPartialBytes(ByteBuffer partialByte, boolean last)

public void
sendPartialString(String fragment, boolean isLast)

public void
sendPing(ByteBuffer
The payload for the ping message
applicationData
)

Implements jakarta.websocket.RemoteEndpoint.sendPing.

Send a ping message blocking until the message has been sent.

public void
sendPong(ByteBuffer
The payload for the pong message
applicationData
)

Implements jakarta.websocket.RemoteEndpoint.sendPong.

Send a pong message blocking until the message has been sent.

public void
public void
public Future<Void>
public void
setBatchingAllowed(boolean
New setting
batchingAllowed
)

Implements jakarta.websocket.RemoteEndpoint.setBatchingAllowed.

Enable or disable the batching of outgoing messages for this endpoint.

protected void
setEncoders(EndpointConfig endpointConfig)

public void
setSendTimeout(long timeout)

protected void
setSession(WsSession wsSession)

protected void
pack-priv void
startMessage(byte opCode, ByteBuffer payload, boolean last, SendHandler handler)

protected void
updateStats(long
Size of message payload
payloadLength
)

Hook for updating server side statistics.

private static void
writeHeader(ByteBuffer headerBuffer, boolean fin, int rsv, byte opCode, boolean masked, ByteBuffer payload, byte[] mask, boolean first)

pack-priv void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait