Merged branch 'jetty-9.4.x' into 'master'.

This commit is contained in:
Simone Bordet 2016-10-17 15:36:32 +02:00
commit 39f47244fa
31 changed files with 195 additions and 91 deletions

View File

@ -1,5 +1,16 @@
#!/usr/bin/env bash
#
# LSB Tags
### BEGIN INIT INFO
# Provides: jetty
# Required-Start: $local_fs $network
# Required-Stop: $local_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Jetty start script.
# Description: Start Jetty web server.
### END INIT INFO
# Startup script for jetty under *nix systems (it works under NT/cygwin too).
##################################################

View File

@ -7,12 +7,12 @@ gcloud
[depends]
gcloud
jcl-api
jcl-impl
jcl-slf4j
slf4j-impl
[files]
maven://com.google.cloud/google-cloud-datastore/0.3.0|lib/gcloud/google-cloud-datastore-0.3.0.jar
maven://com.google.cloud/google-cloud-core/0.3.0|lib/gcloud/google-cloud-core-0.3.0.jar
maven://com.google.cloud/google-cloud-datastore/0.4.0|lib/gcloud/google-cloud-datastore-0.4.0.jar
maven://com.google.cloud/google-cloud-core/0.4.0|lib/gcloud/google-cloud-core-0.4.0.jar
maven://com.google.auth/google-auth-library-credentials/0.3.1|lib/gcloud/google-auth-library-credentials-0.3.1.jar
maven://com.google.auth/google-auth-library-oauth2-http/0.3.1|lib/gcloud/google-auth-library-oauth2-http-0.3.1.jar
maven://com.google.http-client/google-http-client-jackson2/1.19.0|lib/gcloud/google-http-client-jackson2-1.19.0.jar
@ -35,38 +35,41 @@ maven://com.google.http-client/google-http-client-appengine/1.21.0|lib/gcloud/go
maven://com.google.http-client/google-http-client-jackson/1.21.0|lib/gcloud/google-http-client-jackson-1.21.0.jar
maven://org.codehaus.jackson/jackson-core-asl/1.9.11|lib/gcloud/jackson-core-asl-1.9.11.jar
maven://joda-time/joda-time/2.9.2|lib/gcloud/joda-time-2.9.2.jar
maven://com.google.protobuf/protobuf-java/3.0.0-beta-3|lib/gcloud/protobuf-java-3.0.0-beta-3.jar
maven://com.google.api/gax/0.0.16|lib/gcloud/gax-0.0.16.jar
maven://io.grpc/grpc-all/0.15.0|lib/gcloud/grpc-all-0.15.0.jar
maven://io.grpc/grpc-auth/0.15.0|lib/gcloud/grpc-auth-0.15.0.jar
maven://io.grpc/grpc-netty/0.15.0|lib/gcloud/grpc-netty-0.15.0.jar
maven://io.netty/netty-codec-http2/4.1.1.Final|lib/gcloud/netty-codec-http2-4.1.1.jar
maven://io.netty/netty-codec-http/4.1.1.Final|lib/gcloud/netty-codec-http-4.1.1.Final.jar
maven://io.netty/netty-codec/4.1.1.Final|lib/gcloud/netty-codec-4.1.1.Final.jar
maven://io.netty/netty-handler/4.1.1.Final|lib/gcloud/netty-handler-4.1.1.Final.jar
maven://io.netty/netty-buffer/4.1.1.Final|lib/gcloud/netty-buffer-4.1.1.Final.jar
maven://io.netty/netty-common/4.1.1.Final|lib/gcloud/netty-common-4.1.1.Final.jar
maven://io.netty/netty-transport/4.1.1.Final|lib/gcloud/netty-transport-4.1.1.Final.jar
maven://io.netty/netty-resolver/4.1.1.Final|lib/gcloud/netty-resolver-4.1.1.Final.jar
maven://io.grpc/grpc-okhttp/0.15.0|lib/gcloud/grpc-okhttp-0.15.0.jar
maven://org.json/json/20151123|lib/gcloud/json-20151123.jar
maven://com.google.protobuf/protobuf-java/3.0.0|lib/gcloud/protobuf-java-3.0.0.jar
maven://com.google.api/gax/0.0.18|lib/gcloud/gax-0.0.18.jar
maven://com.google.auto.value/auto-value/1.1|lib/gcloud/auto-value-1.1.jar
maven://io.grpc/grpc-all/1.0.1|lib/gcloud/grpc-all-1.0.1.jar
maven://io.grpc/grpc-auth/1.0.1|lib/gcloud/grpc-auth-1.0.1.jar
maven://io.grpc/grpc-context/1.0.1|lib/gcloud/grpc-context-1.0.1.jar
maven://io.grpc/grpc-protobuf/1.0.1|lib/gcloud/grpc-protobuf-1.0.1.jar
maven://com.google.protobuf/protobuf-java-util/3.0.0|lib/gcloud/protobuf-java-util-3.0.0.jar
maven://com.google.code.gson/gson/2.3|lib/gcloud/gson-2.3.jar
maven://io.grpc/grpc-netty/1.0.1|lib/gcloud/grpc-netty-1.0.1.jar
maven://io.netty/netty-codec-http2/4.1.3.Final|lib/gcloud/netty-codec-http2-4.1.3.jar
maven://io.netty/netty-codec-http/4.1.3.Final|lib/gcloud/netty-codec-http-4.1.3.Final.jar
maven://io.netty/netty-codec/4.1.3.Final|lib/gcloud/netty-codec-4.1.3.Final.jar
maven://io.netty/netty-handler/4.1.3.Final|lib/gcloud/netty-handler-4.1.3.Final.jar
maven://io.netty/netty-buffer/4.1.3.Final|lib/gcloud/netty-buffer-4.1.3.Final.jar
maven://io.netty/netty-common/4.1.3.Final|lib/gcloud/netty-common-4.1.3.Final.jar
maven://io.netty/netty-transport/4.1.3.Final|lib/gcloud/netty-transport-4.1.3.Final.jar
maven://io.netty/netty-resolver/4.1.3.Final|lib/gcloud/netty-resolver-4.1.3.Final.jar
maven://io.grpc/grpc-stub/1.0.1|lib/gcloud/grpc-stub-1.0.1.jar
maven://io.grpc/grpc-protobuf-nano/1.0.1|lib/gcloud/grpc-protobuf-nano-1.0.1.jar
maven://com.google.protobuf.nano/protobuf-javanano/3.0.0-alpha-5|lib/gcloud/protobuf-javanano/3.0.0-alpha-5.jar
maven://io.grpc/grpc-core/1.0.1|lib/gcloud/grpc-core-1.0.1.jar
maven://io.grpc/grpc-okhttp/1.0.1|lib/gcloud/grpc-okhttp-1.0.1.jar
maven://com.squareup.okio/okio/1.6.0|lib/gcloud/okio-1.6.0.jar
maven://com.squareup.okhttp/okhttp/2.5.0|lib/gcloud/okhttp-2.5.0.jar
maven://io.grpc/grpc-protobuf-nano/0.15.0|lib/gcloud/grpc-protobuf-nano-0.15.0.jar
maven://com.google.protobuf.nano/protobuf-javanano/3.0.0-alpha-5|lib/gcloud/protobuf-javanano-3.0.0-alpha-5.jar
maven://io.grpc/grpc-stub/0.15.0|lib/gcloud/grpc-stub-0.15.0.jar
maven://io.grpc/grpc-protobuf/0.15.0|lib/gcloud/grpc-protobuf-0.15.0.jar
maven://com.google.protobuf/protobuf-java-util/3.0.0-beta-3|lib/gcloud/protobuf-java-util-3.0.0-beta-3.jar
maven://com.google.code.gson/gson/2.3|lib/gcloud/gson-2.3.jar
maven://io.grpc/grpc-protobuf-lite/0.15.0|lib/gcloud/grpc-protobuf-lite-0.15.0.jar
maven://io.grpc/grpc-core/0.15.0|lib/gcloud/grpc-core-0.15.0.jar
maven://com.google.auto.value/auto-value/1.1|lib/gcloud/auto-value-1.1.jar
maven://io.grpc/grpc-protobuf-lite/1.0.1|lib/gcloud/grpc-protobuf-lite-1.0.1.jar
maven://com.google.protobuf/protobuf-lite/3.0.1|lib/gcloud/protobuf-lite-3.0.1.jar
maven://com.google.inject/guice/4.0|lib/gcloud/guice-4.0.jar
maven://javax.inject/javax.inject/1|lib/gcloud/javax.inject-1.jar
maven://aopalliance/aopalliance/1.0|lib/gcloud/aopalliance-1.0.jar
maven://com.google.api.grpc/grpc-google-common-protos/0.0.7|lib/gcloud/grpc-google-common-protos-0.0.7.jar
maven://org.json/json/20151123|lib/gcloud/json-20151123.jar
maven://com.google.cloud.datastore/datastore-v1-protos/1.0.1|lib/gcloud/datastore-v1-protos-1.0.1-beta.jar
maven://com.google.cloud.datastore/datastore-v1-proto-client/1.1.0|lib/gcloud/datastore-v1-proto-client-1.1.0.jar
maven://com.google.api.grpc/grpc-google-common-protos/0.1.0|lib/gcloud/grpc-google-common-protos-0.1.0.jar
maven://com.google.api.grpc/grpc-google-iam-v1/0.1.0|lib/gcloud/grpc-google-iam-v1-0.1.0.jar
maven://com.google.cloud.datastore/datastore-v1-protos/1.2.0|lib/gcloud/datastore-v1-protos-1.2.0.jar
maven://com.google.cloud.datastore/datastore-v1-proto-client/1.2.0|lib/gcloud/datastore-v1-proto-client-1.2.0.jar
maven://com.google.http-client/google-http-client-protobuf/1.20.0|lib/gcloud/google-http-client-protobuf-1.20.0.jar
maven://com.google.api-client/google-api-client/1.20.0|lib/gcloud/google-api-client-1.20.0.jar
maven://com.google.guava/guava-jdk5/13.0|lib/gcloud/guava-jdk5-13.0.jar
maven://com.google.api-client/google-api-client/1.20.0|lib/gcloud/google-api-client/1.20.0

