Skip to content

Commit

Permalink
ZOOKEEPER-2489: Upgrade Jetty dependency to a recent stable release v…
Browse files Browse the repository at this point in the history
…ersion. (Edward Ribeiro via phunt)

git-svn-id: https://svn.apache.org/repos/asf/zookeeper/trunk@1757584 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
phunt committed Aug 25, 2016
1 parent ffe4dbd commit eab677a
Show file tree
Hide file tree
Showing 21 changed files with 56 additions and 20 deletions.
3 changes: 3 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,9 @@ IMPROVEMENTS:
ZOOKEEPER-2505: Use shared library instead of static library in C
client unit test (Michael Han via phunt)

ZOOKEEPER-2489: Upgrade Jetty dependency to a recent stable release
version. (Edward Ribeiro via phunt)

Release 3.5.0 - 8/4/2014

NEW FEATURES:
Expand Down
Binary file modified docs/index.pdf
Binary file not shown.
Binary file modified docs/javaExample.pdf
Binary file not shown.
Binary file modified docs/linkmap.pdf
Binary file not shown.
Binary file modified docs/recipes.pdf
Binary file not shown.
11 changes: 11 additions & 0 deletions docs/zookeeperAdmin.html
Original file line number Diff line number Diff line change
Expand Up @@ -1866,6 +1866,17 @@ <h4>AdminServer configuration</h4>
<p>The port the embedded Jetty server listens on. Defaults to 8080.</p>
</dd>


<dt>
<term>admin.idleTimeout</term>
</dt>
<dd>
<p>(Java system property: <strong>zookeeper.admin.idleTimeout</strong>)</p>
<p>Set the maximum idle time in milliseconds that a connection can wait
before sending or receiving data. Defaults to 30000 ms.</p>
</dd>



<dt>
<term>admin.commandURL</term>
Expand Down
Binary file modified docs/zookeeperAdmin.pdf
Binary file not shown.
Binary file modified docs/zookeeperHierarchicalQuorums.pdf
Binary file not shown.
Binary file modified docs/zookeeperInternals.pdf
Binary file not shown.
Binary file modified docs/zookeeperJMX.pdf
Binary file not shown.
Binary file modified docs/zookeeperObservers.pdf
Binary file not shown.
Binary file modified docs/zookeeperOver.pdf
Binary file not shown.
Binary file modified docs/zookeeperProgrammers.pdf
Binary file not shown.
Binary file modified docs/zookeeperQuotas.pdf
Binary file not shown.
Binary file modified docs/zookeeperReconfig.pdf
Binary file not shown.
Binary file modified docs/zookeeperStarted.pdf
Binary file not shown.
Binary file modified docs/zookeeperTutorial.pdf
Binary file not shown.
4 changes: 3 additions & 1 deletion ivy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,10 @@

<dependency org="net.java.dev.javacc" name="javacc" rev="5.0" />

<dependency org="org.mortbay.jetty" name="jetty" rev="6.1.26"
<dependency org="org.eclipse.jetty" name="jetty-server" rev="9.2.18.v20160721"
conf="optional->default"/>
<dependency org="org.eclipse.jetty" name="jetty-servlet" rev="9.2.18.v20160721"
conf="optional->default"/>
<dependency org="org.codehaus.jackson" name="jackson-mapper-asl" rev="1.9.11"
conf="optional->default"/>
</dependencies>
Expand Down
4 changes: 2 additions & 2 deletions src/contrib/loggraph/ivy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@

<!-- transitive false turns off dependency checking, log4j deps seem borked -->
<dependency org="log4j" name="log4j" rev="1.2.17" transitive="false"/>
<dependency org="org.eclipse.jetty" name="jetty-server" rev="7.0.1.v20091125" />
<dependency org="org.eclipse.jetty" name="jetty-servlet" rev="7.0.1.v20091125" />
<dependency org="org.eclipse.jetty" name="jetty-server" rev="9.2.18.v20160721" />
<dependency org="org.eclipse.jetty" name="jetty-servlet" rev="9.2.18.v20160721" />
<dependency org="com.googlecode.json-simple" name="json-simple" rev="1.1" />
</dependencies>

