Merge remote-tracking branch 'origin/master' into jetty-http2

This commit is contained in:
Greg Wilkins 2014-08-21 16:39:45 +10:00
commit 23eba39748
15 changed files with 204 additions and 12 deletions

View File

@ -147,6 +147,13 @@ public interface Response
public interface AsyncContentListener extends ResponseListener
{
/**
* Callback method invoked asynchronously when the response content has been received.
*
* @param response the response containing the response line data and the headers
* @param content the content bytes received
* @param callback the callback to call when the content is consumed.
*/
public void onContent(Response response, ByteBuffer content, Callback callback);
}

View File

@ -0,0 +1,16 @@
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
<Configure id="Contexts" class="org.eclipse.jetty.server.handler.ContextHandlerCollection">
<Call name="addHandler">
<Arg>
<New class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="contextPath">/hawtio</Set>
<Set name="war"><Property name="jetty.base" default="."/>/lib/hawtio/hawtio.war</Set>
<Set name="extractWAR">true</Set>
<Set name="copyWebDir">false</Set>
<Set name="defaultsDescriptor"><Property name="jetty.home" default="."/>/etc/webdefault.xml</Set>
</New>
</Arg>
</Call>
</Configure>

View File

@ -0,0 +1,32 @@
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
<!-- =============================================================== -->
<!-- Mixin the Jamon Handler -->
<!-- =============================================================== -->
<Configure id="Server" class="org.eclipse.jetty.server.Server">
<Get id="oldhandler" name="handler" />
<Set name="handler">
<New id="JamonHandler" class="com.jamonapi.http.JAMonJettyHandlerNew">
<Set name="handler"><Ref refid="oldhandler" /></Set>
<Set name="summaryLabels"><Property name="jamon.summaryLabels" /></Set>
</New>
</Set>
<Ref refid="Contexts">
<Call name="addHandler">
<Arg>
<New class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="contextPath">/jamon</Set>
<Set name="war"><Property name="jetty.base" default="."/>/lib/jamon/jamon.war</Set>
<Set name="extractWAR">true</Set>
<Set name="copyWebDir">false</Set>
<Set name="defaultsDescriptor"><Property name="jetty.home" default="."/>/etc/webdefault.xml</Set>
</New>
</Arg>
</Call>
</Ref>
</Configure>

View File

@ -0,0 +1,12 @@
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure id="Server" class="org.eclipse.jetty.server.Server">
<Call name="addBean">
<Arg>
<New class="org.jminix.console.tool.StandaloneMiniConsole">
<Arg type="int"><Property name="jminix.port" default="8088" /></Arg>
</New>
</Arg>
</Call>
</Configure>

View File

@ -0,0 +1,16 @@
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
<Configure id="Contexts" class="org.eclipse.jetty.server.handler.ContextHandlerCollection">
<Call name="addHandler">
<Arg>
<New class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="contextPath">/jolokia</Set>
<Set name="war"><Property name="jetty.base" default="."/>/lib/jolokia/jolokia.war</Set>
<Set name="extractWAR">true</Set>
<Set name="copyWebDir">false</Set>
<Set name="defaultsDescriptor"><Property name="jetty.home" default="."/>/etc/webdefault.xml</Set>
</New>
</Arg>
</Call>
</Configure>

View File

@ -0,0 +1,22 @@
#
# Hawtio x module
#
[depend]
stats
deploy
jmx
[xml]
etc/hawtio.xml
[files]
etc/hawtio/
lib/hawtio/
https://oss.sonatype.org/content/repositories/public/io/hawt/hawtio-default/1.4.16/hawtio-default-1.4.16.war|lib/hawtio/hawtio.war
[ini-template]
-Dhawtio.authenticationEnabled=false
-Dhawtio.dirname=/dirname
-Dhawtio.config.dir=${jetty.base}/etc/hawtio

View File

