Class WebSocketPolicy.Delegated
- java.lang.Object
-
- org.eclipse.jetty.websocket.api.WebSocketPolicy
-
- org.eclipse.jetty.websocket.api.WebSocketPolicy.Delegated
-
- Enclosing class:
- WebSocketPolicy
private class WebSocketPolicy.Delegated extends WebSocketPolicy
Allows Behavior to be changed, but the settings to delegated.This rears its ugly head when a JSR356 Server Container is used as a JSR356 Client Container. The JSR356 Server Container is Behavior SERVER, but its container level Policy is shared with the JSR356 Client Container as well. This allows a delegate to the policy with a different behavior.
-
-
Field Summary
Fields Modifier and Type Field Description private WebSocketPolicydelegated
-
Constructor Summary
Constructors Constructor Description Delegated(WebSocketPolicy policy, WebSocketBehavior behavior)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidassertValidBinaryMessageSize(int requestedSize)voidassertValidTextMessageSize(int requestedSize)WebSocketPolicyclonePolicy()Make a copy of the policy, with current values.WebSocketPolicyclonePolicy(WebSocketBehavior behavior)Make a copy of the policy, with current values, but a different behavior.WebSocketPolicydelegateAs(WebSocketBehavior behavior)longgetAsyncWriteTimeout()The timeout in ms (milliseconds) for async write operations.longgetIdleTimeout()The time in ms (milliseconds) that a websocket connection may be idle before being closed automatically.intgetInputBufferSize()The size of the input (read from network layer) buffer size.intgetMaxBinaryMessageBufferSize()Get the maximum size of a binary message buffer (for streaming writing)intgetMaxBinaryMessageSize()Get the maximum size of a binary message during parsing.intgetMaxTextMessageBufferSize()Get the maximum size of a text message buffer (for streaming writing)intgetMaxTextMessageSize()Get the maximum size of a text message during parsing.voidsetAsyncWriteTimeout(long ms)The timeout in ms (milliseconds) for async write operations.voidsetIdleTimeout(long ms)The time in ms (milliseconds) that a websocket may be idle before closing.voidsetInputBufferSize(int size)The size of the input (read from network layer) buffer size.voidsetMaxBinaryMessageBufferSize(int size)The maximum size of a binary message buffer.voidsetMaxBinaryMessageSize(int size)The maximum size of a binary message during parsing.voidsetMaxTextMessageBufferSize(int size)The maximum size of a text message buffer.voidsetMaxTextMessageSize(int size)The maximum size of a text message during parsing.-
Methods inherited from class org.eclipse.jetty.websocket.api.WebSocketPolicy
getBehavior, newClientPolicy, newServerPolicy, toString
-
-
-
-
Field Detail
-
delegated
private final WebSocketPolicy delegated
-
-
Constructor Detail
-
Delegated
public Delegated(WebSocketPolicy policy, WebSocketBehavior behavior)
-
-
Method Detail
-
assertValidBinaryMessageSize
public void assertValidBinaryMessageSize(int requestedSize)
- Overrides:
assertValidBinaryMessageSizein classWebSocketPolicy
-
assertValidTextMessageSize
public void assertValidTextMessageSize(int requestedSize)
- Overrides:
assertValidTextMessageSizein classWebSocketPolicy
-
clonePolicy
public WebSocketPolicy clonePolicy()
Description copied from class:WebSocketPolicyMake a copy of the policy, with current values.- Overrides:
clonePolicyin classWebSocketPolicy- Returns:
- the cloned copy of the policy.
-
clonePolicy
public WebSocketPolicy clonePolicy(WebSocketBehavior behavior)
Description copied from class:WebSocketPolicyMake a copy of the policy, with current values, but a different behavior.- Overrides:
clonePolicyin classWebSocketPolicy- Parameters:
behavior- the behavior to copy/clone- Returns:
- the cloned policy with a new behavior.
-
delegateAs
public WebSocketPolicy delegateAs(WebSocketBehavior behavior)
- Overrides:
delegateAsin classWebSocketPolicy
-
getAsyncWriteTimeout
public long getAsyncWriteTimeout()
Description copied from class:WebSocketPolicyThe timeout in ms (milliseconds) for async write operations.Negative values indicate a disabled timeout.
- Overrides:
getAsyncWriteTimeoutin classWebSocketPolicy- Returns:
- the timeout for async write operations. negative values indicate disabled timeout.
-
getIdleTimeout
public long getIdleTimeout()
Description copied from class:WebSocketPolicyThe time in ms (milliseconds) that a websocket connection may be idle before being closed automatically.- Overrides:
getIdleTimeoutin classWebSocketPolicy- Returns:
- the timeout in milliseconds for idle timeout.
-
getInputBufferSize
public int getInputBufferSize()
Description copied from class:WebSocketPolicyThe size of the input (read from network layer) buffer size.This is the raw read operation buffer size, before the parsing of the websocket frames.
- Overrides:
getInputBufferSizein classWebSocketPolicy- Returns:
- the raw network bytes read operation buffer size.
-
getMaxBinaryMessageBufferSize
public int getMaxBinaryMessageBufferSize()
Description copied from class:WebSocketPolicyGet the maximum size of a binary message buffer (for streaming writing)- Overrides:
getMaxBinaryMessageBufferSizein classWebSocketPolicy- Returns:
- the maximum size of a binary message buffer
-
getMaxBinaryMessageSize
public int getMaxBinaryMessageSize()
Description copied from class:WebSocketPolicyGet the maximum size of a binary message during parsing.This is a memory conservation option, memory over this limit will not be allocated by Jetty for handling binary messages. This applies to individual frames, whole message handling, and partial message handling.
Binary messages over this maximum will result in a close code 1009
StatusCode.MESSAGE_TOO_LARGE- Overrides:
getMaxBinaryMessageSizein classWebSocketPolicy- Returns:
- the maximum size of a binary message
-
getMaxTextMessageBufferSize
public int getMaxTextMessageBufferSize()
Description copied from class:WebSocketPolicyGet the maximum size of a text message buffer (for streaming writing)- Overrides:
getMaxTextMessageBufferSizein classWebSocketPolicy- Returns:
- the maximum size of a text message buffer
-
getMaxTextMessageSize
public int getMaxTextMessageSize()
Description copied from class:WebSocketPolicyGet the maximum size of a text message during parsing.This is a memory conservation option, memory over this limit will not be allocated by Jetty for handling text messages. This applies to individual frames, whole message handling, and partial message handling.
Text messages over this maximum will result in a close code 1009
StatusCode.MESSAGE_TOO_LARGE- Overrides:
getMaxTextMessageSizein classWebSocketPolicy- Returns:
- the maximum size of a text message.
-
setAsyncWriteTimeout
public void setAsyncWriteTimeout(long ms)
Description copied from class:WebSocketPolicyThe timeout in ms (milliseconds) for async write operations.Negative values indicate a disabled timeout.
- Overrides:
setAsyncWriteTimeoutin classWebSocketPolicy- Parameters:
ms- the timeout in milliseconds
-
setIdleTimeout
public void setIdleTimeout(long ms)
Description copied from class:WebSocketPolicyThe time in ms (milliseconds) that a websocket may be idle before closing.- Overrides:
setIdleTimeoutin classWebSocketPolicy- Parameters:
ms- the timeout in milliseconds
-
setInputBufferSize
public void setInputBufferSize(int size)
Description copied from class:WebSocketPolicyThe size of the input (read from network layer) buffer size.- Overrides:
setInputBufferSizein classWebSocketPolicy- Parameters:
size- the size in bytes
-
setMaxBinaryMessageBufferSize
public void setMaxBinaryMessageBufferSize(int size)
Description copied from class:WebSocketPolicyThe maximum size of a binary message buffer.Used ONLY for stream based binary message writing.
- Overrides:
setMaxBinaryMessageBufferSizein classWebSocketPolicy- Parameters:
size- the maximum size of the binary message buffer
-
setMaxBinaryMessageSize
public void setMaxBinaryMessageSize(int size)
Description copied from class:WebSocketPolicyThe maximum size of a binary message during parsing.This is a memory conservation option, memory over this limit will not be allocated by Jetty for handling binary messages. This applies to individual frames, whole message handling, and partial message handling.
Binary messages over this maximum will result in a close code 1009
StatusCode.MESSAGE_TOO_LARGE- Overrides:
setMaxBinaryMessageSizein classWebSocketPolicy- Parameters:
size- the maximum allowed size of a binary message.
-
setMaxTextMessageBufferSize
public void setMaxTextMessageBufferSize(int size)
Description copied from class:WebSocketPolicyThe maximum size of a text message buffer.Used ONLY for stream based text message writing.
- Overrides:
setMaxTextMessageBufferSizein classWebSocketPolicy- Parameters:
size- the maximum size of the text message buffer
-
setMaxTextMessageSize
public void setMaxTextMessageSize(int size)
Description copied from class:WebSocketPolicyThe maximum size of a text message during parsing.This is a memory conservation option, memory over this limit will not be allocated by Jetty for handling text messages. This applies to individual frames, whole message handling, and partial message handling.
Text messages over this maximum will result in a close code 1009
StatusCode.MESSAGE_TOO_LARGE- Overrides:
setMaxTextMessageSizein classWebSocketPolicy- Parameters:
size- the maximum allowed size of a text message.
-
-