forked from I2P_Developers/i2p.i2p
jetty 7 first cut
This commit is contained in:
3
apps/jetty/README-i2p.txt
Normal file
3
apps/jetty/README-i2p.txt
Normal file
@ -0,0 +1,3 @@
|
||||
jetty-distribution-xxx is only what we need out of jetty-distribution-xxx.zip.
|
||||
|
||||
NOTICE and LICENSE files moved to ../../../licenses
|
@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project basedir="." default="all" name="jetty">
|
||||
|
||||
<property name="jetty.ver" value="6.1.26" />
|
||||
<property name="jetty.base" value="jetty-${jetty.ver}" />
|
||||
<property name="jetty.sha1" value="9485913f1a1945a849a90f1a34853d22350bc524" />
|
||||
<property name="jetty.ver" value="7.6.8.v20121106" />
|
||||
<property name="jetty.base" value="jetty-distribution-${jetty.ver}" />
|
||||
<property name="jetty.sha1" value="6fcdc3f532c5ab72843e12cbac3d7cb797cdb5b9" />
|
||||
<property name="jetty.filename" value="${jetty.base}.zip" />
|
||||
<property name="jetty.url" value="http://dist.codehaus.org/jetty/${jetty.base}/${jetty.filename}" />
|
||||
<property name="jetty.url" value="http://download.eclipse.org/jetty/${jetty.ver}/dist/${jetty.filename}" />
|
||||
<property name="verified.filename" value="verified.txt" />
|
||||
<property name="javac.compilerargs" value="" />
|
||||
<property name="tomcat.lib" value="apache-tomcat-deployer/lib" />
|
||||
@ -97,12 +97,29 @@
|
||||
All of these are available in the Ubuntu packages libjetty-java and libjetty-extra-java
|
||||
-->
|
||||
<copy preservelastmodified="true" file="${jetty.base}/start.jar" tofile="jettylib/jetty-start.jar" />
|
||||
<copy file="${jetty.base}/lib/${jetty.base}.jar" tofile="jettylib/org.mortbay.jetty.jar" />
|
||||
<copy file="${jetty.base}/lib/jetty-server-${jetty.ver}.jar" tofile="jettylib/org.mortbay.jetty.jar" />
|
||||
<copy preservelastmodified="true" file="${jetty.base}/lib/jetty-continuation-${jetty.ver}.jar" tofile="jettylib/jetty-continuation.jar" />
|
||||
<copy preservelastmodified="true" file="${jetty.base}/lib/jetty-deploy-${jetty.ver}.jar" tofile="jettylib/jetty-deploy.jar" />
|
||||
<copy preservelastmodified="true" file="${jetty.base}/lib/jetty-http-${jetty.ver}.jar" tofile="jettylib/jetty-http.jar" />
|
||||
<copy preservelastmodified="true" file="${jetty.base}/lib/jetty-io-${jetty.ver}.jar" tofile="jettylib/jetty-io.jar" />
|
||||
<copy preservelastmodified="true" file="${jetty.base}/lib/jetty-jmx-${jetty.ver}.jar" tofile="jettylib/org.mortbay.jmx.jar" />
|
||||
<copy preservelastmodified="true" file="${jetty.base}/lib/jetty-rewrite-${jetty.ver}.jar" tofile="jettylib/jetty-rewrite-handler.jar" />
|
||||
<copy preservelastmodified="true" file="${jetty.base}/lib/jetty-security-${jetty.ver}.jar" tofile="jettylib/jetty-security.jar" />
|
||||
<copy preservelastmodified="true" file="${jetty.base}/lib/jetty-servlet-${jetty.ver}.jar" tofile="jettylib/jetty-servlet.jar" />
|
||||
<copy preservelastmodified="true" file="${jetty.base}/lib/jetty-servlets-${jetty.ver}.jar" tofile="jettylib/jetty-servlets.jar" />
|
||||
<copy preservelastmodified="true" file="${jetty.base}/lib/jetty-util-${jetty.ver}.jar" tofile="jettylib/jetty-util.jar" />
|
||||
<copy preservelastmodified="true" file="${jetty.base}/lib/ext/jetty-java5-threadpool-${jetty.ver}.jar" tofile="jettylib/jetty-java5-threadpool.jar" />
|
||||
<copy preservelastmodified="true" file="${jetty.base}/lib/ext/jetty-rewrite-handler-${jetty.ver}.jar" tofile="jettylib/jetty-rewrite-handler.jar" />
|
||||
<copy preservelastmodified="true" file="${jetty.base}/lib/ext/jetty-sslengine-${jetty.ver}.jar" tofile="jettylib/jetty-sslengine.jar" />
|
||||
<copy preservelastmodified="true" file="${jetty.base}/lib/management/jetty-management-${jetty.ver}.jar" tofile="jettylib/org.mortbay.jmx.jar" />
|
||||
<copy preservelastmodified="true" file="${jetty.base}/lib/jetty-webapp-${jetty.ver}.jar" tofile="jettylib/jetty-webapp.jar" />
|
||||
<copy preservelastmodified="true" file="${jetty.base}/lib/jetty-xml-${jetty.ver}.jar" tofile="jettylib/jetty-xml.jar" />
|
||||
<jar destfile="jettylib/jetty-java5-threadpool.jar" >
|
||||
<manifest>
|
||||
<attribute name="Note" value="Intentionally empty" />
|
||||
</manifest>
|
||||
</jar>
|
||||
<jar destfile="jettylib/jetty-sslengine.jar" >
|
||||
<manifest>
|
||||
<attribute name="Note" value="Intentionally empty" />
|
||||
</manifest>
|
||||
</jar>
|
||||
<delete file="jetty.tar" />
|
||||
<!--
|
||||
<delete dir="${jetty.base}" />
|
||||
@ -155,15 +172,16 @@
|
||||
<target name="build" depends="jar" />
|
||||
|
||||
<target name="builddep" />
|
||||
|
||||
<target name="compile" depends="builddep, ensureJettylib" >
|
||||
<mkdir dir="./build" />
|
||||
<mkdir dir="./build/obj" />
|
||||
<javac
|
||||
srcdir="./java/src"
|
||||
debug="true" source="1.5" target="1.5"
|
||||
debug="true" deprecation="on" source="1.5" target="1.5"
|
||||
destdir="./build/obj"
|
||||
includeAntRuntime="false"
|
||||
classpath="../../core/java/build/i2p.jar:./jettylib/commons-logging.jar:./jettylib/javax.servlet.jar:./jettylib/org.mortbay.jetty.jar:./jettylib/jetty-util.jar" >
|
||||
classpath="../../core/java/build/i2p.jar:./jettylib/commons-logging.jar:./jettylib/javax.servlet.jar:./jettylib/org.mortbay.jetty.jar:./jettylib/jetty-http.jar:./jettylib/jetty-io.jar:./jettylib/jetty-util.jar:./jettylib/jetty-xml.jar" >
|
||||
<compilerarg line="${javac.compilerargs}" />
|
||||
</javac>
|
||||
</target>
|
||||
|
@ -17,13 +17,13 @@ package net.i2p.jetty;
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.util.Log;
|
||||
|
||||
import org.mortbay.jetty.Server;
|
||||
import org.mortbay.log.Logger;
|
||||
import org.eclipse.jetty.server.Server;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
/**
|
||||
* Modified from Jetty 6.1.26 StdErrLog.java and Slf4jLog.java
|
||||
*
|
||||
* Usage: org.mortbay.log.Log.setLog(new I2PLogger(ctx));
|
||||
* Usage: org.eclipse.log.Log.setLog(new I2PLogger(ctx));
|
||||
*
|
||||
* @since Jetty 6
|
||||
*/
|
||||
@ -182,5 +182,80 @@ public class I2PLogger implements Logger
|
||||
return "I2PLogger";
|
||||
}
|
||||
|
||||
/**
|
||||
* @since Jetty 7
|
||||
*/
|
||||
public void ignore(Throwable ignored)
|
||||
{
|
||||
warn("IGNORED", ignored);
|
||||
}
|
||||
|
||||
/**
|
||||
* @since Jetty 7
|
||||
*/
|
||||
public void debug(Throwable thrown)
|
||||
{
|
||||
debug("", thrown);
|
||||
}
|
||||
|
||||
/**
|
||||
* @since Jetty 7
|
||||
*/
|
||||
public void debug(String msg, Object... args)
|
||||
{
|
||||
Object a1 = args.length > 0 ? args[0] : null;
|
||||
Object a2 = args.length > 1 ? args[1] : null;
|
||||
debug(msg, a1, a2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @since Jetty 7
|
||||
*/
|
||||
public void info(Throwable thrown)
|
||||
{
|
||||
info("", thrown);
|
||||
}
|
||||
|
||||
/**
|
||||
* @since Jetty 7
|
||||
*/
|
||||
public void info(String msg, Object... args)
|
||||
{
|
||||
Object a1 = args.length > 0 ? args[0] : null;
|
||||
Object a2 = args.length > 1 ? args[1] : null;
|
||||
info(msg, a1, a2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @since Jetty 7
|
||||
*/
|
||||
public void info(String msg, Throwable th)
|
||||
{
|
||||
_log.info(msg,th);
|
||||
}
|
||||
|
||||
/**
|
||||
* @since Jetty 7
|
||||
*/
|
||||
public void warn(Throwable thrown)
|
||||
{
|
||||
warn("", thrown);
|
||||
}
|
||||
|
||||
/**
|
||||
* @since Jetty 7
|
||||
*/
|
||||
public void warn(String msg, Object... args)
|
||||
{
|
||||
Object a1 = args.length > 0 ? args[0] : null;
|
||||
Object a2 = args.length > 1 ? args[1] : null;
|
||||
warn(msg, a1, a2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @since Jetty 7
|
||||
*/
|
||||
public String getName() {
|
||||
return "net.i2p.jetty.I2PLogger";
|
||||
}
|
||||
}
|
||||
|
@ -24,18 +24,18 @@ import java.util.TimeZone;
|
||||
|
||||
import javax.servlet.http.Cookie;
|
||||
|
||||
import org.mortbay.component.AbstractLifeCycle;
|
||||
import org.mortbay.jetty.HttpHeaders;
|
||||
import org.mortbay.jetty.Request;
|
||||
import org.mortbay.jetty.RequestLog;
|
||||
import org.mortbay.jetty.Response;
|
||||
import org.mortbay.jetty.servlet.PathMap;
|
||||
import org.mortbay.log.Log;
|
||||
import org.mortbay.util.DateCache;
|
||||
import org.mortbay.util.RolloverFileOutputStream;
|
||||
import org.mortbay.util.StringUtil;
|
||||
import org.mortbay.util.TypeUtil;
|
||||
import org.mortbay.util.Utf8StringBuffer;
|
||||
import org.eclipse.jetty.http.HttpHeaders;
|
||||
import org.eclipse.jetty.http.PathMap;
|
||||
import org.eclipse.jetty.server.Request;
|
||||
import org.eclipse.jetty.server.RequestLog;
|
||||
import org.eclipse.jetty.server.Response;
|
||||
import org.eclipse.jetty.util.DateCache;
|
||||
import org.eclipse.jetty.util.RolloverFileOutputStream;
|
||||
import org.eclipse.jetty.util.StringUtil;
|
||||
import org.eclipse.jetty.util.TypeUtil;
|
||||
import org.eclipse.jetty.util.Utf8StringBuilder;
|
||||
import org.eclipse.jetty.util.component.AbstractLifeCycle;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
|
||||
/**
|
||||
* This {@link RequestLog} implementation outputs logs in the pseudo-standard NCSA common log format.
|
||||
@ -56,8 +56,6 @@ import org.mortbay.util.Utf8StringBuffer;
|
||||
*
|
||||
* So that we will work with system Jetty 6 packages, we just copy the whole thing
|
||||
* and modify log() as required.
|
||||
* We leave the package as org.mortbay.http for compatibility with old
|
||||
* jetty.xml files.
|
||||
*
|
||||
* @author Greg Wilkins
|
||||
* @author Nigel Canonizado
|
||||
@ -259,13 +257,13 @@ public class I2PRequestLog extends AbstractLifeCycle implements RequestLog
|
||||
if (_fileOut == null)
|
||||
return;
|
||||
|
||||
Utf8StringBuffer u8buf;
|
||||
StringBuffer buf;
|
||||
Utf8StringBuilder u8buf;
|
||||
StringBuilder buf;
|
||||
synchronized(_writer)
|
||||
{
|
||||
int size=_buffers.size();
|
||||
u8buf = size==0?new Utf8StringBuffer(160):(Utf8StringBuffer)_buffers.remove(size-1);
|
||||
buf = u8buf.getStringBuffer();
|
||||
u8buf = size==0?new Utf8StringBuilder(160):(Utf8StringBuilder)_buffers.remove(size-1);
|
||||
buf = u8buf.getStringBuilder();
|
||||
}
|
||||
|
||||
synchronized(buf) // for efficiency until we can use StringBuilder
|
||||
@ -398,7 +396,7 @@ public class I2PRequestLog extends AbstractLifeCycle implements RequestLog
|
||||
if (_logLatency)
|
||||
{
|
||||
_writer.write(' ');
|
||||
_writer.write(TypeUtil.toString(System.currentTimeMillis() - request.getTimeStamp()));
|
||||
_writer.write(Long.toString(System.currentTimeMillis() - request.getTimeStamp()));
|
||||
}
|
||||
|
||||
_writer.write(StringUtil.__LINE_SEPARATOR);
|
||||
|
@ -19,15 +19,16 @@ package net.i2p.jetty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.app.*;
|
||||
import static net.i2p.app.ClientAppState.*;
|
||||
|
||||
import org.mortbay.component.LifeCycle;
|
||||
import org.mortbay.resource.Resource;
|
||||
import org.mortbay.xml.XmlConfiguration;
|
||||
import org.eclipse.jetty.util.component.LifeCycle;
|
||||
import org.eclipse.jetty.util.resource.Resource;
|
||||
import org.eclipse.jetty.xml.XmlConfiguration;
|
||||
|
||||
/**
|
||||
* Start Jetty where the args are one or more XML files.
|
||||
@ -73,8 +74,11 @@ public class JettyStart implements ClientApp {
|
||||
XmlConfiguration configuration = new XmlConfiguration(Resource.newResource(args[i]).getURL());
|
||||
if (last!=null)
|
||||
configuration.getIdMap().putAll(last.getIdMap());
|
||||
if (properties.size()>0)
|
||||
configuration.setProperties(properties);
|
||||
if (properties.size()>0) {
|
||||
// to avoid compiler errror
|
||||
Map foo = configuration.getProperties();
|
||||
foo.putAll(properties);
|
||||
}
|
||||
Object o = configuration.configure();
|
||||
if (o instanceof LifeCycle)
|
||||
_jettys.add((LifeCycle)o);
|
||||
|
@ -1,3 +0,0 @@
|
||||
This is only what we need out of the 25 MB Jetty-6.1.26.zip.
|
||||
|
||||
NOTICE and LICENSE files moved to ../../../licenses
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user