View File

@ -15,4 +15,4 @@ http://www.apache.org/licenses/LICENSE-2.0.html
[ini-template]
## Hide the gcloud libraries from deployed webapps
jetty.webapp.addServerClasses,=file:${jetty.base}/lib/gcloud/
jetty.webapp.addServerClasses+=,file:${jetty.base}/lib/gcloud/

View File

@ -0,0 +1,8 @@
gcloud-memcached-sessions : replaced by 'session-store-cache,session-store-gcloud'
gcloud-session-idmgr : no longer required.
gcloud-sessions : replaced by 'session-store-gcloud'
infinispan : replaced by either 'session-store-infinispan-embedded' or 'session-store-infinispan-remote'
jdbc-sessions : replaced by 'session-store-jdbc'
logging : renamed to 'stderrout-capture'
monitor : no longer supported
nosql : replaced by 'session-store-mongo'

View File

@ -18,6 +18,7 @@
package org.eclipse.jetty.http;
/* ------------------------------------------------------------ */
public class CompressedContentFormat
{
@ -25,7 +26,6 @@ public class CompressedContentFormat
public static final CompressedContentFormat BR = new CompressedContentFormat("br", ".br");
public static final CompressedContentFormat[] NONE = new CompressedContentFormat[0];
public final String _encoding;
public final String _extension;
public final String _etag;
@ -54,4 +54,15 @@ public class CompressedContentFormat
return _encoding.equalsIgnoreCase(ccf._encoding) && _extension.equalsIgnoreCase(ccf._extension);
}
public static boolean tagEquals(String etag, String tag)
{
if (etag.equals(tag))
return true;
int dashdash = tag.indexOf("--");
if (dashdash>0)
return etag.regionMatches(0,tag,0,dashdash-2);
return false;
}
}

