Skip to content

Instantly share code, notes, and snippets.

public class OneServletContext
{
public static void main( String[] args ) throws Exception
{
Server server = new Server(8080);
ServletContextHandler context = new ServletContextHandler(
ServletContextHandler.SESSIONS);
((ErrorPageErrorHandler)context.getErrorHandler()).addErrorPage(404,"/some/uri/for/404");
@gregw
gregw / IssueRegexTest.java
Created August 3, 2016 04:03
Test of IssueRegex
package org.eclipse.jetty.embedded;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.junit.Assert;
import org.junit.Test;
package org.eclipse.jetty.embedded;
import java.io.IOException;
import java.net.Socket;
import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@gregw
gregw / VmApiProxyEnvironment.diff
Created August 17, 2016 22:55
Diff for traceid in VmApiProxyEnvironment
diff --git a/appengine-managed-runtime/src/main/java/com/google/apphosting/vmruntime/VmApiProxyEnvironment.java b/appengine-managed-runtime/src/main/java/com/google/apphosting/vmruntime/VmApiProxyEnvironment.java
index 2a0f347..9c776b8 100644
--- a/appengine-managed-runtime/src/main/java/com/google/apphosting/vmruntime/VmApiProxyEnvironment.java
+++ b/appengine-managed-runtime/src/main/java/com/google/apphosting/vmruntime/VmApiProxyEnvironment.java
@@ -329,6 +329,7 @@ public class VmApiProxyEnvironment implements ApiProxy.Environment {
server,
ticket,
longAppId,
+ null,
partition,
gregw@Tile440: /tmp
[2092] mkdir test
gregw@Tile440: /tmp
[2093] cd test
gregw@Tile440: /tmp/test
[2094] export JETTY_HOME=~/src/jetty-9.3.x/jetty-distribution/target/distribution
gregw@Tile440: /tmp/test
@gregw
gregw / JmxAppExample.java
Created September 7, 2016 01:08
JMX application example
package org.eclipse.jetty.jmx;
import java.lang.management.ManagementFactory;
import java.util.concurrent.CountDownLatch;
import org.eclipse.jetty.util.annotation.ManagedAttribute;
import org.eclipse.jetty.util.annotation.ManagedObject;
import org.eclipse.jetty.util.annotation.ManagedOperation;
import org.eclipse.jetty.util.component.ContainerLifeCycle;
import org.eclipse.jetty.util.component.LifeCycle;
@gregw
gregw / JmxAppExample-alt.java
Created September 7, 2016 01:13
Alternative
package org.eclipse.jetty.jmx;
import java.lang.management.ManagementFactory;
import java.util.concurrent.CountDownLatch;
import org.eclipse.jetty.util.annotation.ManagedAttribute;
import org.eclipse.jetty.util.annotation.ManagedObject;
import org.eclipse.jetty.util.annotation.ManagedOperation;
import org.eclipse.jetty.util.component.ContainerLifeCycle;
import org.eclipse.jetty.util.component.LifeCycle;
@gregw
gregw / ProfileExample.java
Last active September 7, 2016 01:58
Profile example
LoadGeneratorProfile sample =
new LoadGeneratorProfile.Builder()
.resource("/index.html")
.then()
.resourceGroup(new ResourceGroup.Builder()
.resourceGroup(new ResourceGroup.Builder()
.resource( "/style.css" )
.then()
.resourceGroup(new ResourceGroup.Builder()
.resource( "/logo.gif" )
@gregw
gregw / diff
Created November 9, 2016 22:08
diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java b/jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java
index 20e6c2b..3ef3994 100644
--- a/jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java
+++ b/jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java
@@ -944,11 +944,41 @@ public class SslConnection extends AbstractConnection
getEndPoint().close();
}
}
+
+ Callback _nonBlockingReadCallback = new Callback.NonBlocking()
//
// ========================================================================
// Copyright (c) 1995-2016 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
// and Apache License v2.0 which accompanies this distribution.
//
// The Eclipse Public License is available at
// http://www.eclipse.org/legal/epl-v10.html