Skip to content

Commit

Permalink
Issue #6329 Fix xml config problems (#6348)
Browse files Browse the repository at this point in the history
* Issue #6392 Review accidental xml config changes

Signed-off-by: Jan Bartel <janb@webtide.com>
  • Loading branch information
janbartel authored Jun 10, 2021
1 parent e84bdd6 commit 103e1d9
Show file tree
Hide file tree
Showing 19 changed files with 79 additions and 91 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,49 +10,26 @@
<Call name="addBean">
<Arg>
<New id="sessionDataStoreFactory" class="org.eclipse.jetty.gcloud.session.GCloudSessionDataStoreFactory">
<Set name="gracePeriodSec"><Property name="jetty.session.gracePeriod.seconds" default="3600" /></Set>
<Set name="gracePeriodSec" property="jetty.session.gracePeriod.seconds"/>
<Set name="savePeriodSec" property="jetty.session.savePeriod.seconds"/>
<Set name="maxRetries"><Property name="jetty.session.gcloud.maxRetries" default="5"/></Set>
<Set name="maxRetries" property="jetty.session.gcloud.maxRetries"/>
<Set name="backoffMs" property="jetty.session.gcloud.backoffMs"/>
<Set name="namespace" property="jetty.session.gcloud.namespace"/>
<Set name="namespace" property="jetty.session.gcloud.namespace"/>
<Set name="entityDataModel">
<New class="org.eclipse.jetty.gcloud.session.GCloudSessionDataStore$EntityDataModel">
<Set name="kind">
<Property name="jetty.session.gcloud.model.kind" default="GCloudSession" />
</Set>
<Set name="id">
<Property name="jetty.session.gcloud.model.id" default="id" />
</Set>
<Set name="contextPath">
<Property name="jetty.session.gcloud.model.contextPath" default="contextPath" />
</Set>
<Set name="vhost">
<Property name="jetty.session.gcloud.model.vhost" default="vhost" />
</Set>
<Set name="accessed">
<Property name="jetty.session.gcloud.model.accessed" default="accessed" />
</Set>
<Set name="lastAccessed">
<Property name="jetty.session.gcloud.model.lastAccessed" default="lastAccessed" />
</Set>
<Set name="createTime">
<Property name="jetty.session.gcloud.model.createTime" default="createTime" />
</Set>
<Set name="cookieSetTime">
<Property name="jetty.session.gcloud.model.cookieSetTime" default="cookieSetTime" />
</Set>
<Set name="lastNode">
<Property name="jetty.session.gcloud.model.lastNode" default="lastNode" />
</Set>
<Set name="expiry">
<Property name="jetty.session.gcloud.model.expiry" default="expiry" />
</Set>
<Set name="maxInactive">
<Property name="jetty.session.gcloud.model.maxInactive" default="maxInactive" />
</Set>
<Set name="attributes">
<Property name="jetty.session.gcloud.model.attributes" default="attributes" />
</Set>
<Set name="kind" property="jetty.session.gcloud.model.kind"/>
<Set name="id" property="jetty.session.gcloud.model.id"/>
<Set name="contextPath" property="jetty.session.gcloud.model.contextPath"/>
<Set name="vhost" property="jetty.session.gcloud.model.vhost"/>
<Set name="accessed" property="jetty.session.gcloud.model.accessed"/>
<Set name="lastAccessed" property="jetty.session.gcloud.model.lastAccessed"/>
<Set name="createTime" property="jetty.session.gcloud.model.createTime"/>
<Set name="cookieSetTime" property="jetty.session.gcloud.model.cookieSetTime"/>
<Set name="lastNode" property="jetty.session.gcloud.model.lastNode"/>
<Set name="lastSaved" property="jetty.session.gcloud.model.lastSaved"/>
<Set name="expiry" property="jetty.session.gcloud.model.expiry"/>
<Set name="maxInactive" property="jetty.session.gcloud.model.maxInactive"/>
<Set name="attributes" property="jetty.session.gcloud.model.attributes"/>
</New>
</Set>
</New>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ etc/sessions/gcloud/session-store.xml
#jetty.session.gcloud.model.createTime=createTime
#jetty.session.gcloud.model.cookieSetTime=cookieSetTime
#jetty.session.gcloud.model.lastNode=lastNode
#jetty.session.gcloud.model.lastSaved=lastSaved
#jetty.session.gcloud.model.expiry=expiry
#jetty.session.gcloud.model.maxInactive=maxInactive
#jetty.session.gcloud.model.attributes=attributes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public class GCloudSessionDataStore extends AbstractSessionDataStore
public static final int DEFAULT_MAX_QUERY_RESULTS = 100;
public static final int DEFAULT_MAX_RETRIES = 5;
public static final int DEFAULT_BACKOFF_MS = 1000;
public static final String DEFAULT_NAMESPACE = "";