Expand Down
13 changes: 13 additions & 0 deletions src/docs/src/documentation/content/xdocs/zookeeperAdmin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1531,6 +1531,19 @@ server.3=zoo3:2888:3888</programlisting>
</listitem>
</varlistentry>

<varlistentry>
<term>admin.idleTimeout</term>

<listitem>
<para>(Java system property: <emphasis
role="bold">zookeeper.admin.idleTimeout</emphasis>)</para>

<para>Set the maximum idle time in milliseconds that a connection can wait
before sending or receiving data. Defaults to 30000 ms.</para>
</listitem>
</varlistentry>


<varlistentry>
<term>admin.commandURL</term>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@
import javax.servlet.http.HttpServletResponse;

import org.apache.zookeeper.server.ZooKeeperServer;
import org.mortbay.jetty.Server;
import org.mortbay.jetty.nio.SelectChannelConnector;
import org.mortbay.jetty.servlet.Context;
import org.mortbay.jetty.servlet.ServletHolder;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.ServletHolder;
import org.eclipse.jetty.server.ServerConnector;
import org.eclipse.jetty.servlet.ServletContextHandler;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -55,36 +56,42 @@ public class JettyAdminServer implements AdminServer {
static final Logger LOG = LoggerFactory.getLogger(JettyAdminServer.class);

public static final int DEFAULT_PORT = 8080;
private static final String DEFAULT_ADDRESS = "0.0.0.0";
public static final int DEFAULT_IDLE_TIMEOUT = 30000;
public static final String DEFAULT_COMMAND_URL = "/commands";
private static final String DEFAULT_ADDRESS = "0.0.0.0";

private final Server server;
private ZooKeeperServer zkServer;
private final String address;
private final int port;
private String address;
private final int idleTimeout;
private final String commandUrl;
private ZooKeeperServer zkServer;

public JettyAdminServer() throws AdminServerException {
this(System.getProperty("zookeeper.admin.serverAddress",
DEFAULT_ADDRESS), Integer.getInteger(
"zookeeper.admin.serverPort", DEFAULT_PORT), System
.getProperty("zookeeper.admin.commandURL", DEFAULT_COMMAND_URL));
this(System.getProperty("zookeeper.admin.serverAddress", DEFAULT_ADDRESS),
Integer.getInteger("zookeeper.admin.serverPort", DEFAULT_PORT),
Integer.getInteger("zookeeper.admin.idleTimeout", DEFAULT_IDLE_TIMEOUT),
System.getProperty("zookeeper.admin.commandURL", DEFAULT_COMMAND_URL));
}

public JettyAdminServer(String address, int port, String commandUrl) {
public JettyAdminServer(String address, int port, int timeout, String commandUrl) {
this.port = port;
this.idleTimeout = timeout;
this.commandUrl = commandUrl;
this.address = address;

server = new Server();
SelectChannelConnector connector = new SelectChannelConnector();
ServerConnector connector = new ServerConnector(server);
connector.setHost(address);
connector.setPort(port);
connector.setIdleTimeout(idleTimeout);
server.addConnector(connector);
Context context = new Context(server, "/");

ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
context.setContextPath("/*");
server.setHandler(context);
context.addServlet(new ServletHolder(new CommandServlet()), commandUrl
+ "/*");

context.addServlet(new ServletHolder(new CommandServlet()), commandUrl + "/*");
}

/**
Expand Down Expand Up @@ -149,7 +156,7 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response) t
// No command specified, print links to all commands instead
for (String link : commandLinks()) {
response.getWriter().println(link);
response.getWriter().println("<br />");
response.getWriter().println("<br/>");
}
return;
}
Expand Down

0 comments on commit eab677a

Please sign in to comment.