Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-dev] SPDY NPN without -Xbootclasspath


I don't see the attach API going anywhere, certainly not java.lang.instrument.

This solution does require a JDK with tools.jar though, that might be a limitation.

How about attempting instrumentation then falling back to logging a descriptive message about how to use bootclasspath if it fails?

Eirik.

Den 6. sep. 2013 01:12 skrev "Joakim Erdfelt" <joakim@xxxxxxxxxxx> følgende:
Quite cool.
Wonder how future proof these techniques are though?


--
Joakim Erdfelt <joakim@xxxxxxxxxxx>
Expert advice, services and support from from the Jetty & CometD experts


On Thu, Sep 5, 2013 at 4:00 PM, Eirik Bjørsnøs <eirbjo@xxxxxxxxx> wrote:

Hi,

Investigating SPDY support for JettyConsole (a Maven plugin embedding Jetty into runnable .war-files), I found a way to add SPDY support without setting -Xbootclasspath on the command line.

It involves attaching to the current JVM and then loading a JVM agent.

The agent adds a ClassFileTransformer. When the SSL classes in NPN-boot are loaded, the NPN-boot bytes are returned instead of the JVM's bytes.

Here's the complete implementation of the SPDY plugin for JettyConsole:


The loading of the agent happens in the bootstrap() method here:


And the JVM agent itself is here:


It all seems to work, although I've only tested this on my Mac so far.

I think avoiding the bootclasspath hassle could help increase SPDY adoption. WDTY? Any interest in doing something similar in Jetty? 

Thanks,
Eirik. 

 

_______________________________________________
jetty-dev mailing list
jetty-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jetty-dev



_______________________________________________
jetty-dev mailing list
jetty-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jetty-dev


Back to the top