protected Datastore _datastore;
protected KeyFactory _keyFactory;
Expand All @@ -65,7 +66,7 @@ public class GCloudSessionDataStore extends AbstractSessionDataStore
protected boolean _indexesPresent = false;
protected EntityDataModel _model;
protected boolean _modelProvided;
private String _namespace;
private String _namespace = DEFAULT_NAMESPACE;

/**
* EntityDataModel
Expand Down Expand Up @@ -431,7 +432,7 @@ public void setNamespace(String namespace)
_namespace = namespace;
}

@ManagedAttribute(value = "gclound namespace", readonly = true)
@ManagedAttribute(value = "gcloud namespace", readonly = true)
public String getNamespace()
{
return _namespace;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
*/
public class GCloudSessionDataStoreFactory extends AbstractSessionDataStoreFactory
{
private String _namespace;
private int _maxRetries;
private int _backoffMs;
private String _namespace = GCloudSessionDataStore.DEFAULT_NAMESPACE;
private int _maxRetries = GCloudSessionDataStore.DEFAULT_MAX_RETRIES;
private int _backoffMs = GCloudSessionDataStore.DEFAULT_BACKOFF_MS;
private GCloudSessionDataStore.EntityDataModel _model;

public GCloudSessionDataStore.EntityDataModel getEntityDataModel()
Expand Down Expand Up @@ -80,8 +80,9 @@ public SessionDataStore getSessionDataStore(SessionHandler handler) throws Excep
ds.setBackoffMs(getBackoffMs());
ds.setMaxRetries(getMaxRetries());
ds.setGracePeriodSec(getGracePeriodSec());
ds.setNamespace(_namespace);
ds.setNamespace(getNamespace());
ds.setSavePeriodSec(getSavePeriodSec());
ds.setEntityDataModel(getEntityDataModel());
return ds;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<Set name="mapName" property="jetty.session.hazelcast.mapName"/>
<Set name="hazelcastInstanceName" property="jetty.session.hazelcast.hazelcastInstanceName"/>
<Set name="useQueries" property="jetty.session.hazelcast.useQueries"/>
<Set name="gracePeriodSec"><Property name="jetty.session.gracePeriod.seconds" default="3600" /></Set>
<Set name="savePeriodSec"><Property name="jetty.session.savePeriod.seconds" default="0" /></Set>
<Set name="gracePeriodSec" property="jetty.session.gracePeriod.seconds"/>
<Set name="savePeriodSec" property="jetty.session.savePeriod.seconds"/>
<Set name="configurationLocation"><Property name="jetty.session.hazelcast.configurationLocation" default="" /></Set>
</New>
</Arg>
Expand Down
20 changes: 5 additions & 15 deletions jetty-hazelcast/src/main/config/etc/sessions/hazelcast/remote.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,11 @@
<Call name="addBean">
<Arg>
<New id="sessionDataStoreFactory" class="org.eclipse.jetty.hazelcast.session.HazelcastSessionDataStoreFactory">
<Set name="mapName">
<Property name="jetty.session.hazelcast.mapName" default="jetty-distributed-session-map" />
</Set>
<Set name="hazelcastInstanceName">
<Property name="jetty.session.hazelcast.hazelcastInstanceName" default="JETTY_DISTRIBUTED_SESSION_INSTANCE" />
</Set>
<Set name="useQueries">
<Property name="jetty.session.hazelcast.useQueries" default="false" />
</Set>
<Set name="gracePeriodSec">
<Property name="jetty.session.gracePeriod.seconds" default="3600" />
</Set>
<Set name="savePeriodSec">
<Property name="jetty.session.savePeriod.seconds" default="0" />
</Set>
<Set name="mapName" property="jetty.session.hazelcast.mapName"/>
<Set name="hazelcastInstanceName" property="jetty.session.hazelcast.hazelcastInstanceName"/>
<Set name="useQueries" property="jetty.session.hazelcast.useQueries"/>
<Set name="gracePeriodSec" property="jetty.session.gracePeriod.seconds"/>
<Set name="savePeriodSec" property="jetty.session.savePeriod.seconds"/>
<Set name="onlyClient">
<Property name="jetty.session.hazelcast.onlyClient" default="true" />
</Set>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<Set name="maxConcurrentStreams" property="jetty.http2c.maxConcurrentStreams"/>
<Set name="initialStreamRecvWindow" property="jetty.http2c.initialStreamRecvWindow"/>
<Set name="initialSessionRecvWindow" property="jetty.http2.initialSessionRecvWindow"/>
<Set name="maxSettingsKeys"><Property name="jetty.http2.maxSettingsKeys" default="64"/></Set>
<Set name="maxSettingsKeys" property="jetty.http2.maxSettingsKeys"/>
<Set name="rateControlFactory">
<New class="org.eclipse.jetty.http2.parser.WindowRateControl$Factory">
<Arg type="int"><Property name="jetty.http2.rateControl.maxEventsPerSecond" default="20"/></Arg>
Expand Down
6 changes: 3 additions & 3 deletions jetty-http2/http2-server/src/main/config/modules/http2c.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ etc/jetty-http2c.xml
[ini-template]
# tag::documentation[]
## Specifies the maximum number of concurrent requests per session.
# jetty.http2c.maxConcurrentStreams=1024
# jetty.http2c.maxConcurrentStreams=128
## Specifies the initial stream receive window (client to server) in bytes.
# jetty.http2c.initialStreamRecvWindow=65535
# jetty.http2c.initialStreamRecvWindow=524288
## Specifies the initial session receive window (client to server) in bytes.
# jetty.http2.initialSessionRecvWindow=1048576
# jetty.http2.initialSessionRecvWindow=1232896
## Specifies the maximum number of keys in all SETTINGS frames received by a session.
# jetty.http2.maxSettingsKeys=64
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<New id="Rewrite" class="org.eclipse.jetty.rewrite.RewriteCustomizer">
<Set name="rewriteRequestURI" property="jetty.rewrite.rewriteRequestURI"/>
<Set name="rewritePathInfo" property="jetty.rewrite.rewritePathInfo"/>
<Set name="originalPathAttribute" property="jetty.rewrite.originalPathAttribute"/>
<Set name="originalPathAttribute"><Property name="jetty.rewrite.originalPathAttribute" default="requestedPath"/></Set>
</New>
</Arg>
</Call>
Expand Down
2 changes: 1 addition & 1 deletion jetty-rewrite/src/main/config/etc/jetty-rewrite.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<New class="org.eclipse.jetty.rewrite.handler.RewriteHandler">
<Set name="rewriteRequestURI" property="jetty.rewrite.rewriteRequestURI" />
<Set name="rewritePathInfo" property="jetty.rewrite.rewritePathInfo" />
<Set name="originalPathAttribute" property="jetty.rewrite.originalPathAttribute" />
<Set name="originalPathAttribute"><Property name="jetty.rewrite.originalPathAttribute" default="requestedPath"/></Set>

<!-- Set DispatcherTypes -->
<Set name="dispatcherTypes">
Expand Down
17 changes: 13 additions & 4 deletions jetty-server/src/main/config/etc/jetty-gzip.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@
<Arg>
<New id="GzipHandler" class="org.eclipse.jetty.server.handler.gzip.GzipHandler">
<Set name="minGzipSize" property="jetty.gzip.minGzipSize"/>
<Set name="checkGzExists" property="jetty.gzip.checkGzExists"/>
<Set name="compressionLevel" property="jetty.gzip.compressionLevel"/>
<Set name="inflateBufferSize" property="jetty.gzip.inflateBufferSize"/>
<Set name="inflaterPoolCapacity" property="jetty.gzip.inflaterPoolCapacity"/>
<Set name="deflaterPoolCapacity" property="jetty.gzip.deflaterPoolCapacity"/>
<Set name="syncFlush" property="jetty.gzip.syncFlush"/>
<Set name="dispatcherTypes" property="jetty.gzip.dispatcherTypes"/>
<Set name="includedMethodList" property="jetty.gzip.includedMethodList"/>
Expand All @@ -26,6 +22,19 @@
<Set name="excludedMimeTypes" property="jetty.gzip.excludedMimeTypeList"/>
<Set name="includedPaths" property="jetty.gzip.includedPathList"/>
<Set name="excludedPaths" property="jetty.gzip.excludedPathList"/>
<Set name="inflaterPool">
<New class="org.eclipse.jetty.util.compression.InflaterPool">
<Arg type="int"><Property name="jetty.gzip.inflaterPool.capacity" deprecated="jetty.gzip.inflaterPoolCapacity" default="1024"/></Arg>
<Arg type="boolean"><Property name="jetty.gzip.inflaterPool.noWrap" default="true"/></Arg>
</New>
</Set>
<Set name="deflaterPool">
<New class="org.eclipse.jetty.util.compression.DeflaterPool">
<Arg type="int"><Property name="jetty.gzip.deflaterPool.capacity" deprecated="jetty.gzip.deflaterPoolCapacity" default="1024"/></Arg>
<Arg type="int"><Property name="jetty.gzip.deflaterPool.compressionLevel" deprecated="jetty.gzip.compressionLevel" default="-1"/></Arg>
<Arg type="boolean"><Property name="jetty.gzip.deflaterPool.noWrap" default="true"/></Arg>
</New>
</Set>

<!--
<Set name="includedMethods">
Expand Down
2 changes: 1 addition & 1 deletion jetty-server/src/main/config/etc/jetty-threadlimit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<Arg>
<New id="ThreadLimitHandler" class="org.eclipse.jetty.server.handler.ThreadLimitHandler">
<Arg name="forwardedHeader"><Property name="jetty.threadlimit.forwardedHeader"/></Arg>
<Set name="enabled" property="jetty.threadlimit.enabled"/>
<Set name="enabled"><Property name="jetty.threadlimit.enabled" default="true"/></Set>
<Set name="threadLimit" property="jetty.threadlimit.threadLimit"/>
</New>
</Arg>
Expand Down
4 changes: 2 additions & 2 deletions jetty-server/src/main/config/etc/jetty.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<Set name="requestHeaderSize" property="jetty.httpConfig.requestHeaderSize"/>
<Set name="responseHeaderSize" property="jetty.httpConfig.responseHeaderSize"/>
<Set name="sendServerVersion" property="jetty.httpConfig.sendServerVersion"/>
<Set name="sendDateHeader" property="jetty.httpConfig.sendDateHeader"/>
<Set name="sendDateHeader"><Property name="jetty.httpConfig.sendDateHeader" default="false"/></Set>
<Set name="headerCacheSize" property="jetty.httpConfig.headerCacheSize"/>
<Set name="delayDispatchUntilContent" property="jetty.httpConfig.delayDispatchUntilContent"/>
<Set name="maxErrorDispatches" property="jetty.httpConfig.maxErrorDispatches"/>
Expand Down Expand Up @@ -105,7 +105,7 @@
<!-- =========================================================== -->
<!-- extra server options -->
<!-- =========================================================== -->
<Set name="stopAtShutdown" property="jetty.server.stopAtShutdown"/>
<Set name="stopAtShutdown"><Property name="jetty.server.stopAtShutdown" default="true"/></Set>
<Set name="stopTimeout"><Property name="jetty.server.stopTimeout" default="5000"/></Set>
<Set name="dumpAfterStart" property="jetty.server.dumpAfterStart"/>
<Set name="dumpBeforeStop" property="jetty.server.dumpBeforeStop"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<Call name="addBean">
<Arg>
<New id="sessionDataStoreFactory" class="org.eclipse.jetty.server.session.JDBCSessionDataStoreFactory">
<Set name="gracePeriodSec"><Property name="jetty.session.gracePeriod.seconds" default="3600" /></Set>
<Set name="savePeriodSec"><Property name="jetty.session.savePeriod.seconds" default="0" /></Set>
<Set name="gracePeriodSec" property="jetty.session.gracePeriod.seconds"/>
<Set name="savePeriodSec" property="jetty.session.savePeriod.seconds"/>
<Set name="databaseAdaptor">
<Ref refid="databaseAdaptor" />
</Set>
Expand Down
18 changes: 12 additions & 6 deletions jetty-server/src/main/config/modules/gzip.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,23 @@ etc/jetty-gzip.xml
## Check whether a file with *.gz extension exists
# jetty.gzip.checkGzExists=false

## Gzip compression level (-1 for default)
# jetty.gzip.compressionLevel=-1

## Inflate request buffer size, or 0 for no request inflation
# jetty.gzip.inflateBufferSize=0

## Inflater pool max size (-1 for unlimited, 0 for no pooling)
# jetty.gzip.inflaterPool.capacity=1024

## Inflater pool use GZIP compatible compression
#jetty.gzip.inflaterPool.noWrap=true

## Deflater pool max size (-1 for unlimited, 0 for no pooling)
# jetty.gzip.deflaterPoolCapacity=-1
# jetty.gzip.deflaterPool.capacity=1024

## Inflater pool max size (-1 for unlimited, 0 for no pooling)
# jetty.gzip.inflaterPoolCapacity=-1
## Gzip compression level (-1 for default)
# jetty.gzip.deflaterPool.compressionLevel=-1

## Deflater pool use GZIP compatible compression
# jetty.gzip.deflaterPool.noWrap=true

## Set the {@link Deflater} flush mode to use.
# jetty.gzip.syncFlush=false
Expand Down
4 changes: 2 additions & 2 deletions jetty-server/src/main/config/modules/server.mod
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ etc/jetty.xml
## HTTP Compliance: RFC7230, RFC7230_LEGACY, RFC2616, RFC2616_LEGACY, LEGACY
# jetty.httpConfig.compliance=RFC7230

## URI Compliance: SAFE, STRICT
# jetty.httpConfig.uriCompliance=SAFE
## URI Compliance: DEFAULT, LEGACY, RFC3986, UNSAFE
# jetty.httpConfig.uriCompliance=DEFAULT

## Cookie compliance mode for parsing request Cookie headers: RFC2965, RFC6265
# jetty.httpConfig.requestCookieCompliance=RFC6265
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,15 @@
public abstract class AbstractSessionDataStore extends ContainerLifeCycle implements SessionDataStore
{
private static final Logger LOG = LoggerFactory.getLogger(AbstractSessionDataStore.class);

public static final int DEFAULT_GRACE_PERIOD_SEC = 60 * 60; //default of 1hr
public static final int DEFAULT_SAVE_PERIOD_SEC = 0;

protected SessionContext _context; //context associated with this session data store
protected int _gracePeriodSec = 60 * 60; //default of 1hr
protected int _gracePeriodSec = DEFAULT_GRACE_PERIOD_SEC;
protected long _lastExpiryCheckTime = 0; //last time in ms that getExpired was called
protected long _lastOrphanSweepTime = 0; //last time in ms that we deleted orphaned sessions
protected int _savePeriodSec = 0; //time in sec between saves
protected int _savePeriodSec = DEFAULT_SAVE_PERIOD_SEC; //time in sec between saves

/**
* Small utility class to allow us to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
public abstract class AbstractSessionDataStoreFactory implements SessionDataStoreFactory
{

int _gracePeriodSec;
int _savePeriodSec;
int _gracePeriodSec = AbstractSessionDataStore.DEFAULT_GRACE_PERIOD_SEC;
int _savePeriodSec = AbstractSessionDataStore.DEFAULT_SAVE_PERIOD_SEC;

/**
* @return the gracePeriodSec
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ etc/jetty-unixsocket-http2c.xml
[ini-template]
## Max number of concurrent streams per connection
# jetty.http2.maxConcurrentStreams=1024
# jetty.http2.maxConcurrentStreams=128
## Initial stream receive window (client to server)
# jetty.http2.initialStreamRecvWindow=65535
# jetty.http2.initialStreamRecvWindow=524288

0 comments on commit 103e1d9

Please sign in to comment.