combine ConfigurationHolder and ConfigurationCustomizer

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
Lachlan Roberts 2020-01-22 18:15:59 +11:00
parent f35a01c73c
commit bc88224f19
3 changed files with 11 additions and 15 deletions

View File

@ -79,16 +79,16 @@ public interface Configuration
void customize(Configuration configurable);
}
class ConfigurationHolder implements Configuration
class ConfigurationCustomizer implements Configuration, Customizer
{
protected Duration idleTimeout;
protected Duration writeTimeout;
protected Boolean autoFragment;
protected Long maxFrameSize;
protected Integer outputBufferSize;
protected Integer inputBufferSize;
protected Long maxBinaryMessageSize;
protected Long maxTextMessageSize;
private Duration idleTimeout;
private Duration writeTimeout;
private Boolean autoFragment;
private Long maxFrameSize;
private Integer outputBufferSize;
private Integer inputBufferSize;
private Long maxBinaryMessageSize;
private Long maxTextMessageSize;
@Override
public Duration getIdleTimeout()
@ -185,10 +185,7 @@ public interface Configuration
{
this.maxTextMessageSize = maxTextMessageSize;
}
}
class ConfigurationCustomizer extends ConfigurationHolder implements Customizer
{
@Override
public void customize(Configuration configurable)
{

View File

@ -35,7 +35,7 @@ public class FragmentExtension extends AbstractExtension
private static final Logger LOG = Log.getLogger(FragmentExtension.class);
private final FragmentingFlusher flusher;
private final Configuration configuration = new Configuration.ConfigurationHolder();
private final Configuration configuration = new Configuration.ConfigurationCustomizer();
public FragmentExtension()
{

View File

@ -28,7 +28,6 @@ import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
import org.eclipse.jetty.websocket.core.CloseStatus;
import org.eclipse.jetty.websocket.core.Configuration;
import org.eclipse.jetty.websocket.core.Configuration.ConfigurationHolder;
import org.eclipse.jetty.websocket.core.Frame;
import org.eclipse.jetty.websocket.core.OpCode;
import org.eclipse.jetty.websocket.core.exception.MessageTooLargeException;
@ -65,7 +64,7 @@ public class Parser
public Parser(ByteBufferPool bufferPool)
{
this(bufferPool, new ConfigurationHolder());
this(bufferPool, new Configuration.ConfigurationCustomizer());
}
public Parser(ByteBufferPool bufferPool, Configuration configuration)