View File

@ -77,6 +77,15 @@ public class GZIPContentDecoderTest
assertEquals(0,buffers.get());
}
@Test
public void testCompresedContentFormat() throws Exception
{
assertTrue(CompressedContentFormat.tagEquals("tag","tag"));
assertTrue(CompressedContentFormat.tagEquals("\"tag\"","\"tag\""));
assertTrue(CompressedContentFormat.tagEquals("\"tag\"","\"tag--gzip\""));
assertFalse(CompressedContentFormat.tagEquals("Zag","Xag--gzip"));
assertFalse(CompressedContentFormat.tagEquals("xtag","tag"));
}
@Test
public void testStreamNoBlocks() throws Exception

View File

@ -11,7 +11,6 @@
<New id="ThreadLimitHandler" class="org.eclipse.jetty.server.handler.ThreadLimitHandler">
<Arg name="forwardedHeader"><Property name="jetty.threadlimit.forwardedHeader"/></Arg>
<Set name="enabled"><Property name="jetty.threadlimit.enabled" default="true"/></Set>
<Set name="blockForMs"><Property name="jetty.threadlimit.blockForMs" default="0"/></Set>
<Set name="threadLimit"><Property name="jetty.threadlimit.threadLimit" default="10"/></Set>
</New>
</Arg>

