Skip to content

Instantly share code, notes, and snippets.

@gregw
gregw / TimeoutExample.java
Last active June 24, 2021 14:09
Timeout Listener Example
//
// ========================================================================
// Copyright (c) 1995-2017 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
@gregw
gregw / logui
Created January 13, 2017 04:15
[2010] git log --all --graph --decorate --pretty='format:%C(yellow)%h%d %Cblue[%an]%Creset %s' | head -200
* 8921e3e (origin/master, origin/HEAD) [Simone Bordet] Merged branch 'jetty-9.4.x' into 'master'.
|\
| * df08f7f (origin/jetty-9.4.x) [Simone Bordet] Merged branch 'jetty-9.3.x' into 'jetty-9.4.x'.
| |\
| | * 2a416bb (HEAD -> jetty-9.3.x, origin/jetty-9.3.x) [Simone Bordet] Issue #1073 - JDK9 support in Jetty 9.3.x.
* | | f96939a [Simone Bordet] Fixed merge issues.
* | | b7b3dfd [Simone Bordet] Merged branch 'jetty-9.4.x' into 'master'.
|\ \ \
| |/ /
//
// ========================================================================
// 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
@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()
@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 / 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 / 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@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 / 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,
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;