@ -0,0 +1,25 @@
#
# JaMON Jetty module
#
[depend]
stats
deploy
jmx
jsp
[xml]
etc/jamon.xml
[files]
lib/jamon/
http://central.maven.org/maven2/com/jamonapi/jamon/2.79/jamon-2.79.jar|lib/jamon/jamon-2.79.jar
http://central.maven.org/maven2/com/jamonapi/jamon_war/2.79/jamon_war-2.79.war|lib/jamon/jamon.war
[lib]
lib/jamon/**.jar
[ini-template]
jamon.summaryLabels=default, request.getStatus().contextpath.value.ms
#jamon.summaryLabels=demo

View File

@ -0,0 +1,36 @@
#
# JaMON Jetty module
#
[depend]
stats
jmx
[xml]
etc/jminix.xml
[files]
lib/jminix/
http://central.maven.org/maven2/org/jminix/jminix/1.1.0/jminix-1.1.0.jar|lib/jminix/jminix-1.1.0.jar
http://maven.restlet.com/org/restlet/org.restlet/1.1.5/org.restlet-1.1.5.jar|lib/jminix/org.restlet-1.1.5.jar
http://maven.restlet.com/org/restlet/org.restlet.ext.velocity/1.1.5/org.restlet.ext.velocity-1.1.5.jar|lib/jminix/org.restlet.ext.velocity-1.1.5.jar
http://central.maven.org/maven2/org/apache/velocity/velocity/1.5/velocity-1.5.jar|lib/jminix/velocity-1.5.jar
http://central.maven.org/maven2/oro/oro/2.0.8/oro-2.0.8.jar|lib/jminix/oro-2.0.8.jar
http://maven.restlet.com/com/noelios/restlet/com.noelios.restlet/1.1.5/com.noelios.restlet-1.1.5.jar|lib/jminix/com.noelios.restlet-1.1.5.jar
http://maven.restlet.com/com/noelios/restlet/com.noelios.restlet.ext.servlet/1.1.5/com.noelios.restlet.ext.servlet-1.1.5.jar|lib/jminix/com.noelios.restlet.ext.servlet-1.1.5.jar
http://central.maven.org/maven2/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar|lib/jminix/commons-logging-1.1.1.jar
http://repo2.maven.org/maven2/net/sf/json-lib/json-lib/2.2.3/json-lib-2.2.3-jdk15.jar|lib/jminix/json-lib-2.2.3-jdk15.jar
http://central.maven.org/maven2/commons-lang/commons-lang/2.4/commons-lang-2.4.jar|lib/jminix/commons-lang-2.4.jar
http://central.maven.org/maven2/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar|lib/jminix/commons-beanutils-1.7.0.jar
http://central.maven.org/maven2/commons-collections/commons-collections/3.2/commons-collections-3.2.jar|lib/jminix/commons-collections-3.2.jar
http://central.maven.org/maven2/net/sf/ezmorph/ezmorph/1.0.6/ezmorph-1.0.6.jar|lib/jminix/ezmorph-1.0.6.jar
http://central.maven.org/maven2/org/jgroups/jgroups/2.12.1.3.Final/jgroups-2.12.1.3.Final.jar|lib/jminix/jgroups-2.12.1.3.Final.jar
http://central.maven.org/maven2/org/jasypt/jasypt/1.8/jasypt-1.8.jar|lib/jminix/jasypt-1.8.jar
[lib]
lib/jminix/**.jar
[ini-template]
# Jminix Configuration
jminix.port=8088

View File

@ -0,0 +1,15 @@
#
# Jolokia Jetty module
#
[depend]
stats
deploy
jmx
[xml]
etc/jolokia.xml
[files]
http://repo1.maven.org/maven2/org/jolokia/jolokia-war/1.2.2/jolokia-war-1.2.2.war|lib/jolokia/jolokia.war

View File

@ -4,6 +4,7 @@
[depend]
servlet
annotations
jsp-impl/${jsp-impl}-jsp
[ini-template]

View File

@ -773,7 +773,7 @@ public class SslConnection extends AbstractConnection
{
if (DEBUG)
LOG.debug("{} renegotiation denied", SslConnection.this);
shutdownOutput();
getEndPoint().shutdownOutput();
return allConsumed;
}

View File

@ -176,18 +176,21 @@ public class CommandLineBuilder
@Override
public String toString()
{
return toString(" ");
}
public String toString(String delim)
{
StringBuilder buf = new StringBuilder();
boolean delim = false;
for (String arg : args)
{
if (delim)
if (buf.length()>0)
{
buf.append(' ');
buf.append(delim);
}
buf.append(quote(arg));
delim = true;
}
return buf.toString();

View File

@ -654,7 +654,7 @@ public class Main
if (args.isDryRun())
{
CommandLineBuilder cmd = args.getMainArgs(baseHome,true);
System.out.println(cmd.toString());
System.out.println(cmd.toString(File.separatorChar=='/'?" \\\n":" "));
}
if (args.isStopCommand())

View File

@ -331,6 +331,7 @@ public class Modules implements Iterable<Module>
parentNames.addAll(module.getParentNames());
for(String name: parentNames)
{
StartLog.debug("Enable parent '%s' of module: %s",name,module.getName());
Module parent = modules.get(name);
if (parent == null)
{
@ -469,6 +470,7 @@ public class Modules implements Iterable<Module>
// load missing post-expanded dependent modules
private void normalizeDependencies() throws FileNotFoundException, IOException
{
Set<String> expandedModules = new HashSet<>();
boolean done = false;
while (!done)
{
@ -479,26 +481,31 @@ public class Modules implements Iterable<Module>
{
for (String parent : m.getParentNames())
{
if (modules.containsKey(parent) || missingModules.contains(parent))
String expanded = args.getProperties().expand(parent);
if (modules.containsKey(expanded) || missingModules.contains(parent) || expandedModules.contains(parent))
{
continue; // found. skip it.
}
done = false;
StartLog.debug("Missing parent module %s == %s for %s",parent,expanded,m);
missingParents.add(parent);
}
}
for (String missingParent : missingParents)
{
Path file = baseHome.getPath("modules/" + missingParent + ".mod");
String expanded = args.getProperties().expand(missingParent);
Path file = baseHome.getPath("modules/" + expanded + ".mod");
if (FS.canReadFile(file))
{
Module module = registerModule(file);
updateParentReferencesTo(module);
if (!expanded.equals(missingParent))
expandedModules.add(missingParent);
}
else
{
StartLog.debug("Missing module definition: [ Mod: %s | File: %s ]",missingParent,file);
StartLog.debug("Missing module definition: %s == %s",missingParent,expanded);
missingModules.add(missingParent);
}
}

View File

@ -1212,13 +1212,13 @@ public class XmlConfiguration
// For all arguments, load properties
for (String arg : args)
{
if (arg.toLowerCase(Locale.ENGLISH).endsWith(".properties"))
properties.load(Resource.newResource(arg).getInputStream());
else if (arg.indexOf('=')>=0)
if (arg.indexOf('=')>=0)
{
int i=arg.indexOf('=');
properties.put(arg.substring(0,i),arg.substring(i+1));
}
else if (arg.toLowerCase(Locale.ENGLISH).endsWith(".properties"))
properties.load(Resource.newResource(arg).getInputStream());
}
// For all arguments, parse XMLs