View File

@ -20,9 +20,6 @@ etc/jetty-threadlimit.xml
## Enabled by default?
#jetty.threadlimit.enabled=true
## MS to block for waiting for available thread
#jetty.threadlimit.blockForMs=0
## Thread limit per remote IP
#jetty.threadlimit.threadLimit=10

View File

@ -517,7 +517,7 @@ public class ResourceService
QuotedCSV quoted = new QuotedCSV(true,ifm);
for (String tag : quoted)
{
if (tagEquals(etag, tag))
if (CompressedContentFormat.tagEquals(etag, tag))
{
match=true;
break;
@ -535,7 +535,7 @@ public class ResourceService
if (ifnm!=null && etag!=null)
{
// Handle special case of exact match OR gzip exact match
if (tagEquals(etag, ifnm) && ifnm.indexOf(',')<0)
if (CompressedContentFormat.tagEquals(etag, ifnm) && ifnm.indexOf(',')<0)
{
response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
response.setHeader(HttpHeader.ETAG.asString(),ifnm);
@ -546,7 +546,7 @@ public class ResourceService
QuotedCSV quoted = new QuotedCSV(true,ifnm);
for (String tag : quoted)
{
if (tagEquals(etag, tag))
if (CompressedContentFormat.tagEquals(etag, tag))
{
response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
response.setHeader(HttpHeader.ETAG.asString(),tag);
@ -602,21 +602,6 @@ public class ResourceService
return true;
}
protected boolean tagEquals(String etag, String tag)
{
if (etag.equals(tag))
return true;
if (tag.endsWith(GZIP._etagQuote)) {
int i = tag.indexOf(GZIP._etagQuote);
return etag.equals(tag.substring(0,i) + '"');
}
if (tag.endsWith(BR._etagQuote)) {
int i = tag.indexOf(BR._etagQuote);
return etag.equals(tag.substring(0,i) + '"');
}
return false;
}
/* ------------------------------------------------------------------- */
protected void sendDirectory(HttpServletRequest request,
HttpServletResponse response,

View File

@ -238,10 +238,13 @@ public class ThreadLimitHandlerTest
latch.countDown();
while(total.get()<10 && System.nanoTime()<wait)
Thread.sleep(1);
assertThat(count.get(),is(0));
Thread.sleep(10);
assertThat(total.get(),is(10));
while(count.get()>0 && System.nanoTime()<wait)
Thread.sleep(10);
assertThat(count.get(),is(0));
}

View File

@ -163,7 +163,10 @@ public class BaseBuilder
if (startArgs.isCreateStartd() && !Files.exists(startd))
{
if(FS.ensureDirectoryExists(startd))
{
StartLog.log("MKDIR",baseHome.toShortForm(startd));
modified.set(true);
}
if (Files.exists(startini))
{
int ini=0;
@ -273,6 +276,8 @@ public class BaseBuilder
{
// make the directories in ${jetty.base} that we need
boolean modified = FS.ensureDirectoryExists(file.getParent());
if (modified)
StartLog.log("MKDIR",baseHome.toShortForm(file.getParent()));
URI uri = URI.create(arg.uri);
@ -324,8 +329,10 @@ public class BaseBuilder
if (isDir)
{
// Create directory
StartLog.log("MKDIR",baseHome.toShortForm(file));
return FS.ensureDirectoryExists(file);
boolean mkdir = FS.ensureDirectoryExists(file);
if (mkdir)
StartLog.log("MKDIR",baseHome.toShortForm(file));
return mkdir;
}
else
{

View File

@ -18,6 +18,7 @@
package org.eclipse.jetty.start;
import java.io.FileInputStream;
import java.io.IOException;
import java.nio.file.Path;
import java.util.ArrayList;
@ -27,6 +28,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Properties;
import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
@ -44,6 +46,7 @@ public class Modules implements Iterable<Module>
private final Map<String,Set<Module>> _provided = new HashMap<>();
private final BaseHome _baseHome;
private final StartArgs _args;
private final Properties _deprecated = new Properties();
public Modules(BaseHome basehome, StartArgs args)
{
@ -59,6 +62,19 @@ public class Modules implements Iterable<Module>
args.setProperty("java.version",java_version,"<internal>");
}
}
try
{
Path deprecated_path = _baseHome.getPath("modules/deprecated.properties");
if (deprecated_path!=null && FS.exists(deprecated_path))
{
_deprecated.load(new FileInputStream(deprecated_path.toFile()));
}
}
catch (IOException e)
{
StartLog.debug(e);
}
}
public void dump(List<String> tags)
@ -260,7 +276,7 @@ public class Modules implements Iterable<Module>
{
Module module = get(name);
if (module==null)
throw new UsageException(UsageException.ERR_UNKNOWN,"Unknown module='%s'",name);
throw new UsageException(UsageException.ERR_UNKNOWN,"Unknown module='%s. List available with --list-modules",name);
Set<String> enabled = new HashSet<>();
enable(enabled,module,enabledFrom,false);
@ -354,7 +370,14 @@ public class Modules implements Iterable<Module>
public Module get(String name)
{
return _names.get(name);
Module module = _names.get(name);
if (module==null)
{
String reason = _deprecated.getProperty(name);
if (reason!=null)
StartLog.warn("Deprecated module '%s' is %s",name,reason);
}
return module;
}
@Override

View File

@ -45,7 +45,6 @@ import java.util.TreeSet;
*
* @param <T> The type to be sorted. It must be able to be added to a {@link HashSet}
*/
@SuppressWarnings("Duplicates")
public class TopologicalSort<T>
{
private final Map<T,Set<T>> _dependencies = new HashMap<>();
@ -126,8 +125,15 @@ public class TopologicalSort<T>
ordered_deps.addAll(dependencies);
// recursively visit each dependency
for (T d:ordered_deps)
visit(d,visited,sorted,comparator);
try
{
for (T d:ordered_deps)
visit(d,visited,sorted,comparator);
}
catch (CyclicException e)
{
throw new CyclicException(item,e);
}
}
// Now that we have visited all our dependencies, they and their
@ -138,7 +144,7 @@ public class TopologicalSort<T>
else if (!sorted.contains(item))
// If we have already visited an item, but it has not yet been put in the
// sorted list, then we must be in a cycle!
throw new IllegalStateException("cyclic at "+item);
throw new CyclicException(item);
}
@ -182,4 +188,17 @@ public class TopologicalSort<T>
{
return "TopologicalSort "+_dependencies;
}
private static class CyclicException extends IllegalStateException
{
CyclicException(Object item)
{
super("cyclic at "+item);
}
CyclicException(Object item,CyclicException e)
{
super("cyclic at "+item,e);
}
}
}

View File

@ -46,7 +46,8 @@ public class StartDirBuilder implements BaseBuilder.Config
{
this.baseHome = baseBuilder.getBaseHome();
this.startDir = baseHome.getBasePath("start.d");
FS.ensureDirectoryExists(startDir);
if (FS.ensureDirectoryExists(startDir))
StartLog.log("MKDIR",baseHome.toShortForm(startDir));
}
@Override

View File

@ -26,6 +26,7 @@ import java.nio.file.Path;
import org.eclipse.jetty.start.BaseHome;
import org.eclipse.jetty.start.FS;
import org.eclipse.jetty.start.FileInitializer;
import org.eclipse.jetty.start.StartLog;
/**
* Copy a file found in {@link BaseHome} from a URI of the form
@ -51,7 +52,10 @@ public class BaseHomeFileInitializer implements FileInitializer
if (FS.exists(source) && !FS.exists(file))
{
FS.ensureDirectoryExists(file.getParent());
if (FS.ensureDirectoryExists(file.getParent()))
StartLog.log("MKDIR",_basehome.toShortForm(file.getParent()));
StartLog.log("COPY ","%s to %s",_basehome.toShortForm(source),_basehome.toShortForm(file));
Files.copy(source,file);
return true;
}

View File

@ -113,7 +113,7 @@ public class MavenLocalRepoFileInitializer extends UriFileInitializer
// Grab copy from local repository (download if needed to local
// repository)
Path localRepoFile = getLocalRepoFile(coords);
StartLog.log("COPY","%s to %s",localRepoFile,baseHome.toShortForm(file));
StartLog.log("COPY ","%s to %s",localRepoFile,baseHome.toShortForm(file));
Files.copy(localRepoFile,file);
}
else

View File

@ -66,7 +66,8 @@ public class UriFileInitializer implements FileInitializer
{
StartLog.log("DOWNLOAD","%s to %s",uri,baseHome.toShortForm(file));
FS.ensureDirectoryExists(file.getParent());
if (FS.ensureDirectoryExists(file.getParent()))
StartLog.log("MKDIR",baseHome.toShortForm(file.getParent()));
HttpURLConnection http = (HttpURLConnection)uri.toURL().openConnection();
http.setInstanceFollowRedirects(true);

View File

@ -1,2 +1,2 @@
EX|IllegalStateException
EX|CyclicException
EX|cyclic

View File

@ -1,2 +1,2 @@
EX|IllegalStateException
EX|CyclicException
EX|cyclic

View File

@ -9,6 +9,7 @@ internal
[depends]
resources
stderrout-capture
[provides]
jcl-api

View File

@ -11,8 +11,8 @@ internal
slf4j-api
[provides]
jcl-impl
jcl-api
jcl-impl
[files]
maven://org.slf4j/jcl-over-slf4j/${slf4j.version}|lib/slf4j/jcl-over-slf4j-${slf4j.version}.jar

View File

@ -7,7 +7,7 @@ logging
[depends]
resources
stderrout-logging
stderrout-capture
[provide]
logging

View File

@ -7,6 +7,7 @@ logging
[depends]
slf4j-jul
jul-impl
[provide]
logging

View File

@ -11,9 +11,6 @@ internal
slf4j-api
resources
[provide]
slf4j-impl
[files]
maven://org.slf4j/slf4j-simple/${slf4j.version}|lib/slf4j/slf4j-simple-${slf4j.version}.jar
basehome:modules/slf4j/simplelogger.properties|resources/simplelogger.properties

View File

@ -9,7 +9,7 @@ internal
[depend]
slf4j-api
jcl-api
jcl-impl
[provide]
slf4j-impl

View File

@ -6,10 +6,11 @@ including output from Jetty's default StdErrLog logging.
logging
[xml]
etc/stderrout-logging.xml
etc/stderrout-capture.xml
[files]
logs/
basehome:modules/stderrout-capture/stderrout-capture.xml|etc/stderrout-capture.xml
[lib]
resources/

View File

@ -24,7 +24,7 @@
</New>
<Get name="rootLogger">
<Call name="info"><Arg>Redirecting stderr/stdout to <Ref refid="ServerLogName"/></Arg></Call>
<Call name="info"><Arg>Capturing stderr/stdout to <Ref refid="ServerLogName"/></Arg></Call>
</Get>
<Call class="java.lang.System" name="setErr"><Arg><Ref refid="ServerLog"/></Arg></Call>
<Call class="java.lang.System" name="setOut"><Arg><Ref refid="ServerLog"/></Arg></Call>

View File

@ -20,7 +20,6 @@ package org.eclipse.jetty.util;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
@ -32,7 +31,6 @@ import java.util.TreeSet;
import org.eclipse.jetty.util.component.ContainerLifeCycle;
import org.eclipse.jetty.util.component.Dumpable;
import org.eclipse.jetty.util.component.DumpableCollection;
/**
@ -145,8 +143,15 @@ public class TopologicalSort<T> implements Dumpable
ordered_deps.addAll(dependencies);
// recursively visit each dependency
for (T d:ordered_deps)
visit(d,visited,sorted,comparator);
try
{
for (T d:ordered_deps)
visit(d,visited,sorted,comparator);
}
catch (CyclicException e)
{
throw new CyclicException(item,e);
}
}
// Now that we have visited all our dependencies, they and their
@ -157,7 +162,7 @@ public class TopologicalSort<T> implements Dumpable
else if (!sorted.contains(item))
// If we have already visited an item, but it has not yet been put in the
// sorted list, then we must be in a cycle!
throw new IllegalStateException("cyclic at "+item);
throw new CyclicException(item);
}
@ -215,4 +220,17 @@ public class TopologicalSort<T> implements Dumpable
out.append(String.format("TopologicalSort@%x%n",hashCode()));
ContainerLifeCycle.dump(out, indent,_dependencies.entrySet());
}
private static class CyclicException extends IllegalStateException
{
CyclicException(Object item)
{
super("cyclic at "+item);
}
CyclicException(Object item,CyclicException e)
{
super("cyclic at "+item,e);
}
}
}

View File

@ -24,5 +24,7 @@ lib/jetty-webapp-${jetty.version}.jar
## + a directory of jars,resource or classes e.g. 'file:${jetty.base}/resources'
## + A pattern preceeded with a '-' is an exclusion, all other patterns are inclusions
##
jetty.webapp.addSystemClasses,=
jetty.webapp.addServerClasses,=
## The +=, operator appends to a CSV list with a comma as needed.
##
#jetty.webapp.addSystemClasses+=,org.example.
#jetty.webapp.addServerClasses+=,org.example.

View File

@ -45,7 +45,7 @@ function gitFindRemoteByUrl() {
return 0
}
GIT_REMOTE_URL="git.eclipse.org/gitroot/jetty/org.eclipse.jetty.project.git"
GIT_REMOTE_URL="github.com:eclipse/jetty.project.git"
GIT_REMOTE_ID=$(gitFindRemoteByUrl "$GIT_REMOTE_URL")
GIT_BRANCH_ID=$(git symbolic-ref -q --short HEAD || git describe --tags --exact-match)

View File

@ -83,6 +83,9 @@ public class ConnectionStatisticsTest extends AbstractTest
// Close all connections.
stop();
// Give some time to process the stop event.
Thread.sleep(1000);
Assert.assertThat(serverStats.getConnectionsMax(), Matchers.greaterThan(0L));
Assert.assertThat(serverStats.getReceivedBytes(), Matchers.greaterThan(contentLength));
Assert.assertThat(serverStats.getSentBytes(), Matchers.greaterThan(contentLength));