From 4e8406f62dc9b9245c602680ae18ab18f646f6af Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Mon, 8 Apr 2013 08:20:58 +1000 Subject: [PATCH 01/30] Updating VERSION.txt top section --- VERSION.txt | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 79 insertions(+), 4 deletions(-) diff --git a/VERSION.txt b/VERSION.txt index a6c48bbedcc..469bedfbad8 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1,3 +1,78 @@ +jetty-9.0.1.v20130408 - 08 April 2013 + + 384552 add comment to jetty-https.xml describing keymanager password + + 385488 non existing resources in collection are just warnings + + 392129 fixed merged of handling of timeouts after startAsync + + 393971 Improve setParentLoaderPriorty javadoc + + 393972 Improve WebAppContext classloading javadoc + + 395620 do not managed inherited life cycle listeners + + 396562 Add an implementation of RequestLog that supports Slf4j + + 399967 Destroyables destroyed on undeploy and shutdown hook + + 400142 ConcurrentModificationException in JDBC SessionManger + + 400144 When loading a session fails the JDBCSessionManger produces duplicate + session IDs + + 400689 Add support for Proxy authentication. + + 401150 close input stream used from cached resource + + 401806 spdy push properly pass through request and response headers for + pushed resources + + 402397 InputStreamResponseListener early close inputStream cause hold lock. + + 402485 reseed secure random + + 402626 Do not required endpoint host checking by default in server and + configure in client + + 402666 Improve handling of TLS exceptions due to raw socket close. + + 402694 setuid as LifeCycle listener + + 402706 HttpSession.setMaxInactiveInterval(int) does not change JDBCSession + expiry + + 402726 WebAppContext references old WebSocket packages in system and server + classes + + 402735 jetty.sh to support status which is == check + + 402757 WebSocket client module can't be used with WebSocket server module in + the same WAR. + + 402833 Test harness for global error page and hide exception message from + reason string + + 402844 STOP.PORT & STOP.KEY behaviour has changed + + 402982 Premature initialization of Servlets + + 402984 WebSocket Upgrade must honor case insensitive header fields in + upgrade request + + 403122 Session replication fails with ClassNotFoundException when session + attribute is Java dynamic proxy + + 403280 Update to javax.el 2.2.4 + + 403281 jetty.sh waits for started or failure before returning + + 403370 move frameBytes.fail() call in StandardSession.flush() outside the + synchronized block to avoid deadlock + + 403373 WebSocket change timeout log level from warn -> info + + 403380 Introduce WebSocketTimeoutException to differentiate between EOF on + write and Timeout + + 403451 Review synchronization in SslConnection. + + 403510 HttpSession maxInactiveInterval is not serialized in HashSession + + 403513 jetty:run goal cannot be executed twice during the maven build + + 403570 Asynchronous Request Logging + + 403591 do not use the ConcurrentArrayBlockingQueue for thread pool, selector + and async request log + + 403817 Use of WebSocket Session.close() results in invalid status code + + 404029 port jetty-monitor to jetty-9 and activate it + + 404036 JDBCSessionIdManager.doStart() method should not call + cleanExpiredSessions() because Listeners can't be notified + + 404067 If cannot connect to db fail startup of JDBCSessionIdManager + + 404128 Add Vary headers rather than set them + + 404176 Jetty's AnnotationConfiguration class does not scan non-jar resources + on the container classpath + + 404204 Exception from inputstream cause hang or timeout. + + 404283 org.eclipse.jetty.util.Scanner.scanFile() dies with an NPE if + listFiles() returns null + + 404323 Improved parameterization of https and SPDY + + 404325 data constraint redirection does send default port + + 404326 set status when Request.setHandled(true) is called + + 404511 Replaced all StringMap usage with Tries + + 404517 Close connection if request received after half close + + 404610 Reintroduce ability to disallow TLS renegotiation. + + 404757 SPDY can only be built with the latest JDK version. + + 404789 Support IPv6 addresses in DoSFilter white list. + + 404881 Allow regexs for SslContextFactory.setIncludeCipherSuites() and + .setExcludeCipherSuites() + + 404889 SelectorManager accepts attachments with sockets + + 404958 Fixed Resource.newSystemResource striped / handling + + 405044 Query parameters lost for non GET or POST. + jetty-9.0.0.v20130308 - 08 March 2013 + 399070 add updated version of npn-boot jar to start.ini + 399799 do not hold lock while calling invalidation listeners @@ -34,10 +109,10 @@ jetty-9.0.0.v20130308 - 08 March 2013 upstream server. Fix several other small proxy issues + 402316 HttpReceiver and null pointer exception. + 402341 Host with default port causes redirects loop. - + 402726 WebAppContext references old WebSocket packages in system and - server classes - + 402757 WebSocket client module can't be used with WebSocket server - module in the same WAR + + 402726 WebAppContext references old WebSocket packages in system and server + classes + + 402757 WebSocket client module can't be used with WebSocket server module in + the same WAR jetty-8.1.10.v20130312 - 12 March 2013 + 376273 Early EOF because of SSL Protocol Error on From 1395675f218a3241017bad058fc9fd08ba07ce5f Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Mon, 8 Apr 2013 11:23:41 +1000 Subject: [PATCH 02/30] Updating VERSION.txt top section --- VERSION.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/VERSION.txt b/VERSION.txt index 469bedfbad8..11204d44a69 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -37,6 +37,7 @@ jetty-9.0.1.v20130408 - 08 April 2013 attribute is Java dynamic proxy + 403280 Update to javax.el 2.2.4 + 403281 jetty.sh waits for started or failure before returning + + 403360 Named connectors + 403370 move frameBytes.fail() call in StandardSession.flush() outside the synchronized block to avoid deadlock + 403373 WebSocket change timeout log level from warn -> info @@ -70,6 +71,7 @@ jetty-9.0.1.v20130408 - 08 April 2013 + 404881 Allow regexs for SslContextFactory.setIncludeCipherSuites() and .setExcludeCipherSuites() + 404889 SelectorManager accepts attachments with sockets + + 404906 servlets with load-on-startup = 0 are not fired up on jetty 9 startup + 404958 Fixed Resource.newSystemResource striped / handling + 405044 Query parameters lost for non GET or POST. From bf3771904b133d3e30e3a5f60a8d85a616728668 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Mon, 8 Apr 2013 12:30:59 +1000 Subject: [PATCH 03/30] [maven-release-plugin] prepare release jetty-9.0.1.v20130408 --- aggregates/jetty-all/pom.xml | 2 +- examples/async-rest/async-rest-jar/pom.xml | 2 +- examples/async-rest/async-rest-webapp/pom.xml | 2 +- examples/async-rest/pom.xml | 2 +- examples/embedded/pom.xml | 2 +- examples/pom.xml | 2 +- jetty-annotations/pom.xml | 2 +- jetty-ant/pom.xml | 2 +- jetty-client/pom.xml | 2 +- jetty-continuation/pom.xml | 2 +- jetty-deploy/pom.xml | 2 +- jetty-distribution/pom.xml | 2 +- jetty-http/pom.xml | 2 +- jetty-io/pom.xml | 2 +- jetty-jaas/pom.xml | 2 +- jetty-jaspi/pom.xml | 2 +- jetty-jmx/pom.xml | 2 +- jetty-jndi/pom.xml | 2 +- jetty-jsp/pom.xml | 2 +- jetty-jspc-maven-plugin/pom.xml | 2 +- jetty-maven-plugin/pom.xml | 2 +- jetty-monitor/pom.xml | 2 +- jetty-nosql/pom.xml | 2 +- jetty-osgi/jetty-osgi-boot-jsp/pom.xml | 2 +- jetty-osgi/jetty-osgi-boot-warurl/pom.xml | 2 +- jetty-osgi/jetty-osgi-boot/pom.xml | 2 +- jetty-osgi/jetty-osgi-httpservice/pom.xml | 2 +- jetty-osgi/jetty-osgi-npn/pom.xml | 5 ++--- jetty-osgi/pom.xml | 2 +- jetty-osgi/test-jetty-osgi-context/pom.xml | 2 +- jetty-osgi/test-jetty-osgi-webapp/pom.xml | 2 +- jetty-osgi/test-jetty-osgi/pom.xml | 2 +- jetty-plus/pom.xml | 2 +- jetty-proxy/pom.xml | 2 +- jetty-rewrite/pom.xml | 2 +- jetty-runner/pom.xml | 2 +- jetty-security/pom.xml | 2 +- jetty-server/pom.xml | 2 +- jetty-servlet/pom.xml | 2 +- jetty-servlets/pom.xml | 2 +- jetty-spdy/pom.xml | 2 +- jetty-spdy/spdy-client/pom.xml | 2 +- jetty-spdy/spdy-core/pom.xml | 2 +- jetty-spdy/spdy-example-webapp/pom.xml | 2 +- jetty-spdy/spdy-http-server/pom.xml | 2 +- jetty-spdy/spdy-server/pom.xml | 2 +- jetty-spring/pom.xml | 2 +- jetty-start/pom.xml | 2 +- jetty-util-ajax/pom.xml | 2 +- jetty-util/pom.xml | 2 +- jetty-webapp/pom.xml | 2 +- jetty-websocket/pom.xml | 2 +- jetty-websocket/websocket-api/pom.xml | 2 +- jetty-websocket/websocket-client/pom.xml | 2 +- jetty-websocket/websocket-common/pom.xml | 2 +- jetty-websocket/websocket-server/pom.xml | 2 +- jetty-websocket/websocket-servlet/pom.xml | 2 +- jetty-xml/pom.xml | 2 +- pom.xml | 2 +- tests/pom.xml | 2 +- tests/test-continuation/pom.xml | 2 +- tests/test-loginservice/pom.xml | 2 +- tests/test-sessions/pom.xml | 2 +- tests/test-sessions/test-hash-sessions/pom.xml | 2 +- tests/test-sessions/test-jdbc-sessions/pom.xml | 2 +- tests/test-sessions/test-sessions-common/pom.xml | 2 +- tests/test-webapps/pom.xml | 2 +- tests/test-webapps/test-jaas-webapp/pom.xml | 2 +- tests/test-webapps/test-jetty-webapp/pom.xml | 2 +- tests/test-webapps/test-jndi-webapp/pom.xml | 2 +- tests/test-webapps/test-mock-resources/pom.xml | 2 +- tests/test-webapps/test-proxy-webapp/pom.xml | 2 +- tests/test-webapps/test-servlet-spec/pom.xml | 2 +- .../test-servlet-spec/test-container-initializer/pom.xml | 2 +- .../test-webapps/test-servlet-spec/test-spec-webapp/pom.xml | 2 +- .../test-webapps/test-servlet-spec/test-web-fragment/pom.xml | 2 +- tests/test-webapps/test-webapp-rfc2616/pom.xml | 2 +- 77 files changed, 78 insertions(+), 79 deletions(-) diff --git a/aggregates/jetty-all/pom.xml b/aggregates/jetty-all/pom.xml index 60119e901cc..5823339aa32 100644 --- a/aggregates/jetty-all/pom.xml +++ b/aggregates/jetty-all/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1-SNAPSHOT + 9.0.1.v20130408 ../../pom.xml 4.0.0 diff --git a/examples/async-rest/async-rest-jar/pom.xml b/examples/async-rest/async-rest-jar/pom.xml index a05b4317d30..fcdcc6ce513 100644 --- a/examples/async-rest/async-rest-jar/pom.xml +++ b/examples/async-rest/async-rest-jar/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty example-async-rest - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 org.eclipse.jetty.example-async-rest diff --git a/examples/async-rest/async-rest-webapp/pom.xml b/examples/async-rest/async-rest-webapp/pom.xml index ce07e8f57cf..e74869f1b70 100644 --- a/examples/async-rest/async-rest-webapp/pom.xml +++ b/examples/async-rest/async-rest-webapp/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty example-async-rest - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 org.eclipse.jetty.example-async-rest diff --git a/examples/async-rest/pom.xml b/examples/async-rest/pom.xml index 7118c514f45..f92695f5799 100644 --- a/examples/async-rest/pom.xml +++ b/examples/async-rest/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty.examples examples-parent - 9.0.1-SNAPSHOT + 9.0.1.v20130408 ../pom.xml 4.0.0 diff --git a/examples/embedded/pom.xml b/examples/embedded/pom.xml index 02b939bc8a9..46847053306 100644 --- a/examples/embedded/pom.xml +++ b/examples/embedded/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty.examples examples-parent - 9.0.1-SNAPSHOT + 9.0.1.v20130408 ../pom.xml 4.0.0 diff --git a/examples/pom.xml b/examples/pom.xml index f93d56691be..a25c12a70a1 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -21,7 +21,7 @@ org.eclipse.jetty jetty-project - 9.0.1-SNAPSHOT + 9.0.1.v20130408 ../pom.xml org.eclipse.jetty.examples diff --git a/jetty-annotations/pom.xml b/jetty-annotations/pom.xml index ad08f181eea..6afcc7c8c2c 100644 --- a/jetty-annotations/pom.xml +++ b/jetty-annotations/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 jetty-annotations diff --git a/jetty-ant/pom.xml b/jetty-ant/pom.xml index fb55b416ad1..dfd484c818d 100755 --- a/jetty-ant/pom.xml +++ b/jetty-ant/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 jetty-ant diff --git a/jetty-client/pom.xml b/jetty-client/pom.xml index bac85514e3b..e8a7f0edcd8 100644 --- a/jetty-client/pom.xml +++ b/jetty-client/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 diff --git a/jetty-continuation/pom.xml b/jetty-continuation/pom.xml index 544e3fd4bd4..dd785ce50de 100644 --- a/jetty-continuation/pom.xml +++ b/jetty-continuation/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 jetty-continuation diff --git a/jetty-deploy/pom.xml b/jetty-deploy/pom.xml index cc8a10e9562..47bc93e1dc0 100644 --- a/jetty-deploy/pom.xml +++ b/jetty-deploy/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 jetty-deploy diff --git a/jetty-distribution/pom.xml b/jetty-distribution/pom.xml index 3f9ba0a3a37..b453c6f6a74 100644 --- a/jetty-distribution/pom.xml +++ b/jetty-distribution/pom.xml @@ -3,7 +3,7 @@ org.eclipse.jetty jetty-project - 9.0.1-SNAPSHOT + 9.0.1.v20130408 jetty-distribution Jetty :: Distribution Assemblies diff --git a/jetty-http/pom.xml b/jetty-http/pom.xml index 5b5585fbfca..ae6524d30b9 100644 --- a/jetty-http/pom.xml +++ b/jetty-http/pom.xml @@ -3,7 +3,7 @@ jetty-project org.eclipse.jetty - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 jetty-http diff --git a/jetty-io/pom.xml b/jetty-io/pom.xml index 2c9377e3b3b..b4895d575bf 100644 --- a/jetty-io/pom.xml +++ b/jetty-io/pom.xml @@ -2,7 +2,7 @@ jetty-project org.eclipse.jetty - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 jetty-io diff --git a/jetty-jaas/pom.xml b/jetty-jaas/pom.xml index c90b92f7f79..dd0ab2cfa17 100644 --- a/jetty-jaas/pom.xml +++ b/jetty-jaas/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 jetty-jaas diff --git a/jetty-jaspi/pom.xml b/jetty-jaspi/pom.xml index ab7f0bf98e9..776590710cf 100644 --- a/jetty-jaspi/pom.xml +++ b/jetty-jaspi/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 jetty-jaspi diff --git a/jetty-jmx/pom.xml b/jetty-jmx/pom.xml index 45ee56ccc53..da1f505c865 100644 --- a/jetty-jmx/pom.xml +++ b/jetty-jmx/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 jetty-jmx diff --git a/jetty-jndi/pom.xml b/jetty-jndi/pom.xml index 29f8774ef9e..02a54067ea5 100644 --- a/jetty-jndi/pom.xml +++ b/jetty-jndi/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 jetty-jndi diff --git a/jetty-jsp/pom.xml b/jetty-jsp/pom.xml index 57377556c6a..bab9c28ed7f 100644 --- a/jetty-jsp/pom.xml +++ b/jetty-jsp/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 jetty-jsp diff --git a/jetty-jspc-maven-plugin/pom.xml b/jetty-jspc-maven-plugin/pom.xml index 59b3671af5a..e3cdcbf9368 100644 --- a/jetty-jspc-maven-plugin/pom.xml +++ b/jetty-jspc-maven-plugin/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 jetty-jspc-maven-plugin diff --git a/jetty-maven-plugin/pom.xml b/jetty-maven-plugin/pom.xml index c19c48fd33e..97ee7834db7 100644 --- a/jetty-maven-plugin/pom.xml +++ b/jetty-maven-plugin/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 jetty-maven-plugin diff --git a/jetty-monitor/pom.xml b/jetty-monitor/pom.xml index ee63fa2a0b7..0bf8be43073 100644 --- a/jetty-monitor/pom.xml +++ b/jetty-monitor/pom.xml @@ -19,7 +19,7 @@ org.eclipse.jetty jetty-project - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 jetty-monitor diff --git a/jetty-nosql/pom.xml b/jetty-nosql/pom.xml index f395758fefd..ade6dcbe8ae 100644 --- a/jetty-nosql/pom.xml +++ b/jetty-nosql/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 jetty-nosql diff --git a/jetty-osgi/jetty-osgi-boot-jsp/pom.xml b/jetty-osgi/jetty-osgi-boot-jsp/pom.xml index f207055f8ee..1648b488da2 100644 --- a/jetty-osgi/jetty-osgi-boot-jsp/pom.xml +++ b/jetty-osgi/jetty-osgi-boot-jsp/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty.osgi jetty-osgi-project - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 jetty-osgi-boot-jsp diff --git a/jetty-osgi/jetty-osgi-boot-warurl/pom.xml b/jetty-osgi/jetty-osgi-boot-warurl/pom.xml index 59ce3cc2c7e..b46cf20be9a 100644 --- a/jetty-osgi/jetty-osgi-boot-warurl/pom.xml +++ b/jetty-osgi/jetty-osgi-boot-warurl/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty.osgi jetty-osgi-project - 9.0.1-SNAPSHOT + 9.0.1.v20130408 ../pom.xml 4.0.0 diff --git a/jetty-osgi/jetty-osgi-boot/pom.xml b/jetty-osgi/jetty-osgi-boot/pom.xml index 703ca929969..db4095dae16 100644 --- a/jetty-osgi/jetty-osgi-boot/pom.xml +++ b/jetty-osgi/jetty-osgi-boot/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty.osgi jetty-osgi-project - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 jetty-osgi-boot diff --git a/jetty-osgi/jetty-osgi-httpservice/pom.xml b/jetty-osgi/jetty-osgi-httpservice/pom.xml index 93c42f58913..f47f42969ce 100644 --- a/jetty-osgi/jetty-osgi-httpservice/pom.xml +++ b/jetty-osgi/jetty-osgi-httpservice/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty.osgi jetty-osgi-project - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 jetty-httpservice diff --git a/jetty-osgi/jetty-osgi-npn/pom.xml b/jetty-osgi/jetty-osgi-npn/pom.xml index 1d71cbb72b7..c39de07d0c8 100644 --- a/jetty-osgi/jetty-osgi-npn/pom.xml +++ b/jetty-osgi/jetty-osgi-npn/pom.xml @@ -1,9 +1,8 @@ - + org.eclipse.jetty.osgi jetty-osgi-project - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 jetty-osgi-npn diff --git a/jetty-osgi/pom.xml b/jetty-osgi/pom.xml index 0e98d1d2f55..1baab71e47a 100644 --- a/jetty-osgi/pom.xml +++ b/jetty-osgi/pom.xml @@ -3,7 +3,7 @@ org.eclipse.jetty jetty-project - 9.0.1-SNAPSHOT + 9.0.1.v20130408 org.eclipse.jetty.osgi jetty-osgi-project diff --git a/jetty-osgi/test-jetty-osgi-context/pom.xml b/jetty-osgi/test-jetty-osgi-context/pom.xml index 8b4eecc922e..39679176cff 100644 --- a/jetty-osgi/test-jetty-osgi-context/pom.xml +++ b/jetty-osgi/test-jetty-osgi-context/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty.osgi jetty-osgi-project - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 test-jetty-osgi-context diff --git a/jetty-osgi/test-jetty-osgi-webapp/pom.xml b/jetty-osgi/test-jetty-osgi-webapp/pom.xml index b3ea3e6804d..02a184d3cfa 100644 --- a/jetty-osgi/test-jetty-osgi-webapp/pom.xml +++ b/jetty-osgi/test-jetty-osgi-webapp/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty.osgi jetty-osgi-project - 9.0.1-SNAPSHOT + 9.0.1.v20130408 ../pom.xml 4.0.0 diff --git a/jetty-osgi/test-jetty-osgi/pom.xml b/jetty-osgi/test-jetty-osgi/pom.xml index b8822babf8e..9d1a769c87d 100644 --- a/jetty-osgi/test-jetty-osgi/pom.xml +++ b/jetty-osgi/test-jetty-osgi/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty.osgi jetty-osgi-project - 9.0.1-SNAPSHOT + 9.0.1.v20130408 ../pom.xml 4.0.0 diff --git a/jetty-plus/pom.xml b/jetty-plus/pom.xml index 4aeff7593ad..307d130a222 100644 --- a/jetty-plus/pom.xml +++ b/jetty-plus/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 jetty-plus diff --git a/jetty-proxy/pom.xml b/jetty-proxy/pom.xml index 0ea659742d9..788e70f4a5a 100644 --- a/jetty-proxy/pom.xml +++ b/jetty-proxy/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 jetty-proxy diff --git a/jetty-rewrite/pom.xml b/jetty-rewrite/pom.xml index 30b159373ff..6bea44b3c37 100644 --- a/jetty-rewrite/pom.xml +++ b/jetty-rewrite/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 jetty-rewrite diff --git a/jetty-runner/pom.xml b/jetty-runner/pom.xml index c1b42e92ca5..8d2df7c1fbf 100644 --- a/jetty-runner/pom.xml +++ b/jetty-runner/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 org.eclipse.jetty diff --git a/jetty-security/pom.xml b/jetty-security/pom.xml index a13eef15438..78d882b56ab 100644 --- a/jetty-security/pom.xml +++ b/jetty-security/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 jetty-security diff --git a/jetty-server/pom.xml b/jetty-server/pom.xml index b3637c28943..d66bbea39e1 100644 --- a/jetty-server/pom.xml +++ b/jetty-server/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 jetty-server diff --git a/jetty-servlet/pom.xml b/jetty-servlet/pom.xml index bcc92b29cba..1789cd9b1d2 100644 --- a/jetty-servlet/pom.xml +++ b/jetty-servlet/pom.xml @@ -3,7 +3,7 @@ jetty-project org.eclipse.jetty - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 jetty-servlet diff --git a/jetty-servlets/pom.xml b/jetty-servlets/pom.xml index 61e55afb373..14c3f6d2cdf 100644 --- a/jetty-servlets/pom.xml +++ b/jetty-servlets/pom.xml @@ -3,7 +3,7 @@ jetty-project org.eclipse.jetty - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 jetty-servlets diff --git a/jetty-spdy/pom.xml b/jetty-spdy/pom.xml index 0a237216da0..8642b1b52b4 100644 --- a/jetty-spdy/pom.xml +++ b/jetty-spdy/pom.xml @@ -3,7 +3,7 @@ org.eclipse.jetty jetty-project - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 diff --git a/jetty-spdy/spdy-client/pom.xml b/jetty-spdy/spdy-client/pom.xml index 30609a1d1d1..486998c534a 100644 --- a/jetty-spdy/spdy-client/pom.xml +++ b/jetty-spdy/spdy-client/pom.xml @@ -3,7 +3,7 @@ org.eclipse.jetty.spdy spdy-parent - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 diff --git a/jetty-spdy/spdy-core/pom.xml b/jetty-spdy/spdy-core/pom.xml index 520c59220c7..fe7e18caeb9 100644 --- a/jetty-spdy/spdy-core/pom.xml +++ b/jetty-spdy/spdy-core/pom.xml @@ -3,7 +3,7 @@ org.eclipse.jetty.spdy spdy-parent - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 diff --git a/jetty-spdy/spdy-example-webapp/pom.xml b/jetty-spdy/spdy-example-webapp/pom.xml index 33bc39a9534..94d43add8dd 100644 --- a/jetty-spdy/spdy-example-webapp/pom.xml +++ b/jetty-spdy/spdy-example-webapp/pom.xml @@ -3,7 +3,7 @@ org.eclipse.jetty.spdy spdy-parent - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 spdy-example-webapp diff --git a/jetty-spdy/spdy-http-server/pom.xml b/jetty-spdy/spdy-http-server/pom.xml index a130ca48bbb..502b9d8d42b 100644 --- a/jetty-spdy/spdy-http-server/pom.xml +++ b/jetty-spdy/spdy-http-server/pom.xml @@ -3,7 +3,7 @@ org.eclipse.jetty.spdy spdy-parent - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 spdy-http-server diff --git a/jetty-spdy/spdy-server/pom.xml b/jetty-spdy/spdy-server/pom.xml index 9d7be564893..e8df7636970 100644 --- a/jetty-spdy/spdy-server/pom.xml +++ b/jetty-spdy/spdy-server/pom.xml @@ -3,7 +3,7 @@ org.eclipse.jetty.spdy spdy-parent - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 diff --git a/jetty-spring/pom.xml b/jetty-spring/pom.xml index d2ec7c59a54..e61e382d1f6 100644 --- a/jetty-spring/pom.xml +++ b/jetty-spring/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 jetty-spring diff --git a/jetty-start/pom.xml b/jetty-start/pom.xml index 4a4ac6a85e3..f25e78ea7cd 100644 --- a/jetty-start/pom.xml +++ b/jetty-start/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 jetty-start diff --git a/jetty-util-ajax/pom.xml b/jetty-util-ajax/pom.xml index a65273d8b41..a0ad9a5a3cb 100644 --- a/jetty-util-ajax/pom.xml +++ b/jetty-util-ajax/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 jetty-util-ajax diff --git a/jetty-util/pom.xml b/jetty-util/pom.xml index 0fb30cf2917..1ad8730678d 100644 --- a/jetty-util/pom.xml +++ b/jetty-util/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 jetty-util diff --git a/jetty-webapp/pom.xml b/jetty-webapp/pom.xml index a1c8e4e5213..98b992c8550 100644 --- a/jetty-webapp/pom.xml +++ b/jetty-webapp/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 jetty-webapp diff --git a/jetty-websocket/pom.xml b/jetty-websocket/pom.xml index bbd5cee2133..4825e3e0991 100644 --- a/jetty-websocket/pom.xml +++ b/jetty-websocket/pom.xml @@ -3,7 +3,7 @@ jetty-project org.eclipse.jetty - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 diff --git a/jetty-websocket/websocket-api/pom.xml b/jetty-websocket/websocket-api/pom.xml index 5dceaec9cff..f079d2971d0 100644 --- a/jetty-websocket/websocket-api/pom.xml +++ b/jetty-websocket/websocket-api/pom.xml @@ -3,7 +3,7 @@ org.eclipse.jetty.websocket websocket-parent - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 diff --git a/jetty-websocket/websocket-client/pom.xml b/jetty-websocket/websocket-client/pom.xml index b06b251c330..e3a8b79c5db 100644 --- a/jetty-websocket/websocket-client/pom.xml +++ b/jetty-websocket/websocket-client/pom.xml @@ -3,7 +3,7 @@ org.eclipse.jetty.websocket websocket-parent - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 diff --git a/jetty-websocket/websocket-common/pom.xml b/jetty-websocket/websocket-common/pom.xml index aec3c9538d9..57c8a36c005 100644 --- a/jetty-websocket/websocket-common/pom.xml +++ b/jetty-websocket/websocket-common/pom.xml @@ -3,7 +3,7 @@ org.eclipse.jetty.websocket websocket-parent - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 diff --git a/jetty-websocket/websocket-server/pom.xml b/jetty-websocket/websocket-server/pom.xml index 1a779271b09..78b23b46809 100644 --- a/jetty-websocket/websocket-server/pom.xml +++ b/jetty-websocket/websocket-server/pom.xml @@ -3,7 +3,7 @@ org.eclipse.jetty.websocket websocket-parent - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 diff --git a/jetty-websocket/websocket-servlet/pom.xml b/jetty-websocket/websocket-servlet/pom.xml index e989fa8e4e1..38db4f46e58 100644 --- a/jetty-websocket/websocket-servlet/pom.xml +++ b/jetty-websocket/websocket-servlet/pom.xml @@ -3,7 +3,7 @@ org.eclipse.jetty.websocket websocket-parent - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 diff --git a/jetty-xml/pom.xml b/jetty-xml/pom.xml index 111f47ab135..4a97b401856 100644 --- a/jetty-xml/pom.xml +++ b/jetty-xml/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1-SNAPSHOT + 9.0.1.v20130408 4.0.0 jetty-xml diff --git a/pom.xml b/pom.xml index 733160f6877..7567c5bc5a2 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ 20 jetty-project - 9.0.1-SNAPSHOT + 9.0.1.v20130408 Jetty :: Project ${jetty.url} pom diff --git a/tests/pom.xml b/tests/pom.xml index fff3d3ad067..f3926c4a987 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -21,7 +21,7 @@ org.eclipse.jetty jetty-project - 9.0.1-SNAPSHOT + 9.0.1.v20130408 ../pom.xml org.eclipse.jetty.tests diff --git a/tests/test-continuation/pom.xml b/tests/test-continuation/pom.xml index c63dceb0293..2b754641e37 100644 --- a/tests/test-continuation/pom.xml +++ b/tests/test-continuation/pom.xml @@ -20,7 +20,7 @@ org.eclipse.jetty.tests tests-parent - 9.0.1-SNAPSHOT + 9.0.1.v20130408 ../pom.xml 4.0.0 diff --git a/tests/test-loginservice/pom.xml b/tests/test-loginservice/pom.xml index ef098c40d57..7798aed2de2 100644 --- a/tests/test-loginservice/pom.xml +++ b/tests/test-loginservice/pom.xml @@ -21,7 +21,7 @@ org.eclipse.jetty.tests tests-parent - 9.0.1-SNAPSHOT + 9.0.1.v20130408 test-loginservice Jetty Tests :: Login Service diff --git a/tests/test-sessions/pom.xml b/tests/test-sessions/pom.xml index a9262e0d026..cee39091070 100644 --- a/tests/test-sessions/pom.xml +++ b/tests/test-sessions/pom.xml @@ -21,7 +21,7 @@ org.eclipse.jetty.tests tests-parent - 9.0.1-SNAPSHOT + 9.0.1.v20130408 test-sessions-parent Jetty Tests :: Sessions :: Parent diff --git a/tests/test-sessions/test-hash-sessions/pom.xml b/tests/test-sessions/test-hash-sessions/pom.xml index 995656f33e4..19aa6b07077 100644 --- a/tests/test-sessions/test-hash-sessions/pom.xml +++ b/tests/test-sessions/test-hash-sessions/pom.xml @@ -21,7 +21,7 @@ org.eclipse.jetty.tests test-sessions-parent - 9.0.1-SNAPSHOT + 9.0.1.v20130408 test-hash-sessions Jetty Tests :: Sessions :: Hash diff --git a/tests/test-sessions/test-jdbc-sessions/pom.xml b/tests/test-sessions/test-jdbc-sessions/pom.xml index 286b537fd07..5d5b683aac3 100644 --- a/tests/test-sessions/test-jdbc-sessions/pom.xml +++ b/tests/test-sessions/test-jdbc-sessions/pom.xml @@ -21,7 +21,7 @@ org.eclipse.jetty.tests test-sessions-parent - 9.0.1-SNAPSHOT + 9.0.1.v20130408 test-jdbc-sessions Jetty Tests :: Sessions :: JDBC diff --git a/tests/test-sessions/test-sessions-common/pom.xml b/tests/test-sessions/test-sessions-common/pom.xml index 37ea24b7141..33374f055e1 100644 --- a/tests/test-sessions/test-sessions-common/pom.xml +++ b/tests/test-sessions/test-sessions-common/pom.xml @@ -21,7 +21,7 @@ org.eclipse.jetty.tests test-sessions-parent - 9.0.1-SNAPSHOT + 9.0.1.v20130408 test-sessions-common Jetty Tests :: Sessions :: Common diff --git a/tests/test-webapps/pom.xml b/tests/test-webapps/pom.xml index e51971915a4..861af4c1a01 100644 --- a/tests/test-webapps/pom.xml +++ b/tests/test-webapps/pom.xml @@ -21,7 +21,7 @@ org.eclipse.jetty.tests tests-parent - 9.0.1-SNAPSHOT + 9.0.1.v20130408 ../pom.xml test-webapps-parent diff --git a/tests/test-webapps/test-jaas-webapp/pom.xml b/tests/test-webapps/test-jaas-webapp/pom.xml index e77d24a1426..10250e37538 100644 --- a/tests/test-webapps/test-jaas-webapp/pom.xml +++ b/tests/test-webapps/test-jaas-webapp/pom.xml @@ -4,7 +4,7 @@ org.eclipse.jetty.tests test-webapps-parent - 9.0.1-SNAPSHOT + 9.0.1.v20130408 test-jaas-webapp Jetty Tests :: WebApp :: JAAS diff --git a/tests/test-webapps/test-jetty-webapp/pom.xml b/tests/test-webapps/test-jetty-webapp/pom.xml index ced7efba93f..fa92bbc56f1 100644 --- a/tests/test-webapps/test-jetty-webapp/pom.xml +++ b/tests/test-webapps/test-jetty-webapp/pom.xml @@ -20,7 +20,7 @@ org.eclipse.jetty.tests test-webapps-parent - 9.0.1-SNAPSHOT + 9.0.1.v20130408 ../pom.xml 4.0.0 diff --git a/tests/test-webapps/test-jndi-webapp/pom.xml b/tests/test-webapps/test-jndi-webapp/pom.xml index dbc081f8298..ae2652cc183 100644 --- a/tests/test-webapps/test-jndi-webapp/pom.xml +++ b/tests/test-webapps/test-jndi-webapp/pom.xml @@ -4,7 +4,7 @@ org.eclipse.jetty.tests test-webapps-parent - 9.0.1-SNAPSHOT + 9.0.1.v20130408 test-jndi-webapp Jetty Tests :: WebApp :: JNDI diff --git a/tests/test-webapps/test-mock-resources/pom.xml b/tests/test-webapps/test-mock-resources/pom.xml index 4ed362d52fd..6e19f34f452 100644 --- a/tests/test-webapps/test-mock-resources/pom.xml +++ b/tests/test-webapps/test-mock-resources/pom.xml @@ -3,7 +3,7 @@ org.eclipse.jetty.tests test-webapps-parent - 9.0.1-SNAPSHOT + 9.0.1.v20130408 Jetty Tests :: WebApp :: Mock Resources test-mock-resources diff --git a/tests/test-webapps/test-proxy-webapp/pom.xml b/tests/test-webapps/test-proxy-webapp/pom.xml index 5e36a0daadc..b074b6c3b26 100644 --- a/tests/test-webapps/test-proxy-webapp/pom.xml +++ b/tests/test-webapps/test-proxy-webapp/pom.xml @@ -20,7 +20,7 @@ org.eclipse.jetty.tests test-webapps-parent - 9.0.1-SNAPSHOT + 9.0.1.v20130408 ../pom.xml 4.0.0 diff --git a/tests/test-webapps/test-servlet-spec/pom.xml b/tests/test-webapps/test-servlet-spec/pom.xml index be5640df7e0..f93c6c27ca4 100644 --- a/tests/test-webapps/test-servlet-spec/pom.xml +++ b/tests/test-webapps/test-servlet-spec/pom.xml @@ -4,7 +4,7 @@ org.eclipse.jetty.tests test-webapps-parent - 9.0.1-SNAPSHOT + 9.0.1.v20130408 test-servlet-spec-parent Jetty Tests :: Spec Test WebApp :: Parent diff --git a/tests/test-webapps/test-servlet-spec/test-container-initializer/pom.xml b/tests/test-webapps/test-servlet-spec/test-container-initializer/pom.xml index c990e0ea10d..36b1028e5b3 100644 --- a/tests/test-webapps/test-servlet-spec/test-container-initializer/pom.xml +++ b/tests/test-webapps/test-servlet-spec/test-container-initializer/pom.xml @@ -3,7 +3,7 @@ org.eclipse.jetty.tests test-servlet-spec-parent - 9.0.1-SNAPSHOT + 9.0.1.v20130408 test-container-initializer jar diff --git a/tests/test-webapps/test-servlet-spec/test-spec-webapp/pom.xml b/tests/test-webapps/test-servlet-spec/test-spec-webapp/pom.xml index 81884809951..170fb31cd03 100644 --- a/tests/test-webapps/test-servlet-spec/test-spec-webapp/pom.xml +++ b/tests/test-webapps/test-servlet-spec/test-spec-webapp/pom.xml @@ -4,7 +4,7 @@ org.eclipse.jetty.tests test-servlet-spec-parent - 9.0.1-SNAPSHOT + 9.0.1.v20130408 Jetty Tests :: Webapps :: Spec Webapp test-spec-webapp diff --git a/tests/test-webapps/test-servlet-spec/test-web-fragment/pom.xml b/tests/test-webapps/test-servlet-spec/test-web-fragment/pom.xml index 785816ae773..42b73c3351b 100644 --- a/tests/test-webapps/test-servlet-spec/test-web-fragment/pom.xml +++ b/tests/test-webapps/test-servlet-spec/test-web-fragment/pom.xml @@ -3,7 +3,7 @@ org.eclipse.jetty.tests test-servlet-spec-parent - 9.0.1-SNAPSHOT + 9.0.1.v20130408 Jetty Tests :: WebApp :: Servlet Spec :: Fragment Jar org.eclipse.jetty.tests diff --git a/tests/test-webapps/test-webapp-rfc2616/pom.xml b/tests/test-webapps/test-webapp-rfc2616/pom.xml index 627211a7878..e2339e1bd98 100644 --- a/tests/test-webapps/test-webapp-rfc2616/pom.xml +++ b/tests/test-webapps/test-webapp-rfc2616/pom.xml @@ -21,7 +21,7 @@ org.eclipse.jetty.tests test-webapps-parent - 9.0.1-SNAPSHOT + 9.0.1.v20130408 test-webapp-rfc2616 Jetty Tests :: WebApp :: RFC2616 From b8dd8bde142e0bbfaae399a97ead1323081d0c91 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Mon, 8 Apr 2013 12:31:34 +1000 Subject: [PATCH 04/30] [maven-release-plugin] prepare for next development iteration --- aggregates/jetty-all/pom.xml | 2 +- examples/async-rest/async-rest-jar/pom.xml | 2 +- examples/async-rest/async-rest-webapp/pom.xml | 2 +- examples/async-rest/pom.xml | 2 +- examples/embedded/pom.xml | 2 +- examples/pom.xml | 2 +- jetty-annotations/pom.xml | 2 +- jetty-ant/pom.xml | 2 +- jetty-client/pom.xml | 2 +- jetty-continuation/pom.xml | 2 +- jetty-deploy/pom.xml | 2 +- jetty-distribution/pom.xml | 2 +- jetty-http/pom.xml | 2 +- jetty-io/pom.xml | 2 +- jetty-jaas/pom.xml | 2 +- jetty-jaspi/pom.xml | 2 +- jetty-jmx/pom.xml | 2 +- jetty-jndi/pom.xml | 2 +- jetty-jsp/pom.xml | 2 +- jetty-jspc-maven-plugin/pom.xml | 2 +- jetty-maven-plugin/pom.xml | 2 +- jetty-monitor/pom.xml | 2 +- jetty-nosql/pom.xml | 2 +- jetty-osgi/jetty-osgi-boot-jsp/pom.xml | 2 +- jetty-osgi/jetty-osgi-boot-warurl/pom.xml | 2 +- jetty-osgi/jetty-osgi-boot/pom.xml | 2 +- jetty-osgi/jetty-osgi-httpservice/pom.xml | 2 +- jetty-osgi/jetty-osgi-npn/pom.xml | 2 +- jetty-osgi/pom.xml | 2 +- jetty-osgi/test-jetty-osgi-context/pom.xml | 2 +- jetty-osgi/test-jetty-osgi-webapp/pom.xml | 2 +- jetty-osgi/test-jetty-osgi/pom.xml | 2 +- jetty-plus/pom.xml | 2 +- jetty-proxy/pom.xml | 2 +- jetty-rewrite/pom.xml | 2 +- jetty-runner/pom.xml | 2 +- jetty-security/pom.xml | 2 +- jetty-server/pom.xml | 2 +- jetty-servlet/pom.xml | 2 +- jetty-servlets/pom.xml | 2 +- jetty-spdy/pom.xml | 2 +- jetty-spdy/spdy-client/pom.xml | 2 +- jetty-spdy/spdy-core/pom.xml | 2 +- jetty-spdy/spdy-example-webapp/pom.xml | 2 +- jetty-spdy/spdy-http-server/pom.xml | 2 +- jetty-spdy/spdy-server/pom.xml | 2 +- jetty-spring/pom.xml | 2 +- jetty-start/pom.xml | 2 +- jetty-util-ajax/pom.xml | 2 +- jetty-util/pom.xml | 2 +- jetty-webapp/pom.xml | 2 +- jetty-websocket/pom.xml | 2 +- jetty-websocket/websocket-api/pom.xml | 2 +- jetty-websocket/websocket-client/pom.xml | 2 +- jetty-websocket/websocket-common/pom.xml | 2 +- jetty-websocket/websocket-server/pom.xml | 2 +- jetty-websocket/websocket-servlet/pom.xml | 2 +- jetty-xml/pom.xml | 2 +- pom.xml | 2 +- tests/pom.xml | 2 +- tests/test-continuation/pom.xml | 2 +- tests/test-loginservice/pom.xml | 2 +- tests/test-sessions/pom.xml | 2 +- tests/test-sessions/test-hash-sessions/pom.xml | 2 +- tests/test-sessions/test-jdbc-sessions/pom.xml | 2 +- tests/test-sessions/test-sessions-common/pom.xml | 2 +- tests/test-webapps/pom.xml | 2 +- tests/test-webapps/test-jaas-webapp/pom.xml | 2 +- tests/test-webapps/test-jetty-webapp/pom.xml | 2 +- tests/test-webapps/test-jndi-webapp/pom.xml | 2 +- tests/test-webapps/test-mock-resources/pom.xml | 2 +- tests/test-webapps/test-proxy-webapp/pom.xml | 2 +- tests/test-webapps/test-servlet-spec/pom.xml | 2 +- .../test-servlet-spec/test-container-initializer/pom.xml | 2 +- tests/test-webapps/test-servlet-spec/test-spec-webapp/pom.xml | 2 +- tests/test-webapps/test-servlet-spec/test-web-fragment/pom.xml | 2 +- tests/test-webapps/test-webapp-rfc2616/pom.xml | 2 +- 77 files changed, 77 insertions(+), 77 deletions(-) diff --git a/aggregates/jetty-all/pom.xml b/aggregates/jetty-all/pom.xml index 5823339aa32..882005c056f 100644 --- a/aggregates/jetty-all/pom.xml +++ b/aggregates/jetty-all/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1.v20130408 + 9.0.2-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/examples/async-rest/async-rest-jar/pom.xml b/examples/async-rest/async-rest-jar/pom.xml index fcdcc6ce513..62097b117d9 100644 --- a/examples/async-rest/async-rest-jar/pom.xml +++ b/examples/async-rest/async-rest-jar/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty example-async-rest - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 org.eclipse.jetty.example-async-rest diff --git a/examples/async-rest/async-rest-webapp/pom.xml b/examples/async-rest/async-rest-webapp/pom.xml index e74869f1b70..127fc14e6b6 100644 --- a/examples/async-rest/async-rest-webapp/pom.xml +++ b/examples/async-rest/async-rest-webapp/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty example-async-rest - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 org.eclipse.jetty.example-async-rest diff --git a/examples/async-rest/pom.xml b/examples/async-rest/pom.xml index f92695f5799..082de5c4909 100644 --- a/examples/async-rest/pom.xml +++ b/examples/async-rest/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty.examples examples-parent - 9.0.1.v20130408 + 9.0.2-SNAPSHOT ../pom.xml 4.0.0 diff --git a/examples/embedded/pom.xml b/examples/embedded/pom.xml index 46847053306..498e11d16b9 100644 --- a/examples/embedded/pom.xml +++ b/examples/embedded/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty.examples examples-parent - 9.0.1.v20130408 + 9.0.2-SNAPSHOT ../pom.xml 4.0.0 diff --git a/examples/pom.xml b/examples/pom.xml index a25c12a70a1..a5d95ba7bbe 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -21,7 +21,7 @@ org.eclipse.jetty jetty-project - 9.0.1.v20130408 + 9.0.2-SNAPSHOT ../pom.xml org.eclipse.jetty.examples diff --git a/jetty-annotations/pom.xml b/jetty-annotations/pom.xml index 6afcc7c8c2c..32bb8c6ce13 100644 --- a/jetty-annotations/pom.xml +++ b/jetty-annotations/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 jetty-annotations diff --git a/jetty-ant/pom.xml b/jetty-ant/pom.xml index dfd484c818d..80f05c5573c 100755 --- a/jetty-ant/pom.xml +++ b/jetty-ant/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 jetty-ant diff --git a/jetty-client/pom.xml b/jetty-client/pom.xml index e8a7f0edcd8..c1236c389b9 100644 --- a/jetty-client/pom.xml +++ b/jetty-client/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 diff --git a/jetty-continuation/pom.xml b/jetty-continuation/pom.xml index dd785ce50de..283782b4dfa 100644 --- a/jetty-continuation/pom.xml +++ b/jetty-continuation/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 jetty-continuation diff --git a/jetty-deploy/pom.xml b/jetty-deploy/pom.xml index 47bc93e1dc0..55848f5ca29 100644 --- a/jetty-deploy/pom.xml +++ b/jetty-deploy/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 jetty-deploy diff --git a/jetty-distribution/pom.xml b/jetty-distribution/pom.xml index b453c6f6a74..dfe828f73b4 100644 --- a/jetty-distribution/pom.xml +++ b/jetty-distribution/pom.xml @@ -3,7 +3,7 @@ org.eclipse.jetty jetty-project - 9.0.1.v20130408 + 9.0.2-SNAPSHOT jetty-distribution Jetty :: Distribution Assemblies diff --git a/jetty-http/pom.xml b/jetty-http/pom.xml index ae6524d30b9..1403df18ffa 100644 --- a/jetty-http/pom.xml +++ b/jetty-http/pom.xml @@ -3,7 +3,7 @@ jetty-project org.eclipse.jetty - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 jetty-http diff --git a/jetty-io/pom.xml b/jetty-io/pom.xml index b4895d575bf..24eedb6d312 100644 --- a/jetty-io/pom.xml +++ b/jetty-io/pom.xml @@ -2,7 +2,7 @@ jetty-project org.eclipse.jetty - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 jetty-io diff --git a/jetty-jaas/pom.xml b/jetty-jaas/pom.xml index dd0ab2cfa17..974d960b873 100644 --- a/jetty-jaas/pom.xml +++ b/jetty-jaas/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 jetty-jaas diff --git a/jetty-jaspi/pom.xml b/jetty-jaspi/pom.xml index 776590710cf..4ed1f95456b 100644 --- a/jetty-jaspi/pom.xml +++ b/jetty-jaspi/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 jetty-jaspi diff --git a/jetty-jmx/pom.xml b/jetty-jmx/pom.xml index da1f505c865..dd2813f4884 100644 --- a/jetty-jmx/pom.xml +++ b/jetty-jmx/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 jetty-jmx diff --git a/jetty-jndi/pom.xml b/jetty-jndi/pom.xml index 02a54067ea5..e58d8f62575 100644 --- a/jetty-jndi/pom.xml +++ b/jetty-jndi/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 jetty-jndi diff --git a/jetty-jsp/pom.xml b/jetty-jsp/pom.xml index bab9c28ed7f..9f109d2d190 100644 --- a/jetty-jsp/pom.xml +++ b/jetty-jsp/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 jetty-jsp diff --git a/jetty-jspc-maven-plugin/pom.xml b/jetty-jspc-maven-plugin/pom.xml index e3cdcbf9368..2d2ae6bd189 100644 --- a/jetty-jspc-maven-plugin/pom.xml +++ b/jetty-jspc-maven-plugin/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 jetty-jspc-maven-plugin diff --git a/jetty-maven-plugin/pom.xml b/jetty-maven-plugin/pom.xml index 97ee7834db7..1cc716c0e87 100644 --- a/jetty-maven-plugin/pom.xml +++ b/jetty-maven-plugin/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 jetty-maven-plugin diff --git a/jetty-monitor/pom.xml b/jetty-monitor/pom.xml index 0bf8be43073..2704f7efaa0 100644 --- a/jetty-monitor/pom.xml +++ b/jetty-monitor/pom.xml @@ -19,7 +19,7 @@ org.eclipse.jetty jetty-project - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 jetty-monitor diff --git a/jetty-nosql/pom.xml b/jetty-nosql/pom.xml index ade6dcbe8ae..cf8ca808f73 100644 --- a/jetty-nosql/pom.xml +++ b/jetty-nosql/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 jetty-nosql diff --git a/jetty-osgi/jetty-osgi-boot-jsp/pom.xml b/jetty-osgi/jetty-osgi-boot-jsp/pom.xml index 1648b488da2..335b98f173a 100644 --- a/jetty-osgi/jetty-osgi-boot-jsp/pom.xml +++ b/jetty-osgi/jetty-osgi-boot-jsp/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty.osgi jetty-osgi-project - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 jetty-osgi-boot-jsp diff --git a/jetty-osgi/jetty-osgi-boot-warurl/pom.xml b/jetty-osgi/jetty-osgi-boot-warurl/pom.xml index b46cf20be9a..5927ad51364 100644 --- a/jetty-osgi/jetty-osgi-boot-warurl/pom.xml +++ b/jetty-osgi/jetty-osgi-boot-warurl/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty.osgi jetty-osgi-project - 9.0.1.v20130408 + 9.0.2-SNAPSHOT ../pom.xml 4.0.0 diff --git a/jetty-osgi/jetty-osgi-boot/pom.xml b/jetty-osgi/jetty-osgi-boot/pom.xml index db4095dae16..a630b1f33d1 100644 --- a/jetty-osgi/jetty-osgi-boot/pom.xml +++ b/jetty-osgi/jetty-osgi-boot/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty.osgi jetty-osgi-project - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 jetty-osgi-boot diff --git a/jetty-osgi/jetty-osgi-httpservice/pom.xml b/jetty-osgi/jetty-osgi-httpservice/pom.xml index f47f42969ce..d5fd13a9423 100644 --- a/jetty-osgi/jetty-osgi-httpservice/pom.xml +++ b/jetty-osgi/jetty-osgi-httpservice/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty.osgi jetty-osgi-project - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 jetty-httpservice diff --git a/jetty-osgi/jetty-osgi-npn/pom.xml b/jetty-osgi/jetty-osgi-npn/pom.xml index c39de07d0c8..0515eaa6f1f 100644 --- a/jetty-osgi/jetty-osgi-npn/pom.xml +++ b/jetty-osgi/jetty-osgi-npn/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty.osgi jetty-osgi-project - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 jetty-osgi-npn diff --git a/jetty-osgi/pom.xml b/jetty-osgi/pom.xml index 1baab71e47a..bcf99908049 100644 --- a/jetty-osgi/pom.xml +++ b/jetty-osgi/pom.xml @@ -3,7 +3,7 @@ org.eclipse.jetty jetty-project - 9.0.1.v20130408 + 9.0.2-SNAPSHOT org.eclipse.jetty.osgi jetty-osgi-project diff --git a/jetty-osgi/test-jetty-osgi-context/pom.xml b/jetty-osgi/test-jetty-osgi-context/pom.xml index 39679176cff..03634fd691f 100644 --- a/jetty-osgi/test-jetty-osgi-context/pom.xml +++ b/jetty-osgi/test-jetty-osgi-context/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty.osgi jetty-osgi-project - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 test-jetty-osgi-context diff --git a/jetty-osgi/test-jetty-osgi-webapp/pom.xml b/jetty-osgi/test-jetty-osgi-webapp/pom.xml index 02a184d3cfa..444840f4272 100644 --- a/jetty-osgi/test-jetty-osgi-webapp/pom.xml +++ b/jetty-osgi/test-jetty-osgi-webapp/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty.osgi jetty-osgi-project - 9.0.1.v20130408 + 9.0.2-SNAPSHOT ../pom.xml 4.0.0 diff --git a/jetty-osgi/test-jetty-osgi/pom.xml b/jetty-osgi/test-jetty-osgi/pom.xml index 9d1a769c87d..5d1a89a2e81 100644 --- a/jetty-osgi/test-jetty-osgi/pom.xml +++ b/jetty-osgi/test-jetty-osgi/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty.osgi jetty-osgi-project - 9.0.1.v20130408 + 9.0.2-SNAPSHOT ../pom.xml 4.0.0 diff --git a/jetty-plus/pom.xml b/jetty-plus/pom.xml index 307d130a222..d1bacea52f1 100644 --- a/jetty-plus/pom.xml +++ b/jetty-plus/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 jetty-plus diff --git a/jetty-proxy/pom.xml b/jetty-proxy/pom.xml index 788e70f4a5a..77cbd92f0a2 100644 --- a/jetty-proxy/pom.xml +++ b/jetty-proxy/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 jetty-proxy diff --git a/jetty-rewrite/pom.xml b/jetty-rewrite/pom.xml index 6bea44b3c37..481106d5514 100644 --- a/jetty-rewrite/pom.xml +++ b/jetty-rewrite/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 jetty-rewrite diff --git a/jetty-runner/pom.xml b/jetty-runner/pom.xml index 8d2df7c1fbf..ec57a92de62 100644 --- a/jetty-runner/pom.xml +++ b/jetty-runner/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 org.eclipse.jetty diff --git a/jetty-security/pom.xml b/jetty-security/pom.xml index 78d882b56ab..9aa83c79ae5 100644 --- a/jetty-security/pom.xml +++ b/jetty-security/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 jetty-security diff --git a/jetty-server/pom.xml b/jetty-server/pom.xml index d66bbea39e1..009618f3005 100644 --- a/jetty-server/pom.xml +++ b/jetty-server/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 jetty-server diff --git a/jetty-servlet/pom.xml b/jetty-servlet/pom.xml index 1789cd9b1d2..552e4b2ccb6 100644 --- a/jetty-servlet/pom.xml +++ b/jetty-servlet/pom.xml @@ -3,7 +3,7 @@ jetty-project org.eclipse.jetty - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 jetty-servlet diff --git a/jetty-servlets/pom.xml b/jetty-servlets/pom.xml index 14c3f6d2cdf..d6bcfcabeba 100644 --- a/jetty-servlets/pom.xml +++ b/jetty-servlets/pom.xml @@ -3,7 +3,7 @@ jetty-project org.eclipse.jetty - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 jetty-servlets diff --git a/jetty-spdy/pom.xml b/jetty-spdy/pom.xml index 8642b1b52b4..7b3020bd0e8 100644 --- a/jetty-spdy/pom.xml +++ b/jetty-spdy/pom.xml @@ -3,7 +3,7 @@ org.eclipse.jetty jetty-project - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 diff --git a/jetty-spdy/spdy-client/pom.xml b/jetty-spdy/spdy-client/pom.xml index 486998c534a..9bb89aeaea5 100644 --- a/jetty-spdy/spdy-client/pom.xml +++ b/jetty-spdy/spdy-client/pom.xml @@ -3,7 +3,7 @@ org.eclipse.jetty.spdy spdy-parent - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 diff --git a/jetty-spdy/spdy-core/pom.xml b/jetty-spdy/spdy-core/pom.xml index fe7e18caeb9..3bd7e717b3c 100644 --- a/jetty-spdy/spdy-core/pom.xml +++ b/jetty-spdy/spdy-core/pom.xml @@ -3,7 +3,7 @@ org.eclipse.jetty.spdy spdy-parent - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 diff --git a/jetty-spdy/spdy-example-webapp/pom.xml b/jetty-spdy/spdy-example-webapp/pom.xml index 94d43add8dd..37830b28be2 100644 --- a/jetty-spdy/spdy-example-webapp/pom.xml +++ b/jetty-spdy/spdy-example-webapp/pom.xml @@ -3,7 +3,7 @@ org.eclipse.jetty.spdy spdy-parent - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 spdy-example-webapp diff --git a/jetty-spdy/spdy-http-server/pom.xml b/jetty-spdy/spdy-http-server/pom.xml index 502b9d8d42b..c3ec31e2f2f 100644 --- a/jetty-spdy/spdy-http-server/pom.xml +++ b/jetty-spdy/spdy-http-server/pom.xml @@ -3,7 +3,7 @@ org.eclipse.jetty.spdy spdy-parent - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 spdy-http-server diff --git a/jetty-spdy/spdy-server/pom.xml b/jetty-spdy/spdy-server/pom.xml index e8df7636970..0bd4ca8974b 100644 --- a/jetty-spdy/spdy-server/pom.xml +++ b/jetty-spdy/spdy-server/pom.xml @@ -3,7 +3,7 @@ org.eclipse.jetty.spdy spdy-parent - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 diff --git a/jetty-spring/pom.xml b/jetty-spring/pom.xml index e61e382d1f6..97e3aa46caf 100644 --- a/jetty-spring/pom.xml +++ b/jetty-spring/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 jetty-spring diff --git a/jetty-start/pom.xml b/jetty-start/pom.xml index f25e78ea7cd..240d08cebbc 100644 --- a/jetty-start/pom.xml +++ b/jetty-start/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 jetty-start diff --git a/jetty-util-ajax/pom.xml b/jetty-util-ajax/pom.xml index a0ad9a5a3cb..05c6bd87975 100644 --- a/jetty-util-ajax/pom.xml +++ b/jetty-util-ajax/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 jetty-util-ajax diff --git a/jetty-util/pom.xml b/jetty-util/pom.xml index 1ad8730678d..da84d14590f 100644 --- a/jetty-util/pom.xml +++ b/jetty-util/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 jetty-util diff --git a/jetty-webapp/pom.xml b/jetty-webapp/pom.xml index 98b992c8550..f397e92005e 100644 --- a/jetty-webapp/pom.xml +++ b/jetty-webapp/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 jetty-webapp diff --git a/jetty-websocket/pom.xml b/jetty-websocket/pom.xml index 4825e3e0991..d5895b189d2 100644 --- a/jetty-websocket/pom.xml +++ b/jetty-websocket/pom.xml @@ -3,7 +3,7 @@ jetty-project org.eclipse.jetty - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 diff --git a/jetty-websocket/websocket-api/pom.xml b/jetty-websocket/websocket-api/pom.xml index f079d2971d0..f8500469f32 100644 --- a/jetty-websocket/websocket-api/pom.xml +++ b/jetty-websocket/websocket-api/pom.xml @@ -3,7 +3,7 @@ org.eclipse.jetty.websocket websocket-parent - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 diff --git a/jetty-websocket/websocket-client/pom.xml b/jetty-websocket/websocket-client/pom.xml index e3a8b79c5db..ae009463dd4 100644 --- a/jetty-websocket/websocket-client/pom.xml +++ b/jetty-websocket/websocket-client/pom.xml @@ -3,7 +3,7 @@ org.eclipse.jetty.websocket websocket-parent - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 diff --git a/jetty-websocket/websocket-common/pom.xml b/jetty-websocket/websocket-common/pom.xml index 57c8a36c005..eb052381ad2 100644 --- a/jetty-websocket/websocket-common/pom.xml +++ b/jetty-websocket/websocket-common/pom.xml @@ -3,7 +3,7 @@ org.eclipse.jetty.websocket websocket-parent - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 diff --git a/jetty-websocket/websocket-server/pom.xml b/jetty-websocket/websocket-server/pom.xml index 78b23b46809..a3103d41dbd 100644 --- a/jetty-websocket/websocket-server/pom.xml +++ b/jetty-websocket/websocket-server/pom.xml @@ -3,7 +3,7 @@ org.eclipse.jetty.websocket websocket-parent - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 diff --git a/jetty-websocket/websocket-servlet/pom.xml b/jetty-websocket/websocket-servlet/pom.xml index 38db4f46e58..d919917a4a4 100644 --- a/jetty-websocket/websocket-servlet/pom.xml +++ b/jetty-websocket/websocket-servlet/pom.xml @@ -3,7 +3,7 @@ org.eclipse.jetty.websocket websocket-parent - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 diff --git a/jetty-xml/pom.xml b/jetty-xml/pom.xml index 4a97b401856..d8a39e8c6b6 100644 --- a/jetty-xml/pom.xml +++ b/jetty-xml/pom.xml @@ -2,7 +2,7 @@ org.eclipse.jetty jetty-project - 9.0.1.v20130408 + 9.0.2-SNAPSHOT 4.0.0 jetty-xml diff --git a/pom.xml b/pom.xml index 7567c5bc5a2..bf4d1282f2a 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ 20 jetty-project - 9.0.1.v20130408 + 9.0.2-SNAPSHOT Jetty :: Project ${jetty.url} pom diff --git a/tests/pom.xml b/tests/pom.xml index f3926c4a987..707898b0c6f 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -21,7 +21,7 @@ org.eclipse.jetty jetty-project - 9.0.1.v20130408 + 9.0.2-SNAPSHOT ../pom.xml org.eclipse.jetty.tests diff --git a/tests/test-continuation/pom.xml b/tests/test-continuation/pom.xml index 2b754641e37..e0da1c44df8 100644 --- a/tests/test-continuation/pom.xml +++ b/tests/test-continuation/pom.xml @@ -20,7 +20,7 @@ org.eclipse.jetty.tests tests-parent - 9.0.1.v20130408 + 9.0.2-SNAPSHOT ../pom.xml 4.0.0 diff --git a/tests/test-loginservice/pom.xml b/tests/test-loginservice/pom.xml index 7798aed2de2..99e5b6d9276 100644 --- a/tests/test-loginservice/pom.xml +++ b/tests/test-loginservice/pom.xml @@ -21,7 +21,7 @@ org.eclipse.jetty.tests tests-parent - 9.0.1.v20130408 + 9.0.2-SNAPSHOT test-loginservice Jetty Tests :: Login Service diff --git a/tests/test-sessions/pom.xml b/tests/test-sessions/pom.xml index cee39091070..dac197644d7 100644 --- a/tests/test-sessions/pom.xml +++ b/tests/test-sessions/pom.xml @@ -21,7 +21,7 @@ org.eclipse.jetty.tests tests-parent - 9.0.1.v20130408 + 9.0.2-SNAPSHOT test-sessions-parent Jetty Tests :: Sessions :: Parent diff --git a/tests/test-sessions/test-hash-sessions/pom.xml b/tests/test-sessions/test-hash-sessions/pom.xml index 19aa6b07077..5a52c042e51 100644 --- a/tests/test-sessions/test-hash-sessions/pom.xml +++ b/tests/test-sessions/test-hash-sessions/pom.xml @@ -21,7 +21,7 @@ org.eclipse.jetty.tests test-sessions-parent - 9.0.1.v20130408 + 9.0.2-SNAPSHOT test-hash-sessions Jetty Tests :: Sessions :: Hash diff --git a/tests/test-sessions/test-jdbc-sessions/pom.xml b/tests/test-sessions/test-jdbc-sessions/pom.xml index 5d5b683aac3..46e03badafd 100644 --- a/tests/test-sessions/test-jdbc-sessions/pom.xml +++ b/tests/test-sessions/test-jdbc-sessions/pom.xml @@ -21,7 +21,7 @@ org.eclipse.jetty.tests test-sessions-parent - 9.0.1.v20130408 + 9.0.2-SNAPSHOT test-jdbc-sessions Jetty Tests :: Sessions :: JDBC diff --git a/tests/test-sessions/test-sessions-common/pom.xml b/tests/test-sessions/test-sessions-common/pom.xml index 33374f055e1..7c7a8b6bff1 100644 --- a/tests/test-sessions/test-sessions-common/pom.xml +++ b/tests/test-sessions/test-sessions-common/pom.xml @@ -21,7 +21,7 @@ org.eclipse.jetty.tests test-sessions-parent - 9.0.1.v20130408 + 9.0.2-SNAPSHOT test-sessions-common Jetty Tests :: Sessions :: Common diff --git a/tests/test-webapps/pom.xml b/tests/test-webapps/pom.xml index 861af4c1a01..f6ae8867f9f 100644 --- a/tests/test-webapps/pom.xml +++ b/tests/test-webapps/pom.xml @@ -21,7 +21,7 @@ org.eclipse.jetty.tests tests-parent - 9.0.1.v20130408 + 9.0.2-SNAPSHOT ../pom.xml test-webapps-parent diff --git a/tests/test-webapps/test-jaas-webapp/pom.xml b/tests/test-webapps/test-jaas-webapp/pom.xml index 10250e37538..fbffd7d94da 100644 --- a/tests/test-webapps/test-jaas-webapp/pom.xml +++ b/tests/test-webapps/test-jaas-webapp/pom.xml @@ -4,7 +4,7 @@ org.eclipse.jetty.tests test-webapps-parent - 9.0.1.v20130408 + 9.0.2-SNAPSHOT test-jaas-webapp Jetty Tests :: WebApp :: JAAS diff --git a/tests/test-webapps/test-jetty-webapp/pom.xml b/tests/test-webapps/test-jetty-webapp/pom.xml index fa92bbc56f1..3ed790b664f 100644 --- a/tests/test-webapps/test-jetty-webapp/pom.xml +++ b/tests/test-webapps/test-jetty-webapp/pom.xml @@ -20,7 +20,7 @@ org.eclipse.jetty.tests test-webapps-parent - 9.0.1.v20130408 + 9.0.2-SNAPSHOT ../pom.xml 4.0.0 diff --git a/tests/test-webapps/test-jndi-webapp/pom.xml b/tests/test-webapps/test-jndi-webapp/pom.xml index ae2652cc183..1587366deff 100644 --- a/tests/test-webapps/test-jndi-webapp/pom.xml +++ b/tests/test-webapps/test-jndi-webapp/pom.xml @@ -4,7 +4,7 @@ org.eclipse.jetty.tests test-webapps-parent - 9.0.1.v20130408 + 9.0.2-SNAPSHOT test-jndi-webapp Jetty Tests :: WebApp :: JNDI diff --git a/tests/test-webapps/test-mock-resources/pom.xml b/tests/test-webapps/test-mock-resources/pom.xml index 6e19f34f452..d57f5420138 100644 --- a/tests/test-webapps/test-mock-resources/pom.xml +++ b/tests/test-webapps/test-mock-resources/pom.xml @@ -3,7 +3,7 @@ org.eclipse.jetty.tests test-webapps-parent - 9.0.1.v20130408 + 9.0.2-SNAPSHOT Jetty Tests :: WebApp :: Mock Resources test-mock-resources diff --git a/tests/test-webapps/test-proxy-webapp/pom.xml b/tests/test-webapps/test-proxy-webapp/pom.xml index b074b6c3b26..04b06d09a9e 100644 --- a/tests/test-webapps/test-proxy-webapp/pom.xml +++ b/tests/test-webapps/test-proxy-webapp/pom.xml @@ -20,7 +20,7 @@ org.eclipse.jetty.tests test-webapps-parent - 9.0.1.v20130408 + 9.0.2-SNAPSHOT ../pom.xml 4.0.0 diff --git a/tests/test-webapps/test-servlet-spec/pom.xml b/tests/test-webapps/test-servlet-spec/pom.xml index f93c6c27ca4..6c61e5743bf 100644 --- a/tests/test-webapps/test-servlet-spec/pom.xml +++ b/tests/test-webapps/test-servlet-spec/pom.xml @@ -4,7 +4,7 @@ org.eclipse.jetty.tests test-webapps-parent - 9.0.1.v20130408 + 9.0.2-SNAPSHOT test-servlet-spec-parent Jetty Tests :: Spec Test WebApp :: Parent diff --git a/tests/test-webapps/test-servlet-spec/test-container-initializer/pom.xml b/tests/test-webapps/test-servlet-spec/test-container-initializer/pom.xml index 36b1028e5b3..37cc04678be 100644 --- a/tests/test-webapps/test-servlet-spec/test-container-initializer/pom.xml +++ b/tests/test-webapps/test-servlet-spec/test-container-initializer/pom.xml @@ -3,7 +3,7 @@ org.eclipse.jetty.tests test-servlet-spec-parent - 9.0.1.v20130408 + 9.0.2-SNAPSHOT test-container-initializer jar diff --git a/tests/test-webapps/test-servlet-spec/test-spec-webapp/pom.xml b/tests/test-webapps/test-servlet-spec/test-spec-webapp/pom.xml index 170fb31cd03..155611fd808 100644 --- a/tests/test-webapps/test-servlet-spec/test-spec-webapp/pom.xml +++ b/tests/test-webapps/test-servlet-spec/test-spec-webapp/pom.xml @@ -4,7 +4,7 @@ org.eclipse.jetty.tests test-servlet-spec-parent - 9.0.1.v20130408 + 9.0.2-SNAPSHOT Jetty Tests :: Webapps :: Spec Webapp test-spec-webapp diff --git a/tests/test-webapps/test-servlet-spec/test-web-fragment/pom.xml b/tests/test-webapps/test-servlet-spec/test-web-fragment/pom.xml index 42b73c3351b..c8dfa1d85ec 100644 --- a/tests/test-webapps/test-servlet-spec/test-web-fragment/pom.xml +++ b/tests/test-webapps/test-servlet-spec/test-web-fragment/pom.xml @@ -3,7 +3,7 @@ org.eclipse.jetty.tests test-servlet-spec-parent - 9.0.1.v20130408 + 9.0.2-SNAPSHOT Jetty Tests :: WebApp :: Servlet Spec :: Fragment Jar org.eclipse.jetty.tests diff --git a/tests/test-webapps/test-webapp-rfc2616/pom.xml b/tests/test-webapps/test-webapp-rfc2616/pom.xml index e2339e1bd98..20e0a0dcc79 100644 --- a/tests/test-webapps/test-webapp-rfc2616/pom.xml +++ b/tests/test-webapps/test-webapp-rfc2616/pom.xml @@ -21,7 +21,7 @@ org.eclipse.jetty.tests test-webapps-parent - 9.0.1.v20130408 + 9.0.2-SNAPSHOT test-webapp-rfc2616 Jetty Tests :: WebApp :: RFC2616 From aa4e79efe2e1db27b86d9c943e1e9af7ef1ba7f3 Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Tue, 9 Apr 2013 23:05:34 +0200 Subject: [PATCH 05/30] Ignoring queue benchmark tests as they take too long to run. --- .../test/java/org/eclipse/jetty/util/QueueBenchmarkTest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/QueueBenchmarkTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/QueueBenchmarkTest.java index 78e2f5c6678..8990102bca4 100644 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/QueueBenchmarkTest.java +++ b/jetty-util/src/test/java/org/eclipse/jetty/util/QueueBenchmarkTest.java @@ -33,9 +33,11 @@ import org.eclipse.jetty.toolchain.test.annotation.Slow; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; import org.junit.Assume; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; +@Ignore @RunWith(AdvancedRunner.class) public class QueueBenchmarkTest { From 6a6660bfc61554966dcdf3ff85199621225b203f Mon Sep 17 00:00:00 2001 From: Thomas Becker Date: Tue, 9 Apr 2013 18:28:55 +0200 Subject: [PATCH 06/30] 405364 spdy imeplement MAX_CONCURRENT_STREAMS --- .../eclipse/jetty/spdy/StandardSession.java | 49 ++++++- .../jetty/spdy/StandardSessionTest.java | 43 +++++-- .../server/http/ReferrerPushStrategyTest.java | 42 ++++-- .../jetty/spdy/server/AbstractTest.java | 6 +- .../spdy/server/MaxConcurrentStreamTest.java | 120 ++++++++++++++++++ 5 files changed, 236 insertions(+), 24 deletions(-) create mode 100644 jetty-spdy/spdy-server/src/test/java/org/eclipse/jetty/spdy/server/MaxConcurrentStreamTest.java diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardSession.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardSession.java index c642050f9e0..a0bda51d2ed 100644 --- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardSession.java +++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardSession.java @@ -110,7 +110,9 @@ public class StandardSession implements ISession, Parser.Listener, Dumpable private final AtomicBoolean goAwaySent = new AtomicBoolean(); private final AtomicBoolean goAwayReceived = new AtomicBoolean(); private final AtomicInteger lastStreamId = new AtomicInteger(); + private final AtomicInteger localStreamCount = new AtomicInteger(0); private final FlowControlStrategy flowControlStrategy; + private volatile int maxConcurrentLocalStreams = -1; private boolean flushing; private Throwable failure; @@ -181,6 +183,8 @@ public class StandardSession implements ISession, Parser.Listener, Dumpable // TODO: for SPDYv3 we need to support the "slot" argument SynStreamFrame synStream = new SynStreamFrame(version, synInfo.getFlags(), streamId, associatedStreamId, synInfo.getPriority(), (short)0, synInfo.getHeaders()); IStream stream = createStream(synStream, listener, true, promise); + if (stream == null) + return; generateAndEnqueueControlFrame(stream, synStream, synInfo.getTimeout(), synInfo.getUnit(), stream); } flush(); @@ -535,15 +539,39 @@ public class StandardSession implements ISession, Parser.Listener, Dumpable } int streamId = stream.getId(); + + if (local) + { + while (true) + { + int oldStreamCountValue = localStreamCount.get(); + int maxConcurrentStreams = maxConcurrentLocalStreams; + if (maxConcurrentStreams > -1 && oldStreamCountValue >= maxConcurrentStreams) + { + String msg = String.format("Max concurrent local streams (%d) exceeded.", + maxConcurrentStreams); + LOG.debug(msg); + promise.failed(new SPDYException(msg)); + return null; + } + if (localStreamCount.compareAndSet(oldStreamCountValue, oldStreamCountValue + 1)) + break; + } + } + if (streams.putIfAbsent(streamId, stream) != null) { + //TODO: fail promise if (local) + { + localStreamCount.decrementAndGet(); throw new IllegalStateException("Duplicate stream id " + streamId); + } RstInfo rstInfo = new RstInfo(streamId, StreamStatus.PROTOCOL_ERROR); LOG.debug("Duplicate stream, {}", rstInfo); try { - rst(rstInfo); + rst(rstInfo); //TODO: non blocking reset or find the reason why blocking is used } catch (InterruptedException | ExecutionException | TimeoutException e) { @@ -554,8 +582,7 @@ public class StandardSession implements ISession, Parser.Listener, Dumpable else { LOG.debug("Created {}", stream); - if (local) - notifyStreamCreated(stream); + notifyStreamCreated(stream); return stream; } } @@ -590,10 +617,15 @@ public class StandardSession implements ISession, Parser.Listener, Dumpable IStream removed = streams.remove(stream.getId()); if (removed != null) + { assert removed == stream; - LOG.debug("Removed {}", stream); - notifyStreamClosed(stream); + if (streamIds.get() % 2 == stream.getId() % 2) + localStreamCount.decrementAndGet(); + + LOG.debug("Removed {}", stream); + notifyStreamClosed(stream); + } } private void notifyStreamClosed(IStream stream) @@ -666,6 +698,13 @@ public class StandardSession implements ISession, Parser.Listener, Dumpable setWindowSize(windowSize); LOG.debug("Updated session window size to {}", windowSize); } + Settings.Setting maxConcurrentStreamsSetting = frame.getSettings().get(Settings.ID.MAX_CONCURRENT_STREAMS); + if (maxConcurrentStreamsSetting != null) + { + int maxConcurrentStreamsValue = maxConcurrentStreamsSetting.value(); + maxConcurrentLocalStreams = maxConcurrentStreamsValue; + LOG.debug("Updated session maxConcurrentLocalStreams to {}", maxConcurrentStreamsValue); + } SettingsInfo settingsInfo = new SettingsInfo(frame.getSettings(), frame.isClearPersisted()); notifyOnSettings(listener, settingsInfo); flush(); diff --git a/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/StandardSessionTest.java b/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/StandardSessionTest.java index 44e56ff5111..813fb0ceb57 100644 --- a/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/StandardSessionTest.java +++ b/jetty-spdy/spdy-core/src/test/java/org/eclipse/jetty/spdy/StandardSessionTest.java @@ -18,15 +18,6 @@ package org.eclipse.jetty.spdy; -import static org.hamcrest.Matchers.greaterThan; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.not; -import static org.junit.Assert.assertThat; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.doAnswer; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; - import java.nio.ByteBuffer; import java.nio.channels.ClosedChannelException; import java.util.HashSet; @@ -47,12 +38,14 @@ import org.eclipse.jetty.spdy.api.PushInfo; import org.eclipse.jetty.spdy.api.RstInfo; import org.eclipse.jetty.spdy.api.SPDY; import org.eclipse.jetty.spdy.api.Session; +import org.eclipse.jetty.spdy.api.Settings; import org.eclipse.jetty.spdy.api.Stream; import org.eclipse.jetty.spdy.api.StreamFrameListener; import org.eclipse.jetty.spdy.api.StreamStatus; import org.eclipse.jetty.spdy.api.StringDataInfo; import org.eclipse.jetty.spdy.api.SynInfo; import org.eclipse.jetty.spdy.frames.DataFrame; +import org.eclipse.jetty.spdy.frames.SettingsFrame; import org.eclipse.jetty.spdy.frames.SynReplyFrame; import org.eclipse.jetty.spdy.frames.SynStreamFrame; import org.eclipse.jetty.spdy.generator.Generator; @@ -74,6 +67,15 @@ import org.mockito.invocation.InvocationOnMock; import org.mockito.runners.MockitoJUnitRunner; import org.mockito.stubbing.Answer; +import static org.hamcrest.Matchers.greaterThan; +import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.not; +import static org.junit.Assert.assertThat; +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.doAnswer; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; + @RunWith(MockitoJUnitRunner.class) public class StandardSessionTest { @@ -457,7 +459,30 @@ public class StandardSessionTest stream.headers(new HeadersInfo(headers, true)); verify(controller, times(3)).write(any(ByteBuffer.class), any(Callback.class)); + } + @Test + public void testMaxConcurrentStreams() throws InterruptedException + { + final CountDownLatch failedBecauseMaxConcurrentStreamsExceeded = new CountDownLatch(1); + + Settings settings = new Settings(); + settings.put(new Settings.Setting(Settings.ID.MAX_CONCURRENT_STREAMS, 0)); + SettingsFrame settingsFrame = new SettingsFrame(VERSION, (byte)0, settings); + session.onControlFrame(settingsFrame); + + PushSynInfo pushSynInfo = new PushSynInfo(1, new PushInfo(new Fields(), false)); + session.syn(pushSynInfo, null, new Promise.Adapter() + { + @Override + public void failed(Throwable x) + { + failedBecauseMaxConcurrentStreamsExceeded.countDown(); + } + }); + + assertThat("Opening push stream failed because maxConcurrentStream is exceeded", + failedBecauseMaxConcurrentStreamsExceeded.await(5, TimeUnit.SECONDS), is(true)); } @Test diff --git a/jetty-spdy/spdy-http-server/src/test/java/org/eclipse/jetty/spdy/server/http/ReferrerPushStrategyTest.java b/jetty-spdy/spdy-http-server/src/test/java/org/eclipse/jetty/spdy/server/http/ReferrerPushStrategyTest.java index f52c87537d8..099f736c1f7 100644 --- a/jetty-spdy/spdy-http-server/src/test/java/org/eclipse/jetty/spdy/server/http/ReferrerPushStrategyTest.java +++ b/jetty-spdy/spdy-http-server/src/test/java/org/eclipse/jetty/spdy/server/http/ReferrerPushStrategyTest.java @@ -101,14 +101,14 @@ public class ReferrerPushStrategyTest extends AbstractHTTPSPDYTest @Test public void testPushHeadersAreValid() throws Exception { - sendMainRequestAndCSSRequest(); + sendMainRequestAndCSSRequest(null); run2ndClientRequests(true, true); } @Test public void testClientResetsPushStreams() throws Exception { - sendMainRequestAndCSSRequest(); + sendMainRequestAndCSSRequest(null); final CountDownLatch pushDataLatch = new CountDownLatch(1); final CountDownLatch pushSynHeadersValid = new CountDownLatch(1); Session session = startClient(version, serverAddress, null); @@ -125,14 +125,14 @@ public class ReferrerPushStrategyTest extends AbstractHTTPSPDYTest public void testUserAgentBlackList() throws Exception { pushStrategy.setUserAgentBlacklist(Arrays.asList(".*(?i)firefox/16.*")); - sendMainRequestAndCSSRequest(); + sendMainRequestAndCSSRequest(null); run2ndClientRequests(false, false); } @Test public void testReferrerPushPeriod() throws Exception { - Session session = sendMainRequestAndCSSRequest(); + Session session = sendMainRequestAndCSSRequest(null); // Sleep for pushPeriod This should prevent application.js from being mapped as pushResource Thread.sleep(referrerPushPeriod + 1); @@ -148,13 +148,38 @@ public class ReferrerPushStrategyTest extends AbstractHTTPSPDYTest connector.addConnectionFactory(defaultFactory); connector.setDefaultProtocol(defaultFactory.getProtocol()); // TODO I don't think this is right - Session session = sendMainRequestAndCSSRequest(); + Session session = sendMainRequestAndCSSRequest(null); sendRequest(session, associatedJSRequestHeaders, null, null); run2ndClientRequests(false, true); } + @Test + public void testMaxConcurrentStreamsToDisablePush() throws Exception + { + final CountDownLatch pushReceivedLatch = new CountDownLatch(1); + Session session = sendMainRequestAndCSSRequest(new SessionFrameListener.Adapter() + { + @Override + public StreamFrameListener onSyn(Stream stream, SynInfo synInfo) + { + pushReceivedLatch.countDown(); + return null; + } + }); + +// Settings settings = new Settings(); +// settings.put(new Settings.Setting(Settings.ID.MAX_CONCURRENT_STREAMS, 0)); +// SettingsInfo settingsInfo = new SettingsInfo(settings); +// +// session.settings(settingsInfo); + + sendRequest(session, mainRequestHeaders, null, null); + + assertThat(pushReceivedLatch.await(1, TimeUnit.SECONDS), is(false)); + } + private InetSocketAddress createServer() throws Exception { GzipHandler gzipHandler = new GzipHandler(); @@ -177,9 +202,9 @@ public class ReferrerPushStrategyTest extends AbstractHTTPSPDYTest return startHTTPServer(version, gzipHandler); } - private Session sendMainRequestAndCSSRequest() throws Exception + private Session sendMainRequestAndCSSRequest(SessionFrameListener sessionFrameListener) throws Exception { - Session session = startClient(version, serverAddress, null); + Session session = startClient(version, serverAddress, sessionFrameListener); sendRequest(session, mainRequestHeaders, null, null); sendRequest(session, associatedCSSRequestHeaders, null, null); @@ -197,7 +222,8 @@ public class ReferrerPushStrategyTest extends AbstractHTTPSPDYTest @Override public StreamFrameListener onPush(Stream stream, PushInfo pushInfo) { - validateHeaders(pushInfo.getHeaders(), pushSynHeadersValid); + if (pushSynHeadersValid != null) + validateHeaders(pushInfo.getHeaders(), pushSynHeadersValid); assertThat("Stream is unidirectional", stream.isUnidirectional(), is(true)); assertThat("URI header ends with css", pushInfo.getHeaders().get(HTTPSPDYHeader.URI.name(version)) diff --git a/jetty-spdy/spdy-server/src/test/java/org/eclipse/jetty/spdy/server/AbstractTest.java b/jetty-spdy/spdy-server/src/test/java/org/eclipse/jetty/spdy/server/AbstractTest.java index 08625cc95c3..cdbe2ba6c23 100644 --- a/jetty-spdy/spdy-server/src/test/java/org/eclipse/jetty/spdy/server/AbstractTest.java +++ b/jetty-spdy/spdy-server/src/test/java/org/eclipse/jetty/spdy/server/AbstractTest.java @@ -53,13 +53,15 @@ public abstract class AbstractTest } }; + protected final short version = SPDY.V2; + protected Server server; protected SPDYClient.Factory clientFactory; protected SPDYServerConnector connector; protected InetSocketAddress startServer(ServerSessionFrameListener listener) throws Exception { - return startServer(SPDY.V2, listener); + return startServer(version, listener); } protected InetSocketAddress startServer(short version, ServerSessionFrameListener listener) throws Exception @@ -99,7 +101,7 @@ public abstract class AbstractTest protected Session startClient(InetSocketAddress socketAddress, SessionFrameListener listener) throws Exception { - return startClient(SPDY.V2, socketAddress, listener); + return startClient(version, socketAddress, listener); } protected Session startClient(short version, InetSocketAddress socketAddress, SessionFrameListener listener) throws Exception diff --git a/jetty-spdy/spdy-server/src/test/java/org/eclipse/jetty/spdy/server/MaxConcurrentStreamTest.java b/jetty-spdy/spdy-server/src/test/java/org/eclipse/jetty/spdy/server/MaxConcurrentStreamTest.java new file mode 100644 index 00000000000..5c74ca395f1 --- /dev/null +++ b/jetty-spdy/spdy-server/src/test/java/org/eclipse/jetty/spdy/server/MaxConcurrentStreamTest.java @@ -0,0 +1,120 @@ +// +// ======================================================================== +// Copyright (c) 1995-2013 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 +// +// The Apache License v2.0 is available at +// http://www.opensource.org/licenses/apache2.0.php +// +// You may elect to redistribute this code under either of these licenses. +// ======================================================================== +// + +package org.eclipse.jetty.spdy.server; + +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; + +import org.eclipse.jetty.spdy.api.ByteBufferDataInfo; +import org.eclipse.jetty.spdy.api.DataInfo; +import org.eclipse.jetty.spdy.api.ReplyInfo; +import org.eclipse.jetty.spdy.api.Session; +import org.eclipse.jetty.spdy.api.SessionFrameListener; +import org.eclipse.jetty.spdy.api.Settings; +import org.eclipse.jetty.spdy.api.SettingsInfo; +import org.eclipse.jetty.spdy.api.Stream; +import org.eclipse.jetty.spdy.api.StreamFrameListener; +import org.eclipse.jetty.spdy.api.SynInfo; +import org.eclipse.jetty.spdy.api.server.ServerSessionFrameListener; +import org.eclipse.jetty.util.BufferUtil; +import org.eclipse.jetty.util.Fields; +import org.junit.Test; + +import static org.hamcrest.Matchers.is; +import static org.junit.Assert.assertThat; + +public class MaxConcurrentStreamTest extends AbstractTest +{ + @Test + public void testMaxConcurrentStreamsSetByServer() throws Exception, ExecutionException + { + final CountDownLatch settingsReceivedLatch = new CountDownLatch(1); + final CountDownLatch dataReceivedLatch = new CountDownLatch(1); + + Session session = startClient(startServer(new ServerSessionFrameListener.Adapter() + { + @Override + public void onConnect(Session session) + { + Settings settings = new Settings(); + settings.put(new Settings.Setting(Settings.ID.MAX_CONCURRENT_STREAMS, 1)); + try + { + session.settings(new SettingsInfo(settings)); + } + catch (ExecutionException | InterruptedException | TimeoutException e) + { + e.printStackTrace(); + } + } + + @Override + public StreamFrameListener onSyn(Stream stream, SynInfo synInfo) + { + try + { + stream.reply(new ReplyInfo(true)); + } + catch (ExecutionException | InterruptedException | TimeoutException e) + { + e.printStackTrace(); + } + return new StreamFrameListener.Adapter() + { + @Override + public void onData(Stream stream, DataInfo dataInfo) + { + dataReceivedLatch.countDown(); + } + }; + } + }), new SessionFrameListener.Adapter() + { + @Override + public void onSettings(Session session, SettingsInfo settingsInfo) + { + settingsReceivedLatch.countDown(); + } + }); + + assertThat("Settings frame received", settingsReceivedLatch.await(5, TimeUnit.SECONDS), is(true)); + + SynInfo synInfo = new SynInfo(new Fields(), false); + Stream stream = session.syn(synInfo, null); + + boolean failed = false; + try + { + session.syn(synInfo, null); + } + catch (ExecutionException | InterruptedException | TimeoutException e) + { + failed = true; + } + + assertThat("Opening second stream failed", failed, is(true)); + + stream.data(new ByteBufferDataInfo(BufferUtil.EMPTY_BUFFER, true)); + assertThat("Data has been received on first stream.", dataReceivedLatch.await(5, TimeUnit.SECONDS), is(true)); + + session.syn(synInfo, null); + } +} From e4e514d10a1e027ee57755841c6956df38feb017 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Thu, 11 Apr 2013 06:24:45 +1000 Subject: [PATCH 07/30] post 9.0.1 --- VERSION.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/VERSION.txt b/VERSION.txt index 11204d44a69..4da151fb457 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1,3 +1,6 @@ +jetty-9.0.2-SNAPSHOT + + jetty-9.0.1.v20130408 - 08 April 2013 + 384552 add comment to jetty-https.xml describing keymanager password + 385488 non existing resources in collection are just warnings From 5637db66e8efdeede113847fdacfab47e0879b90 Mon Sep 17 00:00:00 2001 From: Jan Bartel Date: Thu, 11 Apr 2013 06:36:44 +1000 Subject: [PATCH 08/30] 405352 Servlet init-param always overridden by WebServlet annotation --- .../org/eclipse/jetty/annotations/WebServletAnnotation.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/WebServletAnnotation.java b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/WebServletAnnotation.java index f8c4e2be276..f76eadf22a9 100644 --- a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/WebServletAnnotation.java +++ b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/WebServletAnnotation.java @@ -167,7 +167,7 @@ public class WebServletAnnotation extends DiscoveredAnnotation //if not, add it for (WebInitParam ip:annotation.initParams()) { - if (metaData.getOrigin(servletName+".servlet.init-param"+ip.name())==Origin.NotSet) + if (metaData.getOrigin(servletName+".servlet.init-param."+ip.name())==Origin.NotSet) { holder.setInitParameter(ip.name(), ip.value()); metaData.setOrigin(servletName+".servlet.init-param."+ip.name()); From e8d9625dcc195da329a8402c774940dd09e68bb4 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Thu, 11 Apr 2013 08:32:51 +1000 Subject: [PATCH 09/30] adjust tests to make them more travis CI compatible --- .../main/java/org/eclipse/jetty/server/ShutdownMonitor.java | 5 ++++- .../org/eclipse/jetty/server/LowResourcesMonitorTest.java | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/ShutdownMonitor.java b/jetty-server/src/main/java/org/eclipse/jetty/server/ShutdownMonitor.java index 6d4f9e1915f..e789d389a5f 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/ShutdownMonitor.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/ShutdownMonitor.java @@ -146,6 +146,7 @@ public class ShutdownMonitor { if (isAlive()) { + // TODO why are we reentrant here? if (DEBUG) System.err.printf("ShutdownMonitorThread already started"); return; // cannot start it again @@ -353,7 +354,9 @@ public class ShutdownMonitor { if (thread != null && thread.isAlive()) { - System.err.printf("ShutdownMonitorThread already started"); + // TODO why are we reentrant here? + if (DEBUG) + System.err.printf("ShutdownMonitorThread already started"); return; // cannot start it again } diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/LowResourcesMonitorTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/LowResourcesMonitorTest.java index 365a85b0798..eac10577bfe 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/LowResourcesMonitorTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/LowResourcesMonitorTest.java @@ -80,13 +80,14 @@ public class LowResourcesMonitorTest @Test public void testLowOnThreads() throws Exception { + Thread.sleep(1200); _threadPool.setMaxThreads(_threadPool.getThreads()-_threadPool.getIdleThreads()+10); Thread.sleep(1200); Assert.assertFalse(_lowResourcesMonitor.isLowOnResources()); final CountDownLatch latch = new CountDownLatch(1); - for (int i=0;i<20;i++) + for (int i=0;i<100;i++) { _threadPool.dispatch(new Runnable() { @@ -110,7 +111,6 @@ public class LowResourcesMonitorTest latch.countDown(); Thread.sleep(1200); - System.err.println(_threadPool.dump()); Assert.assertFalse(_lowResourcesMonitor.isLowOnResources()); } From 76df005c64b40c750362834eb1902049bd9d81c2 Mon Sep 17 00:00:00 2001 From: Jan Bartel Date: Thu, 11 Apr 2013 10:22:44 +1000 Subject: [PATCH 10/30] 405119 Tidy up comments and code formatting for osgi --- ...gableWebAppRegistrationCustomizerImpl.java | 89 +++------ .../WebappRegistrationCustomizerImpl.java | 3 + .../osgi/boot/AbstractContextProvider.java | 9 +- .../jetty/osgi/boot/AbstractOSGiApp.java | 5 +- .../osgi/boot/AbstractWebAppProvider.java | 12 +- .../osgi/boot/BundleContextProvider.java | 3 +- .../jetty/osgi/boot/BundleProvider.java | 5 + .../osgi/boot/JettyBootstrapActivator.java | 153 ++------------- .../eclipse/jetty/osgi/boot/OSGiDeployer.java | 4 +- .../osgi/boot/OSGiMetaInfConfiguration.java | 7 + .../jetty/osgi/boot/OSGiServerConstants.java | 2 + .../jetty/osgi/boot/OSGiUndeployer.java | 4 +- .../jetty/osgi/boot/OSGiWebappConstants.java | 7 +- .../osgi/boot/ServiceContextProvider.java | 4 +- .../jetty/osgi/boot/ServiceProvider.java | 5 + .../osgi/boot/ServiceWebAppProvider.java | 1 - .../DefaultJettyAtJettyHomeHelper.java | 21 +- .../JettyServerServiceTracker.java | 7 +- .../JettyContextHandlerServiceTracker.java | 11 +- .../webapp/LibExtClassLoaderHelper.java | 38 +--- .../webapp/OSGiWebappClassLoader.java | 20 +- .../webapp/WebBundleTrackerCustomizer.java | 179 ++++++++++++------ .../osgi/boot/utils/OSGiClassLoader.java | 3 +- .../utils/WebappRegistrationCustomizer.java | 26 +-- .../DefaultBundleClassLoaderHelper.java | 3 + .../internal/DefaultFileLocatorHelper.java | 3 + .../internal/PackageAdminServiceTracker.java | 3 + 27 files changed, 263 insertions(+), 364 deletions(-) diff --git a/jetty-osgi/jetty-osgi-boot-jsp/src/main/java/org/eclipse/jetty/osgi/boot/jasper/PluggableWebAppRegistrationCustomizerImpl.java b/jetty-osgi/jetty-osgi-boot-jsp/src/main/java/org/eclipse/jetty/osgi/boot/jasper/PluggableWebAppRegistrationCustomizerImpl.java index 2521ed186dd..2036eb9800b 100644 --- a/jetty-osgi/jetty-osgi-boot-jsp/src/main/java/org/eclipse/jetty/osgi/boot/jasper/PluggableWebAppRegistrationCustomizerImpl.java +++ b/jetty-osgi/jetty-osgi-boot-jsp/src/main/java/org/eclipse/jetty/osgi/boot/jasper/PluggableWebAppRegistrationCustomizerImpl.java @@ -21,8 +21,6 @@ package org.eclipse.jetty.osgi.boot.jasper; import java.io.File; import java.net.URL; import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; @@ -36,61 +34,37 @@ import org.eclipse.jetty.osgi.boot.utils.WebappRegistrationCustomizer; import org.osgi.framework.Bundle; import org.osgi.framework.FrameworkUtil; + + /** - * Plug bundles that contains tld files so that jasper will discover them and - * set them up in jetty. + * PluggableWebAppRegistrationCustomizerImpl * - * For example: - * -Dorg.eclipse.jetty.osgi.tldbundles=org.springframework.web.servlet - * ,com.opensymphony.module.sitemesh Otherwise use an attribute to the - * WebAppDeployer <New - * class="org.eclipse.jetty.deploy.providers.WebAppProvider"> .... <Set - * name="tldBundles"><Property name="org.eclipse.jetty.osgi.tldsbundles" - * default="" /></Set> <New> + * + * Use a System property to define bundles that contain tlds that need to + * be treated by jasper as if they were on the jetty container's classpath. + * + * The bundle locations are converted to URLs for jasper's use. + * + * Eg: + * -Dorg.eclipse.jetty.osgi.tldbundles=org.springframework.web.servlet,com.opensymphony.module.sitemesh */ public class PluggableWebAppRegistrationCustomizerImpl implements WebappRegistrationCustomizer { /** - * To plug into jasper bundles that contain tld files please use a list of - * bundle's symbolic names: - * -Djetty.osgi.tldbundles=org.springframework.web.servlet - * ,com.opensymphony.module.sitemesh + * Comma separated list of names of bundles that contain tld files that should be + * discoved by jasper as if they were on the container's classpath. + * Eg: + * -Djetty.osgi.tldbundles=org.springframework.web.servlet,com.opensymphony.module.sitemesh */ public static final String SYS_PROP_TLD_BUNDLES = "org.eclipse.jetty.osgi.tldbundles"; + + /** - * Union of the tld bundles defined system wide and the one defines as an - * attribute of the AppProvider. + * Check the System property "org.eclipse.jetty.osgi.tldbundles" for names of + * bundles that contain tlds and convert to URLs. * - * @param provider - * @return - */ - private static Collection getTldBundles(DeploymentManager deploymentManager) - { - String sysprop = System.getProperty(SYS_PROP_TLD_BUNDLES); - String att = (String) deploymentManager.getContextAttribute(OSGiWebInfConfiguration.CONTAINER_BUNDLE_PATTERN); - if (sysprop == null && att == null) { return Collections.emptySet(); } - if (att == null) - { - att = sysprop; - } - else if (sysprop != null) - { - att = att + "," + sysprop; - } - - Collection tldbundles = new HashSet(); - StringTokenizer tokenizer = new StringTokenizer(att, ", \n\r\t", false); - while (tokenizer.hasMoreTokens()) - { - tldbundles.add(tokenizer.nextToken()); - } - return tldbundles; - } - - /** - * @return The location of the jars that contain tld files. Jasper will - * discover them. + * @return The location of the jars that contain tld files as URLs. */ public URL[] getJarsWithTlds(DeploymentManager deploymentManager, BundleFileLocatorHelper locatorHelper) throws Exception { @@ -118,10 +92,10 @@ public class PluggableWebAppRegistrationCustomizerImpl implements WebappRegistra for (Bundle bundle : bundles) { if (sysNames.contains(bundle.getSymbolicName())) - registerTldBundle(locatorHelper, bundle, urls); + convertBundleLocationToURL(locatorHelper, bundle, urls); if (pattern != null && pattern.matcher(bundle.getSymbolicName()).matches()) - registerTldBundle(locatorHelper, bundle, urls); + convertBundleLocationToURL(locatorHelper, bundle, urls); } return urls.toArray(new URL[urls.size()]); @@ -129,19 +103,8 @@ public class PluggableWebAppRegistrationCustomizerImpl implements WebappRegistra } /** - * Resolves the bundle that contains tld files as a set of URLs that will be - * passed to jasper as a URLClassLoader later on. Usually that would be a - * single URL per bundle. But we do some more work if there are jars - * embedded in the bundle. - * - * The jasper TldScanner expects a URLClassloader to parse a jar for the - * /META-INF/*.tld it may contain. We place the bundles that we know contain - * such tag-libraries. Please note that it will work if and only if the - * bundle is a jar (!) Currently we just hardcode the bundle that contains - * the jstl implemenation. - * - * A workaround when the tld cannot be parsed with this method is to copy - * and paste it inside the WEB-INF of the webapplication where it is used. + * Resolves a bundle that contains tld files as a URL. The URLs are + * used by jasper to discover the tld files. * * Support only 2 types of packaging for the bundle: - the bundle is a jar * (recommended for runtime.) - the bundle is a folder and contain jars in @@ -153,7 +116,7 @@ public class PluggableWebAppRegistrationCustomizerImpl implements WebappRegistra * @param urls * @throws Exception */ - private void registerTldBundle(BundleFileLocatorHelper locatorHelper, Bundle bundle, Set urls) throws Exception + private void convertBundleLocationToURL(BundleFileLocatorHelper locatorHelper, Bundle bundle, Set urls) throws Exception { File jasperLocation = locatorHelper.getBundleInstallLocation(bundle); if (jasperLocation.isDirectory()) @@ -181,7 +144,5 @@ public class PluggableWebAppRegistrationCustomizerImpl implements WebappRegistra { urls.add(jasperLocation.toURI().toURL()); } - } - } \ No newline at end of file diff --git a/jetty-osgi/jetty-osgi-boot-jsp/src/main/java/org/eclipse/jetty/osgi/boot/jasper/WebappRegistrationCustomizerImpl.java b/jetty-osgi/jetty-osgi-boot-jsp/src/main/java/org/eclipse/jetty/osgi/boot/jasper/WebappRegistrationCustomizerImpl.java index 7b744b99cd3..9212e425511 100644 --- a/jetty-osgi/jetty-osgi-boot-jsp/src/main/java/org/eclipse/jetty/osgi/boot/jasper/WebappRegistrationCustomizerImpl.java +++ b/jetty-osgi/jetty-osgi-boot-jsp/src/main/java/org/eclipse/jetty/osgi/boot/jasper/WebappRegistrationCustomizerImpl.java @@ -44,6 +44,9 @@ import org.xml.sax.InputSource; import org.xml.sax.SAXException; /** + * + * WebappRegistrationCustomizerImpl + * * Fix various shortcomings with the way jasper parses the tld files. Plugs the * JSTL tlds assuming that they are packaged with the bundle that contains the * JSTL classes. diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/AbstractContextProvider.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/AbstractContextProvider.java index 6f07480ab6b..afb831361fd 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/AbstractContextProvider.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/AbstractContextProvider.java @@ -22,14 +22,12 @@ import java.io.File; import java.net.URL; import java.util.Dictionary; import java.util.HashMap; -import java.util.Hashtable; import org.eclipse.jetty.deploy.App; import org.eclipse.jetty.deploy.AppProvider; import org.eclipse.jetty.deploy.DeploymentManager; import org.eclipse.jetty.osgi.boot.internal.serverfactory.ServerInstanceWrapper; import org.eclipse.jetty.osgi.boot.internal.webapp.BundleFileLocatorHelperFactory; -import org.eclipse.jetty.osgi.boot.utils.EventSender; import org.eclipse.jetty.osgi.boot.utils.OSGiClassLoader; import org.eclipse.jetty.server.handler.ContextHandler; import org.eclipse.jetty.util.component.AbstractLifeCycle; @@ -37,11 +35,8 @@ import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.JarResource; import org.eclipse.jetty.util.resource.Resource; -import org.eclipse.jetty.webapp.WebAppContext; import org.eclipse.jetty.xml.XmlConfiguration; import org.osgi.framework.Bundle; -import org.osgi.framework.FrameworkUtil; -import org.osgi.framework.ServiceRegistration; @@ -49,7 +44,9 @@ import org.osgi.framework.ServiceRegistration; /** * AbstractContextProvider * - * + * Base class for DeploymentManager Providers that can deploy ContextHandlers into + * Jetty that have been discovered via OSGI either as bundles or services. + * */ public abstract class AbstractContextProvider extends AbstractLifeCycle implements AppProvider { diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/AbstractOSGiApp.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/AbstractOSGiApp.java index be09d2cfd69..b9e040b128a 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/AbstractOSGiApp.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/AbstractOSGiApp.java @@ -32,9 +32,10 @@ import org.osgi.framework.ServiceRegistration; /** - * AbstractBundleApp - * + * AbstractOSGiApp * + * Base class representing info about a webapp/ContextHandler that is deployed into Jetty. + * */ public abstract class AbstractOSGiApp extends App { diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/AbstractWebAppProvider.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/AbstractWebAppProvider.java index 73da20f41c1..7a854c7dbaf 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/AbstractWebAppProvider.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/AbstractWebAppProvider.java @@ -20,14 +20,9 @@ package org.eclipse.jetty.osgi.boot; import java.io.File; import java.net.URL; -import java.util.ArrayList; -import java.util.Arrays; import java.util.Dictionary; import java.util.Enumeration; import java.util.HashMap; -import java.util.Hashtable; -import java.util.Map; - import org.eclipse.jetty.deploy.App; import org.eclipse.jetty.deploy.AppProvider; @@ -35,7 +30,6 @@ import org.eclipse.jetty.deploy.DeploymentManager; import org.eclipse.jetty.osgi.boot.internal.serverfactory.ServerInstanceWrapper; import org.eclipse.jetty.osgi.boot.internal.webapp.BundleFileLocatorHelperFactory; import org.eclipse.jetty.osgi.boot.internal.webapp.OSGiWebappClassLoader; -import org.eclipse.jetty.osgi.boot.utils.EventSender; import org.eclipse.jetty.server.handler.ContextHandler; import org.eclipse.jetty.util.component.AbstractLifeCycle; import org.eclipse.jetty.util.log.Log; @@ -44,9 +38,7 @@ import org.eclipse.jetty.webapp.WebAppContext; import org.eclipse.jetty.xml.XmlConfiguration; import org.osgi.framework.Bundle; import org.osgi.framework.BundleContext; -import org.osgi.framework.FrameworkUtil; import org.osgi.framework.ServiceReference; -import org.osgi.framework.ServiceRegistration; import org.osgi.service.packageadmin.PackageAdmin; @@ -55,7 +47,9 @@ import org.osgi.service.packageadmin.PackageAdmin; /** * AbstractWebAppProvider * - * + * Base class for Jetty DeploymentManager Providers that are capable of deploying a webapp, + * either from a bundle or an OSGi service. + * */ public abstract class AbstractWebAppProvider extends AbstractLifeCycle implements AppProvider { diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleContextProvider.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleContextProvider.java index 149aa99b80b..6ec082e9038 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleContextProvider.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleContextProvider.java @@ -43,7 +43,7 @@ import org.osgi.framework.ServiceRegistration; /** * BundleContextProvider * - * Handles deploying bundles that define a context xml file for configuring them. + * Handles deploying OSGi bundles that define a context xml file for configuring them. * * */ @@ -136,6 +136,7 @@ public class BundleContextProvider extends AbstractContextProvider implements Bu } apps.add(app); getDeploymentManager().addApp(app); + added = true; } return added; //true if even 1 context from this bundle was added diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleProvider.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleProvider.java index c87c071bf52..e1372697c00 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleProvider.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleProvider.java @@ -20,6 +20,11 @@ package org.eclipse.jetty.osgi.boot; import org.osgi.framework.Bundle; +/** + * BundleProvider + * + * Jetty DeploymentManager Provider api for webapps or ContextHandlers that are discovered as osgi bundles. + */ public interface BundleProvider { public boolean bundleAdded (Bundle bundle) throws Exception; diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/JettyBootstrapActivator.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/JettyBootstrapActivator.java index 2ed6e7bf5e0..2e874bcb253 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/JettyBootstrapActivator.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/JettyBootstrapActivator.java @@ -21,6 +21,7 @@ package org.eclipse.jetty.osgi.boot; import java.util.Dictionary; import java.util.Hashtable; + import org.eclipse.jetty.osgi.boot.internal.serverfactory.DefaultJettyAtJettyHomeHelper; import org.eclipse.jetty.osgi.boot.internal.serverfactory.JettyServerServiceTracker; import org.eclipse.jetty.osgi.boot.internal.webapp.IWebBundleDeployerHelper; @@ -29,34 +30,33 @@ import org.eclipse.jetty.osgi.boot.internal.webapp.WebBundleTrackerCustomizer; import org.eclipse.jetty.osgi.boot.utils.internal.PackageAdminServiceTracker; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.handler.ContextHandler; +import org.eclipse.jetty.util.log.Log; +import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.webapp.WebAppContext; import org.osgi.framework.Bundle; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; import org.osgi.framework.BundleException; import org.osgi.framework.FrameworkUtil; +import org.osgi.framework.ServiceReference; import org.osgi.framework.ServiceRegistration; import org.osgi.util.tracker.BundleTracker; +import org.osgi.util.tracker.ServiceTracker; /** + * JettyBootstrapActivator + * * Bootstrap jetty and publish a default Server instance as an OSGi service. * * Listen for other Server instances to be published as services and support them as deployment targets. * - * Listen for Bundles to be activated, and deploy those that represent webapps to one of the known Server instances. + * Listen for Bundles to be activated, and deploy those that represent webapps/ContextHandlers to one of the known Server instances. * - *
    - *
  1. basic servlet [ok]
  2. - *
  3. basic jetty.xml [ok]
  4. - *
  5. basic jetty.xml and jetty-plus.xml [ok]
  6. - *
  7. basic jsp [ok]
  8. - *
  9. jsp with tag-libs [ok]
  10. - *
  11. test-jndi with atomikos and derby inside ${jetty.home}/lib/ext [ok]
  12. - * */ public class JettyBootstrapActivator implements BundleActivator { - + private static final Logger LOG = Log.getLogger(JettyBootstrapActivator.class); + private static JettyBootstrapActivator INSTANCE = null; public static JettyBootstrapActivator getInstance() @@ -84,7 +84,7 @@ public class JettyBootstrapActivator implements BundleActivator * * @param context */ - public void start(BundleContext context) throws Exception + public void start(final BundleContext context) throws Exception { INSTANCE = this; _bundleContext = context; @@ -102,12 +102,14 @@ public class JettyBootstrapActivator implements BundleActivator context.addServiceListener(_jettyContextHandlerTracker, "(objectclass=" + ContextHandler.class.getName() + ")"); // Create a default jetty instance right now. - DefaultJettyAtJettyHomeHelper.startJettyAtJettyHome(context); + Server defaultServer = DefaultJettyAtJettyHomeHelper.startJettyAtJettyHome(context); - // track Bundles and deploy those that represent webapps to one of the known Servers - WebBundleTrackerCustomizer customizer = new WebBundleTrackerCustomizer(); - _webBundleTracker = new BundleTracker(context, Bundle.ACTIVE | Bundle.STOPPING, customizer); - customizer.setAndOpenWebBundleTracker(_webBundleTracker); + //Create a bundle tracker to help deploy webapps and ContextHandlers + WebBundleTrackerCustomizer bundleTrackerCustomizer = new WebBundleTrackerCustomizer(); + bundleTrackerCustomizer.setWaitForDefaultServer(defaultServer != null); + _webBundleTracker = new BundleTracker(context, Bundle.ACTIVE | Bundle.STOPPING, bundleTrackerCustomizer); + bundleTrackerCustomizer.setBundleTracker(_webBundleTracker); + bundleTrackerCustomizer.open(); } /** @@ -120,7 +122,6 @@ public class JettyBootstrapActivator implements BundleActivator { try { - if (_webBundleTracker != null) { _webBundleTracker.close(); @@ -164,122 +165,4 @@ public class JettyBootstrapActivator implements BundleActivator INSTANCE = null; } } - - /** - * Helper method that creates a new org.jetty.webapp.WebAppContext and - * registers it as an OSGi service. The tracker - * {@link JettyContextHandlerServiceTracker} will do the actual deployment. - * - * @param contributor The bundle - * @param webappFolderPath The path to the root of the webapp. Must be a - * path relative to bundle; either an absolute path. - * @param contextPath The context path. Must start with "/" - * @throws Exception - */ - public static void registerWebapplication(Bundle contributor, String webappFolderPath, String contextPath) throws Exception - { - checkBundleActivated(); - WebAppContext contextHandler = new WebAppContext(); - Dictionary dic = new Hashtable(); - dic.put(OSGiWebappConstants.SERVICE_PROP_WAR, webappFolderPath); - dic.put(OSGiWebappConstants.SERVICE_PROP_CONTEXT_PATH, contextPath); - String requireTldBundle = (String) contributor.getHeaders().get(OSGiWebappConstants.REQUIRE_TLD_BUNDLE); - if (requireTldBundle != null) - { - dic.put(OSGiWebappConstants.SERVICE_PROP_REQUIRE_TLD_BUNDLE, requireTldBundle); - } - contributor.getBundleContext().registerService(ContextHandler.class.getName(), contextHandler, dic); - } - - /** - * Helper method that creates a new org.jetty.webapp.WebAppContext and - * registers it as an OSGi service. The tracker - * {@link JettyContextHandlerServiceTracker} will do the actual deployment. - * - * @param contributor The bundle - * @param webappFolderPath The path to the root of the webapp. Must be a - * path relative to bundle; either an absolute path. - * @param contextPath The context path. Must start with "/" - * @param dic TODO: parameter description - * @throws Exception - */ - public static void registerWebapplication(Bundle contributor, String webappFolderPath, String contextPath, Dictionary dic) throws Exception - { - checkBundleActivated(); - WebAppContext contextHandler = new WebAppContext(); - dic.put(OSGiWebappConstants.SERVICE_PROP_WAR, webappFolderPath); - dic.put(OSGiWebappConstants.SERVICE_PROP_CONTEXT_PATH, contextPath); - contributor.getBundleContext().registerService(ContextHandler.class.getName(), contextHandler, dic); - } - - /** - * Helper method that creates a new skeleton of a ContextHandler and - * registers it as an OSGi service. The tracker - * {@link JettyContextHandlerServiceTracker} will do the actual deployment. - * - * @param contributor The bundle that registers a new context - * @param contextFilePath The path to the file inside the bundle that - * defines the context. - * @throws Exception - */ - public static void registerContext(Bundle contributor, String contextFilePath) throws Exception - { - registerContext(contributor, contextFilePath, new Hashtable()); - } - - /** - * Helper method that creates a new skeleton of a ContextHandler and - * registers it as an OSGi service. The tracker - * {@link JettyContextHandlerServiceTracker} will do the actual deployment. - * - * @param contributor The bundle that registers a new context - * @param contextFilePath The path to the file inside the bundle that - * defines the context. - * @param dic TODO: parameter description - * @throws Exception - */ - public static void registerContext(Bundle contributor, String contextFilePath, Dictionary dic) throws Exception - { - checkBundleActivated(); - ContextHandler contextHandler = new ContextHandler(); - dic.put(OSGiWebappConstants.SERVICE_PROP_CONTEXT_FILE_PATH, contextFilePath); - dic.put(IWebBundleDeployerHelper.INTERNAL_SERVICE_PROP_UNKNOWN_CONTEXT_HANDLER_TYPE, Boolean.TRUE.toString()); - contributor.getBundleContext().registerService(ContextHandler.class.getName(), contextHandler, dic); - } - - public static void unregister(String contextPath) - { - // todo - } - - /** - * Since org.eclipse.jetty.osgi.boot does not have a lazy activation policy - * when one of the static methods to register a webapp is called we should - * make sure that the bundle is started. - */ - private static void checkBundleActivated() - { - if (INSTANCE == null) - { - Bundle thisBundle = FrameworkUtil.getBundle(JettyBootstrapActivator.class); - try - { - thisBundle.start(); - } - catch (BundleException e) - { - // nevermind. - } - } - } - - /** - * @return The bundle context for this bundle. - */ - public static BundleContext getBundleContext() - { - checkBundleActivated(); - return INSTANCE._bundleContext; - } - } diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiDeployer.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiDeployer.java index 5f9321ebc9a..1b80e04edd1 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiDeployer.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiDeployer.java @@ -27,7 +27,9 @@ import org.eclipse.jetty.osgi.boot.utils.EventSender; /** * OSGiDeployer * - * + * Extension of standard Jetty deployer that emits OSGi EventAdmin + * events whenever a webapp is deployed into OSGi via Jetty. + * */ public class OSGiDeployer extends StandardDeployer { diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiMetaInfConfiguration.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiMetaInfConfiguration.java index bacc8ea9a03..c67b6bb1f33 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiMetaInfConfiguration.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiMetaInfConfiguration.java @@ -32,6 +32,13 @@ import org.eclipse.jetty.webapp.MetaInfConfiguration; import org.eclipse.jetty.webapp.WebAppContext; import org.osgi.framework.Bundle; +/** + * OSGiMetaInfConfiguration + * + * Extension of standard Jetty MetaInfConfiguration class to handle OSGi bundle + * fragments that may also need to be scanned for META-INF info. + * + */ public class OSGiMetaInfConfiguration extends MetaInfConfiguration { private static final Logger LOG = Log.getLogger(OSGiMetaInfConfiguration.class); diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiServerConstants.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiServerConstants.java index 2f9df55ad82..67ef323aee8 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiServerConstants.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiServerConstants.java @@ -19,6 +19,8 @@ package org.eclipse.jetty.osgi.boot; /** + * OSGiServerConstants + * * Name of the properties that configure a jetty Server OSGi service. */ public class OSGiServerConstants diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiUndeployer.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiUndeployer.java index ac068741d09..674f960b23b 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiUndeployer.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiUndeployer.java @@ -29,7 +29,9 @@ import org.eclipse.jetty.osgi.boot.utils.EventSender; /** * OSGiUndeployer * - * + * Extension of the Jetty Undeployer which emits OSGi EventAdmin events + * whenever a webapp is undeployed from Jetty. + * */ public class OSGiUndeployer extends StandardUndeployer { diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiWebappConstants.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiWebappConstants.java index 1908eb2de5c..e97457aecdf 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiWebappConstants.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiWebappConstants.java @@ -19,7 +19,12 @@ package org.eclipse.jetty.osgi.boot; /** - * Name of the service properties for a ContextHandler that configure a webapp deployed on jetty OSGi. + * OSGiWebappConstants + * + * + * Constants (MANIFEST headers, service properties etc) associated with deploying + * webapps into OSGi via Jetty. + * */ public class OSGiWebappConstants { diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/ServiceContextProvider.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/ServiceContextProvider.java index 2e36904fc4f..a228a6288d7 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/ServiceContextProvider.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/ServiceContextProvider.java @@ -38,7 +38,9 @@ import org.osgi.framework.ServiceRegistration; /** * ServiceContextProvider * - * + * Jetty DeploymentManager Provider that is able to deploy ContextHandlers discovered via OSGi as services. + * + * */ public class ServiceContextProvider extends AbstractContextProvider implements ServiceProvider { diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/ServiceProvider.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/ServiceProvider.java index f2304c6b136..34335cf31b0 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/ServiceProvider.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/ServiceProvider.java @@ -21,6 +21,11 @@ package org.eclipse.jetty.osgi.boot; import org.eclipse.jetty.server.handler.ContextHandler; import org.osgi.framework.ServiceReference; +/** + * ServiceProvider + * + * Jetty DeploymentManager Provider api for webapps or ContextHandlers that are discovered as OSGi services. + */ public interface ServiceProvider { public boolean serviceAdded (ServiceReference ref, ContextHandler handler) throws Exception; diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/ServiceWebAppProvider.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/ServiceWebAppProvider.java index e3f97f09132..6008aa033c1 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/ServiceWebAppProvider.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/ServiceWebAppProvider.java @@ -27,7 +27,6 @@ import org.eclipse.jetty.deploy.App; import org.eclipse.jetty.deploy.AppProvider; import org.eclipse.jetty.deploy.DeploymentManager; import org.eclipse.jetty.osgi.boot.internal.serverfactory.ServerInstanceWrapper; -import org.eclipse.jetty.osgi.boot.utils.EventSender; import org.eclipse.jetty.server.handler.ContextHandler; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/serverfactory/DefaultJettyAtJettyHomeHelper.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/serverfactory/DefaultJettyAtJettyHomeHelper.java index bef4dcf3731..4c4066b47b2 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/serverfactory/DefaultJettyAtJettyHomeHelper.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/serverfactory/DefaultJettyAtJettyHomeHelper.java @@ -29,7 +29,6 @@ import java.util.StringTokenizer; import org.eclipse.jetty.osgi.boot.JettyBootstrapActivator; import org.eclipse.jetty.osgi.boot.OSGiServerConstants; import org.eclipse.jetty.osgi.boot.internal.webapp.BundleFileLocatorHelperFactory; -import org.eclipse.jetty.osgi.boot.utils.BundleFileLocatorHelper; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; @@ -40,9 +39,12 @@ import org.osgi.framework.BundleContext; * DefaultJettyAtJettyHomeHelper * * + * Creates a default instance of Jetty, based on the values of the + * System properties "jetty.home" or "jetty.home.bundle", one of which + * must be specified in order to create the default instance. + * * Called by the {@link JettyBootstrapActivator} during the starting of the - * bundle. If the system property 'jetty.home' is defined and points to a - * folder, then setup the corresponding jetty server. + * bundle. */ public class DefaultJettyAtJettyHomeHelper { @@ -87,7 +89,7 @@ public class DefaultJettyAtJettyHomeHelper * as part of their properties. *

    */ - public static void startJettyAtJettyHome(BundleContext bundleContext) throws Exception + public static Server startJettyAtJettyHome(BundleContext bundleContext) throws Exception { String jettyHomeSysProp = System.getProperty(OSGiServerConstants.JETTY_HOME); String jettyHomeBundleSysProp = System.getProperty(OSGiServerConstants.JETTY_HOME_BUNDLE); @@ -109,7 +111,7 @@ public class DefaultJettyAtJettyHomeHelper if (!jettyHome.exists() || !jettyHome.isDirectory()) { LOG.warn("Unable to locate the jetty.home folder " + jettyHomeSysProp); - return; + return null; } } else if (jettyHomeBundleSysProp != null) @@ -126,14 +128,14 @@ public class DefaultJettyAtJettyHomeHelper if (jettyHomeBundle == null) { LOG.warn("Unable to find the jetty.home.bundle named " + jettyHomeSysProp); - return; + return null; } } if (jettyHome == null && jettyHomeBundle == null) { LOG.warn("No default jetty created."); - return; + return null; } Server server = new Server(); @@ -152,8 +154,11 @@ public class DefaultJettyAtJettyHomeHelper setProperty(properties, OSGiServerConstants.JETTY_PORT, System.getProperty(OSGiServerConstants.JETTY_PORT)); setProperty(properties, OSGiServerConstants.JETTY_PORT_SSL, System.getProperty(OSGiServerConstants.JETTY_PORT_SSL)); - //register the Server instance as an OSGi service. + //Register the default Server instance as an OSGi service. + //The JettyServerServiceTracker will notice it and configure it. bundleContext.registerService(Server.class.getName(), server, properties); + + return server; } diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/serverfactory/JettyServerServiceTracker.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/serverfactory/JettyServerServiceTracker.java index e172c75197e..b946cd8da4b 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/serverfactory/JettyServerServiceTracker.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/serverfactory/JettyServerServiceTracker.java @@ -32,8 +32,11 @@ import org.osgi.framework.ServiceListener; import org.osgi.framework.ServiceReference; /** - * Deploy the jetty server instances when they are registered as an OSGi - * service. + * JettyServerServiceTracker + * + * Tracks instances of Jetty Servers, and configures them so that they can deploy + * webapps or ContextHandlers discovered from the OSGi environment. + * */ public class JettyServerServiceTracker implements ServiceListener, IManagedJettyServerRegistry { diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/JettyContextHandlerServiceTracker.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/JettyContextHandlerServiceTracker.java index 6bd352da2ae..83dc00d265b 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/JettyContextHandlerServiceTracker.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/JettyContextHandlerServiceTracker.java @@ -18,28 +18,18 @@ package org.eclipse.jetty.osgi.boot.internal.webapp; -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; -import java.util.List; import java.util.Map; import java.util.Map.Entry; -import org.eclipse.jetty.osgi.boot.BundleWebAppProvider; import org.eclipse.jetty.osgi.boot.JettyBootstrapActivator; import org.eclipse.jetty.osgi.boot.OSGiServerConstants; import org.eclipse.jetty.osgi.boot.OSGiWebappConstants; import org.eclipse.jetty.osgi.boot.ServiceProvider; -import org.eclipse.jetty.osgi.boot.internal.serverfactory.DefaultJettyAtJettyHomeHelper; -import org.eclipse.jetty.osgi.boot.internal.serverfactory.IManagedJettyServerRegistry; -import org.eclipse.jetty.osgi.boot.internal.serverfactory.ServerInstanceWrapper; import org.eclipse.jetty.server.handler.ContextHandler; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; -import org.eclipse.jetty.util.Scanner; -import org.eclipse.jetty.webapp.WebAppContext; import org.osgi.framework.Bundle; import org.osgi.framework.BundleContext; import org.osgi.framework.FrameworkUtil; @@ -195,6 +185,7 @@ public class JettyContextHandlerServiceTracker implements ServiceListener try { added = e.getValue().serviceAdded(sr, contextHandler); + System.err.println(serverName+" deployed "+contextHandler+": "+added); if (added && LOG.isDebugEnabled()) LOG.debug("Provider "+e.getValue()+" deployed "+contextHandler); } diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/LibExtClassLoaderHelper.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/LibExtClassLoaderHelper.java index c66fa26b12a..705c9cfa722 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/LibExtClassLoaderHelper.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/LibExtClassLoaderHelper.java @@ -33,6 +33,9 @@ import java.util.Set; import org.eclipse.jetty.server.Server; /** + * LibExtClassLoaderHelper + * + * * Helper to create a URL class-loader with the jars inside * ${jetty.home}/lib/ext and ${jetty.home}/resources. In an ideal world, every * library is an OSGi bundle that does loads nicely. To support standard jars or @@ -40,41 +43,18 @@ import org.eclipse.jetty.server.Server; * inserting the jars in the usual jetty/lib/ext folders in the proper classpath * for the webapps. *

    - * Also the folder resources typically contains central configuration files for - * things like: log config and others. We enable fragments to register classes - * that are called back and passed those resources to do what they need to do. + * The drawback is that those jars will not be available in the OSGi + * classloader. *

    *

    - * For example the test-jndi webapplication depends on derby, derbytools, - * atomikos none of them are osgi bundles. we can either re-package them or we - * can place them in the usual lib/ext.
    - * In fact jasper's jsp libraries should maybe place in lib/ext too. - *

    - *

    - * The drawback is that those libraries will not be available in the OSGi - * classloader. Note that we could have setup those jars as embedded jars of the - * current bundle. However, we would need to know in advance what are those jars - * which was not acceptable. Also having those jars in a URLClassLoader seem to - * be required for some cases. For example jaspers' TldLocationsCache (replaced - * by TldScanner for servlet-3.0).
    - * Also all the dependencies of those libraries must be resolvable directly from - * the JettyBootstrapActivator bundle as it is set as the parent classloader. For - * example: if atomikos is placed in lib/ext it will work if and only if - * JettyBootstrapActivator import the necessary packages from javax.naming*, - * javax.transaction*, javax.mail* etc Most of the common cases of javax are - * added as optional import packages into jetty bootstrapper plugin. When there - * are not covered: please make a request or create a fragment or register a - * bundle with a buddy-policy onto the jetty bootstrapper.. - *

    - *

    - * Alternatives to placing jars in lib/ext + * Alternatives to placing jars in lib/ext: *

      - *
    1. Bundle the jars in an osgi bundle. Have the webapp(s) that context - * depends on them depend on that bundle. Things will go well for jetty.
    2. + *
    3. Bundle the jars in an osgi bundle. Have the webapp(s) that need these jars + * depend on that bundle.
    4. *
    5. Bundle those jars in an osgi bundle-fragment that targets the * jetty-bootstrap bundle
    6. *
    7. Use equinox Buddy-Policy: register a buddy of the jetty bootstrapper - * bundle. (least favorite: it will work only on equinox)
    8. + * bundle. (Note: it will work only on equinox) *
    *

    */ diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/OSGiWebappClassLoader.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/OSGiWebappClassLoader.java index 5f7e6443d95..71e9e7936fc 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/OSGiWebappClassLoader.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/OSGiWebappClassLoader.java @@ -33,7 +33,6 @@ import java.util.jar.JarFile; import javax.servlet.http.HttpServlet; -import org.eclipse.jetty.osgi.boot.utils.BundleClassLoaderHelper; import org.eclipse.jetty.osgi.boot.utils.BundleClassLoaderHelperFactory; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; @@ -44,8 +43,10 @@ import org.osgi.framework.Bundle; import org.osgi.framework.BundleReference; /** - * Extends the webappclassloader to insert the classloader provided by the osgi - * bundle at the same level than any other jars palced in the webappclassloader. + * OSGiWebappClassLoader + * + * + * Extends the webapp classloader to also use the classloader of the Bundle defining the webapp. */ public class OSGiWebappClassLoader extends WebAppClassLoader implements BundleReference { @@ -79,10 +80,9 @@ public class OSGiWebappClassLoader extends WebAppClassLoader implements BundleRe private boolean _lookInOsgiFirst = true; - private Set _libsAlreadyInManifest = new HashSet(); /** - * @param parent The parent classloader. In this case + * @param parent The parent classloader. * @param context The WebAppContext * @param contributor The bundle that defines this web-application. * @throws IOException @@ -106,16 +106,6 @@ public class OSGiWebappClassLoader extends WebAppClassLoader implements BundleRe return _contributor; } - /** - * Reads the manifest. If the manifest is already configured to loads a few - * libs we should not add them to the classpath of the webapp. Not really - * important as we resolve classes through the osgi classloader first and - * then default on the libs of the webapp. - */ - private void computeLibsAlreadyInOSGiClassLoader() - { - // TODO - } @Override public Enumeration getResources(String name) throws IOException diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/WebBundleTrackerCustomizer.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/WebBundleTrackerCustomizer.java index b8adc657054..5181b33b51c 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/WebBundleTrackerCustomizer.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/WebBundleTrackerCustomizer.java @@ -21,6 +21,10 @@ package org.eclipse.jetty.osgi.boot.internal.webapp; import java.util.ArrayList; import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; import org.eclipse.jetty.osgi.boot.BundleProvider; import org.eclipse.jetty.osgi.boot.OSGiServerConstants; @@ -39,12 +43,9 @@ import org.osgi.util.tracker.ServiceTracker; * WebBundleTrackerCustomizer * * - * Support bundles that declare a webpp or context directly through headers in their - * manifest. They will be deployed to the default jetty Server instance. - * - * If you wish to deploy a context or webapp to a different jetty Server instance, - * register your context/webapp as an osgi service, and set the property OSGiServerConstants.MANAGED_JETTY_SERVER_NAME - * with the name of the Server instance you wish to depoy to. + * Tracks the installation and removal of Bundles in the OSGi environment. Any bundles + * that are added are passed to the set of Jetty DeploymentManager providers to see if + * the bundle should be deployed as a webapp or ContextHandler into Jetty. * * @author hmalphettes */ @@ -53,35 +54,109 @@ public class WebBundleTrackerCustomizer implements BundleTrackerCustomizer private static final Logger LOG = Log.getLogger(WebBundleTrackerCustomizer.class); public static Collection JSP_REGISTRATION_HELPERS = new ArrayList(); - public static final String FILTER = "(&(objectclass=" + BundleProvider.class.getName() + ")"+ - "("+OSGiServerConstants.MANAGED_JETTY_SERVER_NAME+"="+OSGiServerConstants.MANAGED_JETTY_SERVER_DEFAULT_NAME+"))"; + + public static final String FILTER = "(objectclass=" + BundleProvider.class.getName() + ")"; private ServiceTracker _serviceTracker; private BundleTracker _bundleTracker; + private boolean _waitForDefaultServer = true; + private boolean _defaultServerReady = false; + private Bundle _bundle = null; + + /* ------------------------------------------------------------ */ /** * @throws Exception */ - public WebBundleTrackerCustomizer () - throws Exception + public WebBundleTrackerCustomizer() throws Exception { - Bundle myBundle = FrameworkUtil.getBundle(this.getClass()); - - //track all instances of deployers of webapps/contexts as bundles - _serviceTracker = new ServiceTracker(myBundle.getBundleContext(), FrameworkUtil.createFilter(FILTER),null) { - public Object addingService(ServiceReference reference) { - Object object = super.addingService(reference); - LOG.debug("Deployer registered {}", reference); - openBundleTracker(); - return object; - } - }; + _bundle = FrameworkUtil.getBundle(this.getClass()); + //Track all BundleProviders (Jetty DeploymentManager Providers that can deploy bundles) + _serviceTracker = new ServiceTracker(_bundle.getBundleContext(), FrameworkUtil.createFilter(FILTER),null); _serviceTracker.open(); - } + + public boolean isWaitForDefaultServer() + { + return _waitForDefaultServer; + } + + + + public void setWaitForDefaultServer(boolean waitForDefaultServer) + { + _waitForDefaultServer = waitForDefaultServer; + } + + public void setBundleTracker (BundleTracker bundleTracker) + { + _bundleTracker = bundleTracker; + } + + public void open () throws Exception + { + if (_waitForDefaultServer && !_defaultServerReady) + { + String filter = "(&(objectclass=" + BundleProvider.class.getName() + ")"+ + "("+OSGiServerConstants.MANAGED_JETTY_SERVER_NAME+"="+OSGiServerConstants.MANAGED_JETTY_SERVER_DEFAULT_NAME+"))"; + + ServiceTracker defaultServerTracker = new ServiceTracker(_bundle.getBundleContext(), + FrameworkUtil.createFilter(filter),null) + { + public Object addingService(ServiceReference reference) + { + try + { + Object object = super.addingService(reference); + LOG.debug("Default Jetty Server registered {}", reference); + _defaultServerReady = true; + openBundleTracker(); + return object; + } + catch (Exception e) + { + throw new IllegalStateException(e); + } + } + }; + defaultServerTracker.open(); + } + else + openBundleTracker(); + } + + /* ------------------------------------------------------------ */ + /** + * @param managedServerName + * @return + */ + public Map getDeployers(String managedServerName) + { + if (managedServerName == null) + managedServerName = OSGiServerConstants.MANAGED_JETTY_SERVER_DEFAULT_NAME; + + Map candidates = new HashMap(); + + ServiceReference[] references = _serviceTracker.getServiceReferences(); + if (references != null) + { + for (ServiceReference ref:references) + { + String name = (String)ref.getProperty(OSGiServerConstants.MANAGED_JETTY_SERVER_NAME); + if (managedServerName.equalsIgnoreCase(name)) + { + BundleProvider candidate = (BundleProvider)_serviceTracker.getService(ref); + if (candidate != null) + candidates.put(ref, candidate); + } + } + } + return candidates; + } + /* ------------------------------------------------------------ */ /** * A bundle is being added to the BundleTracker. @@ -138,8 +213,6 @@ public class WebBundleTrackerCustomizer implements BundleTrackerCustomizer */ public void modifiedBundle(Bundle bundle, BundleEvent event, Object object) { - // nothing the web-bundle was already track. something changed. - // we only reload the webapps if the bundle is stopped and restarted. if (bundle.getState() == Bundle.STOPPING || bundle.getState() == Bundle.ACTIVE) { unregister(bundle); @@ -171,35 +244,40 @@ public class WebBundleTrackerCustomizer implements BundleTrackerCustomizer } + protected void openBundleTracker() + { + _bundleTracker.open(); + } + /* ------------------------------------------------------------ */ /** * @param bundle - * @return true if this bundle in indeed a web-bundle. + * @return true if this bundle can be deployed into Jetty */ private boolean register(Bundle bundle) { if (bundle == null) return false; - //It might be a bundle that we can deploy to our default jetty server instance + //It might be a bundle that is deployable by Jetty. + //Use any named Server instance provided, defaulting to the default Server instance if none supplied boolean deployed = false; - Object[] deployers = _serviceTracker.getServices(); - if (deployers != null) + String serverName = (String)bundle.getHeaders().get(OSGiServerConstants.MANAGED_JETTY_SERVER_NAME); + Map candidates = getDeployers(serverName); + if (candidates != null) { - int i=0; - while (!deployed && i> itor = candidates.entrySet().iterator(); + while (!deployed && itor.hasNext()) { - - BundleProvider p = (BundleProvider)deployers[i]; + Entry e = itor.next(); try - { - deployed = p.bundleAdded(bundle); + { + deployed = e.getValue().bundleAdded(bundle); } catch (Exception x) { LOG.warn("Error deploying bundle for jetty context", x); } - i++; } } @@ -212,39 +290,24 @@ public class WebBundleTrackerCustomizer implements BundleTrackerCustomizer */ private void unregister(Bundle bundle) { - Object[] deployers = _serviceTracker.getServices(); boolean undeployed = false; - if (deployers != null) + String serverName = (String)bundle.getHeaders().get(OSGiServerConstants.MANAGED_JETTY_SERVER_NAME); + Map candidates = getDeployers(serverName); + if (candidates != null) { - int i=0; - while (!undeployed && i> itor = candidates.entrySet().iterator(); + while (!undeployed && itor.hasNext()) { + Entry e = itor.next(); try { - undeployed = ((BundleProvider)deployers[i++]).bundleRemoved(bundle); + undeployed = e.getValue().bundleRemoved(bundle); } catch (Exception x) { - LOG.warn("Error undeploying bundle for jetty context", x); + LOG.warn("Error undeploying Bundle representing jetty deployable ", x); } } } } - - public void setAndOpenWebBundleTracker(BundleTracker bundleTracker) { - if(_bundleTracker == null) { - _bundleTracker = bundleTracker; - LOG.debug("Bundle tracker is set"); - openBundleTracker(); - } - } - - private void openBundleTracker() { - if(_bundleTracker != null && _serviceTracker.getServices() != null && - _serviceTracker.getServices().length > 0) { - _bundleTracker.open(); - LOG.debug("Bundle tracker has been opened"); - } - } - } diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/OSGiClassLoader.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/OSGiClassLoader.java index 8850f5e6397..91f42afb941 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/OSGiClassLoader.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/OSGiClassLoader.java @@ -78,8 +78,7 @@ public class OSGiClassLoader extends URLClassLoader } if (url == null) - { - + { url = _osgiBundleClassLoader.getResource(name); if (url == null && name.startsWith("/")) diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/WebappRegistrationCustomizer.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/WebappRegistrationCustomizer.java index 813bff42fcb..736fcb254ff 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/WebappRegistrationCustomizer.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/WebappRegistrationCustomizer.java @@ -24,7 +24,9 @@ import org.eclipse.jetty.deploy.DeploymentManager; /** - * Fix various shortcomings with the way jasper parses the tld files. + * WebappRegistrationCustomizer + * + * Convert bundles that contain tlds into URL locations for consumption by jasper. */ public interface WebappRegistrationCustomizer { @@ -35,25 +37,13 @@ public interface WebappRegistrationCustomizer */ public static final String CLASS_NAME = "org.eclipse.jetty.osgi.boot.jasper.WebappRegistrationCustomizerImpl"; + /** - * TODO: right now only the jetty-jsp bundle is scanned for common taglibs. - * Should support a way to plug more bundles that contain taglibs. + * Find bundles that contain tlds and convert into URL references to their location. * - * The jasper TldScanner expects a URLClassloader to parse a jar for the - * /META-INF/*.tld it may contain. We place the bundles that we know contain - * such tag-libraries. Please note that it will work if and only if the - * bundle is a jar (!) Currently we just hardcode the bundle that contains - * the jstl implemenation. - * - * A workaround when the tld cannot be parsed with this method is to copy - * and paste it inside the WEB-INF of the webapplication where it is used. - * - * Support only 2 types of packaging for the bundle: - the bundle is a jar - * (recommended for runtime.) - the bundle is a folder and contain jars in - * the root and/or in the lib folder (nice for PDE developement situations) - * Unsupported: the bundle is a jar that embeds more jars. - * - * @return array of URLs + * @param manager + * @param fileLocator + * @return array of URLs representing locations of tld containing bundles * @throws Exception */ URL[] getJarsWithTlds(DeploymentManager manager, BundleFileLocatorHelper fileLocator) throws Exception; diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/internal/DefaultBundleClassLoaderHelper.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/internal/DefaultBundleClassLoaderHelper.java index 9bb074a5f22..ee0d7c225ed 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/internal/DefaultBundleClassLoaderHelper.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/internal/DefaultBundleClassLoaderHelper.java @@ -28,6 +28,9 @@ import org.eclipse.jetty.util.log.Logger; import org.osgi.framework.Bundle; /** + * DefaultBundleClassLoaderHelper + * + * * Default implementation of the BundleClassLoaderHelper. Uses introspection to * support equinox-3.5 and felix-2.0.0 */ diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/internal/DefaultFileLocatorHelper.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/internal/DefaultFileLocatorHelper.java index 2d31459de17..eb23d5924bf 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/internal/DefaultFileLocatorHelper.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/internal/DefaultFileLocatorHelper.java @@ -36,6 +36,9 @@ import org.eclipse.jetty.util.resource.FileResource; import org.osgi.framework.Bundle; /** + * DefaultFileLocatorHelper + * + * * From a bundle to its location on the filesystem. Assumes the bundle is not a * jar. * diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/internal/PackageAdminServiceTracker.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/internal/PackageAdminServiceTracker.java index 384b392c9ae..c3fd3aa5912 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/internal/PackageAdminServiceTracker.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/internal/PackageAdminServiceTracker.java @@ -35,6 +35,9 @@ import org.osgi.service.packageadmin.PackageAdmin; import org.osgi.service.startlevel.StartLevel; /** + * PackageAdminServiceTracker + * + * * When the PackageAdmin service is activated we can look for the fragments * attached to this bundle and "activate" them. */ From c7c3e4455f68a2f6d7c49df5c3d9a7495d43fd7c Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Thu, 11 Apr 2013 11:22:35 +1000 Subject: [PATCH 11/30] 404511 fixed poor methods in ArrayTernaryTrie --- .../org/eclipse/jetty/util/AbstractTrie.java | 19 --- .../eclipse/jetty/util/ArrayTernaryTrie.java | 129 ++++++++++++++++++ 2 files changed, 129 insertions(+), 19 deletions(-) diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/AbstractTrie.java b/jetty-util/src/main/java/org/eclipse/jetty/util/AbstractTrie.java index dd2f53c933d..a9cb82791c1 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/AbstractTrie.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/AbstractTrie.java @@ -57,16 +57,6 @@ public abstract class AbstractTrie implements Trie return get(s,0,s.length()); } - - @Override - public V get(ByteBuffer b, int offset, int len) - { - b=b.duplicate(); - b.position(b.position()+offset); - b.limit(b.position()+len); - return get(BufferUtil.toString(b,StringUtil.__ISO_8859_1_CHARSET)); - } - @Override public V get(ByteBuffer b) { @@ -85,15 +75,6 @@ public abstract class AbstractTrie implements Trie return getBest(new String(b,offset,len,StringUtil.__ISO_8859_1_CHARSET)); } - @Override - public V getBest(ByteBuffer b, int offset, int len) - { - b=b.duplicate(); - b.position(b.position()+offset); - b.limit(b.position()+len); - return getBest(BufferUtil.toString(b,StringUtil.__ISO_8859_1_CHARSET)); - } - @Override public boolean isCaseInsensitive() { diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/ArrayTernaryTrie.java b/jetty-util/src/main/java/org/eclipse/jetty/util/ArrayTernaryTrie.java index 7c92ac5477e..312bd966fe8 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/ArrayTernaryTrie.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/ArrayTernaryTrie.java @@ -18,6 +18,7 @@ package org.eclipse.jetty.util; +import java.nio.ByteBuffer; import java.util.HashSet; import java.util.Set; @@ -194,6 +195,45 @@ public class ArrayTernaryTrie extends AbstractTrie } + @Override + public V get(ByteBuffer b, int offset, int length) + { + int t = _tree[EQ]; + int len = length; + int i=0; + offset+=b.position(); + + while(i extends AbstractTrie } + /* ------------------------------------------------------------ */ + @Override + public V getBest(ByteBuffer b, int offset, int len) + { + if (b.hasArray()) + return getBest(_tree[EQ],b.array(),b.arrayOffset()+b.position()+offset,len); + return getBest(_tree[EQ],b,offset,len); + } + + /* ------------------------------------------------------------ */ + private V getBest(int t,byte[] b, int offset, int len) + { + int node=0; + for(int i=0; t!=0 && i Date: Thu, 11 Apr 2013 11:45:53 +1000 Subject: [PATCH 12/30] 403591 do not use the ConcurrentArrayBlockingQueue for thread pool, selector and async request log --- .../java/org/eclipse/jetty/server/AsyncNCSARequestLog.java | 2 +- .../java/org/eclipse/jetty/util/thread/QueuedThreadPool.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/AsyncNCSARequestLog.java b/jetty-server/src/main/java/org/eclipse/jetty/server/AsyncNCSARequestLog.java index 047e3b6d401..300d23cc75c 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/AsyncNCSARequestLog.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/AsyncNCSARequestLog.java @@ -57,7 +57,7 @@ public class AsyncNCSARequestLog extends NCSARequestLog { super(filename); if (queue==null) - queue=new ConcurrentArrayBlockingQueue.Bounded(1024); + queue=new ConcurrentArrayBlockingQueue.Unbounded(); _queue=queue; } diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/QueuedThreadPool.java b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/QueuedThreadPool.java index dcfa977da5d..91d957376d1 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/QueuedThreadPool.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/QueuedThreadPool.java @@ -31,6 +31,7 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; import org.eclipse.jetty.util.BlockingArrayQueue; +import org.eclipse.jetty.util.ConcurrentArrayBlockingQueue; import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; @@ -91,7 +92,8 @@ public class QueuedThreadPool extends AbstractLifeCycle implements SizedThreadPo setStopTimeout(5000); if (queue==null) - queue=new BlockingArrayQueue(_minThreads, _minThreads);// TODO ConcurrentArrayBlockingQueue.Unbounded(); + queue=new ConcurrentArrayBlockingQueue.Unbounded(); + // queue=new BlockingArrayQueue(_minThreads, _minThreads); _jobs=queue; } From a0ec3b68346bbd601ebc754c9dfe9d7786a5a08f Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Thu, 11 Apr 2013 12:00:41 +1000 Subject: [PATCH 13/30] removed commented out line --- .../java/org/eclipse/jetty/util/thread/QueuedThreadPool.java | 1 - 1 file changed, 1 deletion(-) diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/QueuedThreadPool.java b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/QueuedThreadPool.java index 91d957376d1..4ffc8022b85 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/QueuedThreadPool.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/QueuedThreadPool.java @@ -93,7 +93,6 @@ public class QueuedThreadPool extends AbstractLifeCycle implements SizedThreadPo if (queue==null) queue=new ConcurrentArrayBlockingQueue.Unbounded(); - // queue=new BlockingArrayQueue(_minThreads, _minThreads); _jobs=queue; } From 9bb02604108789b017eb93b40fa667f1189fbf7a Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Thu, 11 Apr 2013 12:01:01 +1000 Subject: [PATCH 14/30] improved shutdown handling for travis CI --- .../java/org/eclipse/jetty/server/AbstractConnector.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java b/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java index 2fced56d1a8..28fea907e50 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java @@ -289,8 +289,9 @@ public abstract class AbstractConnector extends ContainerLifeCycle implements Co // If we have a stop timeout long stopTimeout = getStopTimeout(); - if (stopTimeout > 0 && _stopping!=null) - _stopping.await(stopTimeout,TimeUnit.MILLISECONDS); + CountDownLatch stopping=_stopping; + if (stopTimeout > 0 && stopping!=null) + stopping.await(stopTimeout,TimeUnit.MILLISECONDS); _stopping=null; super.doStop(); @@ -475,7 +476,9 @@ public abstract class AbstractConnector extends ContainerLifeCycle implements Co { _acceptors[_acceptor] = null; } - _stopping.countDown(); + CountDownLatch stopping=_stopping; + if (stopping!=null) + stopping.countDown(); } } } From 67839757075ea89a1f972129237e2fad5477453f Mon Sep 17 00:00:00 2001 From: Jan Bartel Date: Thu, 11 Apr 2013 14:23:36 +1000 Subject: [PATCH 15/30] Prune unused code; add more comments; rename classes. --- ...java => ContainerTldBundleDiscoverer.java} | 15 ++- ...zerImpl.java => JSTLBundleDiscoverer.java} | 16 +-- .../osgi/boot/jsp/FragmentActivator.java | 47 ++++---- .../osgi/boot/AbstractWebAppProvider.java | 5 +- .../osgi/boot/JettyBootstrapActivator.java | 10 -- .../osgi/boot/OSGiMetaInfConfiguration.java | 1 + ...assloaderWithInsertedJettyClassloader.java | 69 ----------- .../DefaultJettyAtJettyHomeHelper.java | 1 + .../serverfactory/ServerInstanceWrapper.java | 113 +++++++++--------- .../webapp/IWebBundleDeployerHelper.java | 88 -------------- .../webapp/LibExtClassLoaderHelper.java | 13 +- .../webapp/OSGiWebappClassLoader.java | 33 +++-- .../webapp/WebBundleTrackerCustomizer.java | 12 +- .../boot/utils/BundleClassLoaderHelper.java | 4 + .../utils/BundleClassLoaderHelperFactory.java | 4 + .../boot/utils/BundleFileLocatorHelper.java | 3 + .../jetty/osgi/boot/utils/EventSender.java | 39 +++++- .../FakeURLClassLoader.java} | 46 ++++--- ...stomizer.java => TldBundleDiscoverer.java} | 14 +-- .../internal/PackageAdminServiceTracker.java | 5 +- 20 files changed, 229 insertions(+), 309 deletions(-) rename jetty-osgi/jetty-osgi-boot-jsp/src/main/java/org/eclipse/jetty/osgi/boot/jasper/{PluggableWebAppRegistrationCustomizerImpl.java => ContainerTldBundleDiscoverer.java} (89%) rename jetty-osgi/jetty-osgi-boot-jsp/src/main/java/org/eclipse/jetty/osgi/boot/jasper/{WebappRegistrationCustomizerImpl.java => JSTLBundleDiscoverer.java} (94%) delete mode 100644 jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/jsp/TldLocatableURLClassloaderWithInsertedJettyClassloader.java delete mode 100644 jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/IWebBundleDeployerHelper.java rename jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/{internal/jsp/TldLocatableURLClassloader.java => utils/FakeURLClassLoader.java} (55%) rename jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/{WebappRegistrationCustomizer.java => TldBundleDiscoverer.java} (69%) diff --git a/jetty-osgi/jetty-osgi-boot-jsp/src/main/java/org/eclipse/jetty/osgi/boot/jasper/PluggableWebAppRegistrationCustomizerImpl.java b/jetty-osgi/jetty-osgi-boot-jsp/src/main/java/org/eclipse/jetty/osgi/boot/jasper/ContainerTldBundleDiscoverer.java similarity index 89% rename from jetty-osgi/jetty-osgi-boot-jsp/src/main/java/org/eclipse/jetty/osgi/boot/jasper/PluggableWebAppRegistrationCustomizerImpl.java rename to jetty-osgi/jetty-osgi-boot-jsp/src/main/java/org/eclipse/jetty/osgi/boot/jasper/ContainerTldBundleDiscoverer.java index 2036eb9800b..f9c212a516a 100644 --- a/jetty-osgi/jetty-osgi-boot-jsp/src/main/java/org/eclipse/jetty/osgi/boot/jasper/PluggableWebAppRegistrationCustomizerImpl.java +++ b/jetty-osgi/jetty-osgi-boot-jsp/src/main/java/org/eclipse/jetty/osgi/boot/jasper/ContainerTldBundleDiscoverer.java @@ -30,25 +30,30 @@ import java.util.regex.Pattern; import org.eclipse.jetty.deploy.DeploymentManager; import org.eclipse.jetty.osgi.boot.OSGiWebInfConfiguration; import org.eclipse.jetty.osgi.boot.utils.BundleFileLocatorHelper; -import org.eclipse.jetty.osgi.boot.utils.WebappRegistrationCustomizer; +import org.eclipse.jetty.osgi.boot.utils.TldBundleDiscoverer; import org.osgi.framework.Bundle; import org.osgi.framework.FrameworkUtil; /** - * PluggableWebAppRegistrationCustomizerImpl + * ContainerTldBundleDiscoverer * * * Use a System property to define bundles that contain tlds that need to * be treated by jasper as if they were on the jetty container's classpath. * + * The value of the property is evaluated against the DeploymentManager + * context attribute "org.eclipse.jetty.server.webapp.containerIncludeBundlePattern", + * which defines a pattern of matching bundle names. + * * The bundle locations are converted to URLs for jasper's use. * * Eg: * -Dorg.eclipse.jetty.osgi.tldbundles=org.springframework.web.servlet,com.opensymphony.module.sitemesh + * */ -public class PluggableWebAppRegistrationCustomizerImpl implements WebappRegistrationCustomizer +public class ContainerTldBundleDiscoverer implements TldBundleDiscoverer { /** * Comma separated list of names of bundles that contain tld files that should be @@ -66,7 +71,7 @@ public class PluggableWebAppRegistrationCustomizerImpl implements WebappRegistra * * @return The location of the jars that contain tld files as URLs. */ - public URL[] getJarsWithTlds(DeploymentManager deploymentManager, BundleFileLocatorHelper locatorHelper) throws Exception + public URL[] getUrlsForBundlesWithTlds(DeploymentManager deploymentManager, BundleFileLocatorHelper locatorHelper) throws Exception { // naive way of finding those bundles. // lots of assumptions: for example we assume a single version of each @@ -77,7 +82,7 @@ public class PluggableWebAppRegistrationCustomizerImpl implements WebappRegistra // probably using custom properties in the ContextHandler service // and mirroring those in the MANIFEST.MF - Bundle[] bundles = FrameworkUtil.getBundle(PluggableWebAppRegistrationCustomizerImpl.class).getBundleContext().getBundles(); + Bundle[] bundles = FrameworkUtil.getBundle(ContainerTldBundleDiscoverer.class).getBundleContext().getBundles(); HashSet urls = new HashSet(); String tmp = System.getProperty(SYS_PROP_TLD_BUNDLES); //comma separated exact names List sysNames = new ArrayList(); diff --git a/jetty-osgi/jetty-osgi-boot-jsp/src/main/java/org/eclipse/jetty/osgi/boot/jasper/WebappRegistrationCustomizerImpl.java b/jetty-osgi/jetty-osgi-boot-jsp/src/main/java/org/eclipse/jetty/osgi/boot/jasper/JSTLBundleDiscoverer.java similarity index 94% rename from jetty-osgi/jetty-osgi-boot-jsp/src/main/java/org/eclipse/jetty/osgi/boot/jasper/WebappRegistrationCustomizerImpl.java rename to jetty-osgi/jetty-osgi-boot-jsp/src/main/java/org/eclipse/jetty/osgi/boot/jasper/JSTLBundleDiscoverer.java index 9212e425511..23628c39e7e 100644 --- a/jetty-osgi/jetty-osgi-boot-jsp/src/main/java/org/eclipse/jetty/osgi/boot/jasper/WebappRegistrationCustomizerImpl.java +++ b/jetty-osgi/jetty-osgi-boot-jsp/src/main/java/org/eclipse/jetty/osgi/boot/jasper/JSTLBundleDiscoverer.java @@ -34,7 +34,7 @@ import org.apache.jasper.xmlparser.ParserUtils; import org.eclipse.jetty.deploy.DeploymentManager; import org.eclipse.jetty.osgi.boot.JettyBootstrapActivator; import org.eclipse.jetty.osgi.boot.utils.BundleFileLocatorHelper; -import org.eclipse.jetty.osgi.boot.utils.WebappRegistrationCustomizer; +import org.eclipse.jetty.osgi.boot.utils.TldBundleDiscoverer; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; import org.osgi.framework.Bundle; @@ -45,19 +45,19 @@ import org.xml.sax.SAXException; /** * - * WebappRegistrationCustomizerImpl + * JSTLBundleDiscoverer * * Fix various shortcomings with the way jasper parses the tld files. Plugs the * JSTL tlds assuming that they are packaged with the bundle that contains the * JSTL classes. *

    * Pluggable tlds at the server level are handled by - * {@link PluggableWebAppRegistrationCustomizerImpl}. + * {@link ContainerTldBundleDiscoverer}. *

    */ -public class WebappRegistrationCustomizerImpl implements WebappRegistrationCustomizer +public class JSTLBundleDiscoverer implements TldBundleDiscoverer { - private static final Logger LOG = Log.getLogger(WebappRegistrationCustomizerImpl.class); + private static final Logger LOG = Log.getLogger(JSTLBundleDiscoverer.class); /** @@ -86,7 +86,7 @@ public class WebappRegistrationCustomizerImpl implements WebappRegistrationCusto */ private static String DEFAULT_JSP_FACTORY_IMPL_CLASS = "org.apache.jasper.runtime.JspFactoryImpl"; - public WebappRegistrationCustomizerImpl() + public JSTLBundleDiscoverer() { fixupDtdResolution(); @@ -139,7 +139,7 @@ public class WebappRegistrationCustomizerImpl implements WebappRegistrationCusto * @return array of URLs * @throws Exception */ - public URL[] getJarsWithTlds(DeploymentManager deployer, BundleFileLocatorHelper locatorHelper) throws Exception + public URL[] getUrlsForBundlesWithTlds(DeploymentManager deployer, BundleFileLocatorHelper locatorHelper) throws Exception { ArrayList urls = new ArrayList(); @@ -151,7 +151,7 @@ public class WebappRegistrationCustomizerImpl implements WebappRegistrationCusto // So we can look for this class using this bundle's classloader: try { - Class jstlClass = WebappRegistrationCustomizerImpl.class.getClassLoader().loadClass(DEFAULT_JSTL_BUNDLE_CLASS); + Class jstlClass = JSTLBundleDiscoverer.class.getClassLoader().loadClass(DEFAULT_JSTL_BUNDLE_CLASS); classesToAddToTheTldBundles.add(jstlClass); } diff --git a/jetty-osgi/jetty-osgi-boot-jsp/src/main/java/org/eclipse/jetty/osgi/boot/jsp/FragmentActivator.java b/jetty-osgi/jetty-osgi-boot-jsp/src/main/java/org/eclipse/jetty/osgi/boot/jsp/FragmentActivator.java index 9741d21c7dd..b17270224fc 100644 --- a/jetty-osgi/jetty-osgi-boot-jsp/src/main/java/org/eclipse/jetty/osgi/boot/jsp/FragmentActivator.java +++ b/jetty-osgi/jetty-osgi-boot-jsp/src/main/java/org/eclipse/jetty/osgi/boot/jsp/FragmentActivator.java @@ -19,21 +19,26 @@ package org.eclipse.jetty.osgi.boot.jsp; import org.eclipse.jetty.osgi.boot.BundleWebAppProvider; -import org.eclipse.jetty.osgi.boot.internal.webapp.WebBundleTrackerCustomizer; -import org.eclipse.jetty.osgi.boot.jasper.PluggableWebAppRegistrationCustomizerImpl; -import org.eclipse.jetty.osgi.boot.jasper.WebappRegistrationCustomizerImpl; +import org.eclipse.jetty.osgi.boot.internal.serverfactory.ServerInstanceWrapper; +import org.eclipse.jetty.osgi.boot.jasper.ContainerTldBundleDiscoverer; +import org.eclipse.jetty.osgi.boot.jasper.JSTLBundleDiscoverer; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; /** - * Pseudo fragment activator. Called by the main org.eclipse.jetty.osgi.boot - * bundle. Please note: this is not a real BundleActivator. Simply something - * called back by the host bundle. - *

    - * It must be placed in the org.eclipse.jetty.osgi.boot.jsp package: this is - * because org.eclipse.jetty.osgi.boot.jsp is the symbolic-name of this - * fragment. From that name, the PackageadminTracker will call this class. IN a - * different package it won't be called. + * FragmentActivator + * + * Sets up support for jsp. All relevant jsp jars must also be installed + * into the osgi environment. + *

    + * Note that as this is part of a bundle fragment, this activator is NOT + * called by the OSGi environment. Instead, the org.eclipse.jetty.osgi.boot.utils.internal.PackageAdminTracker + * simulates fragment activation and causes this class's start() method to + * be called. + *

    + *

    + * The package of this class MUST match the Bundle-SymbolicName of this fragment + * in order for the PackageAdminTracker to find it. *

    */ public class FragmentActivator implements BundleActivator @@ -43,12 +48,14 @@ public class FragmentActivator implements BundleActivator */ public void start(BundleContext context) throws Exception { + //jsr199 compilation does not work in osgi System.setProperty("org.apache.jasper.compiler.disablejsr199", Boolean.TRUE.toString()); - WebBundleTrackerCustomizer.JSP_REGISTRATION_HELPERS.add(new WebappRegistrationCustomizerImpl()); - WebBundleTrackerCustomizer.JSP_REGISTRATION_HELPERS.add(new PluggableWebAppRegistrationCustomizerImpl()); - //Put in the support for the tag libs - addTagLibSupport(); - + + //set up some classes that will look for bundles with tlds that must be converted + //to urls and treated as if they are on the Jetty container's classpath so that + //jasper can deal with them + ServerInstanceWrapper.addContainerTldBundleDiscoverer(new JSTLBundleDiscoverer()); + ServerInstanceWrapper.addContainerTldBundleDiscoverer(new ContainerTldBundleDiscoverer()); } /** @@ -58,12 +65,4 @@ public class FragmentActivator implements BundleActivator { } - - public void addTagLibSupport () - { - String[] defaultConfigurations = new String[BundleWebAppProvider.getDefaultConfigurations().length+1]; - System.arraycopy(BundleWebAppProvider.getDefaultConfigurations(), 0, defaultConfigurations, 0, BundleWebAppProvider.getDefaultConfigurations().length); - defaultConfigurations[defaultConfigurations.length-1] = "org.eclipse.jetty.osgi.boot.jsp.TagLibOSGiConfiguration"; - BundleWebAppProvider.setDefaultConfigurations(defaultConfigurations); - } } diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/AbstractWebAppProvider.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/AbstractWebAppProvider.java index 7a854c7dbaf..cbae1c92d8b 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/AbstractWebAppProvider.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/AbstractWebAppProvider.java @@ -58,10 +58,9 @@ public abstract class AbstractWebAppProvider extends AbstractLifeCycle implement public static String __defaultConfigurations[] = { "org.eclipse.jetty.osgi.boot.OSGiWebInfConfiguration", "org.eclipse.jetty.webapp.WebXmlConfiguration", - "org.eclipse.jetty.osgi.boot.OSGiMetaInfConfiguration", + "org.eclipse.jetty.webapp.MetaInfConfiguration", "org.eclipse.jetty.webapp.FragmentConfiguration", - "org.eclipse.jetty.webapp.JettyWebXmlConfiguration"//, - //"org.eclipse.jetty.osgi.boot.jsp.TagLibOSGiConfiguration" + "org.eclipse.jetty.webapp.JettyWebXmlConfiguration" }; public static void setDefaultConfigurations (String[] defaultConfigs) diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/JettyBootstrapActivator.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/JettyBootstrapActivator.java index 2e874bcb253..91fb3a388a7 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/JettyBootstrapActivator.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/JettyBootstrapActivator.java @@ -18,13 +18,8 @@ package org.eclipse.jetty.osgi.boot; -import java.util.Dictionary; -import java.util.Hashtable; - - import org.eclipse.jetty.osgi.boot.internal.serverfactory.DefaultJettyAtJettyHomeHelper; import org.eclipse.jetty.osgi.boot.internal.serverfactory.JettyServerServiceTracker; -import org.eclipse.jetty.osgi.boot.internal.webapp.IWebBundleDeployerHelper; import org.eclipse.jetty.osgi.boot.internal.webapp.JettyContextHandlerServiceTracker; import org.eclipse.jetty.osgi.boot.internal.webapp.WebBundleTrackerCustomizer; import org.eclipse.jetty.osgi.boot.utils.internal.PackageAdminServiceTracker; @@ -32,16 +27,11 @@ import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.handler.ContextHandler; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; -import org.eclipse.jetty.webapp.WebAppContext; import org.osgi.framework.Bundle; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; -import org.osgi.framework.BundleException; -import org.osgi.framework.FrameworkUtil; -import org.osgi.framework.ServiceReference; import org.osgi.framework.ServiceRegistration; import org.osgi.util.tracker.BundleTracker; -import org.osgi.util.tracker.ServiceTracker; /** * JettyBootstrapActivator diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiMetaInfConfiguration.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiMetaInfConfiguration.java index c67b6bb1f33..9767bd310c8 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiMetaInfConfiguration.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiMetaInfConfiguration.java @@ -38,6 +38,7 @@ import org.osgi.framework.Bundle; * Extension of standard Jetty MetaInfConfiguration class to handle OSGi bundle * fragments that may also need to be scanned for META-INF info. * + * @deprecated */ public class OSGiMetaInfConfiguration extends MetaInfConfiguration { diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/jsp/TldLocatableURLClassloaderWithInsertedJettyClassloader.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/jsp/TldLocatableURLClassloaderWithInsertedJettyClassloader.java deleted file mode 100644 index e4cf805aac6..00000000000 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/jsp/TldLocatableURLClassloaderWithInsertedJettyClassloader.java +++ /dev/null @@ -1,69 +0,0 @@ -// -// ======================================================================== -// Copyright (c) 1995-2013 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 -// -// The Apache License v2.0 is available at -// http://www.opensource.org/licenses/apache2.0.php -// -// You may elect to redistribute this code under either of these licenses. -// ======================================================================== -// - -package org.eclipse.jetty.osgi.boot.internal.jsp; - -import java.net.URL; - -/** - * Add a classloader to the - * org.apache.jasper.compiler.TldLocatableURLClassloader. Hopefuly not - * necessary: still experimenting. - * - * @see TldLocatableURLClassloader - */ -public class TldLocatableURLClassloaderWithInsertedJettyClassloader extends TldLocatableURLClassloader -{ - - private ClassLoader _internalClassLoader; - - /** - * - * @param osgiClassLoaderParent - * The parent classloader - * @param internalClassLoader - * The classloader that will be at the same level than the - * jarsWithTldsInside - * @param jarsWithTldsInside - * jars that are scanned for tld files. - */ - public TldLocatableURLClassloaderWithInsertedJettyClassloader(ClassLoader osgiClassLoaderParent, ClassLoader internalClassLoader, URL[] jarsWithTldsInside) - { - super(osgiClassLoaderParent,jarsWithTldsInside); - _internalClassLoader = internalClassLoader; - } - - protected Class findClass(String name) throws ClassNotFoundException - { - try - { - return super.findClass(name); - } - catch (ClassNotFoundException cne) - { - if (_internalClassLoader != null) - { - return _internalClassLoader.loadClass(name); - } - else - { - throw cne; - } - } - } -} diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/serverfactory/DefaultJettyAtJettyHomeHelper.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/serverfactory/DefaultJettyAtJettyHomeHelper.java index 4c4066b47b2..a89ff5b7300 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/serverfactory/DefaultJettyAtJettyHomeHelper.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/serverfactory/DefaultJettyAtJettyHomeHelper.java @@ -66,6 +66,7 @@ public class DefaultJettyAtJettyHomeHelper public static final String DEFAULT_JETTYHOME = "/jettyhome/"; + /* ------------------------------------------------------------ */ /** * Called by the JettyBootStrapActivator. If the system property jetty.home diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/serverfactory/ServerInstanceWrapper.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/serverfactory/ServerInstanceWrapper.java index a7e9daaa2ef..209fee6d9df 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/serverfactory/ServerInstanceWrapper.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/serverfactory/ServerInstanceWrapper.java @@ -19,7 +19,6 @@ package org.eclipse.jetty.osgi.boot.internal.serverfactory; import java.io.File; -import java.io.IOException; import java.io.InputStream; import java.net.URL; import java.util.ArrayList; @@ -27,8 +26,10 @@ import java.util.Collection; import java.util.Dictionary; import java.util.Enumeration; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.StringTokenizer; import org.eclipse.jetty.deploy.AppLifeCycle; @@ -44,11 +45,10 @@ import org.eclipse.jetty.osgi.boot.OSGiServerConstants; import org.eclipse.jetty.osgi.boot.OSGiUndeployer; import org.eclipse.jetty.osgi.boot.ServiceContextProvider; import org.eclipse.jetty.osgi.boot.ServiceWebAppProvider; -import org.eclipse.jetty.osgi.boot.internal.jsp.TldLocatableURLClassloader; import org.eclipse.jetty.osgi.boot.internal.webapp.BundleFileLocatorHelperFactory; import org.eclipse.jetty.osgi.boot.internal.webapp.LibExtClassLoaderHelper; -import org.eclipse.jetty.osgi.boot.internal.webapp.WebBundleTrackerCustomizer; -import org.eclipse.jetty.osgi.boot.utils.WebappRegistrationCustomizer; +import org.eclipse.jetty.osgi.boot.utils.FakeURLClassLoader; +import org.eclipse.jetty.osgi.boot.utils.TldBundleDiscoverer; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.handler.ContextHandlerCollection; import org.eclipse.jetty.util.IO; @@ -72,6 +72,9 @@ public class ServerInstanceWrapper * support the case where the bundle is zipped. */ public static final String PROPERTY_THIS_JETTY_XML_FOLDER_URL = "this.jetty.xml.parent.folder.url"; + + + private static Collection __containerTldBundleDiscoverers = new ArrayList(); private static Logger LOG = Log.getLogger(ServerInstanceWrapper.class.getName()); @@ -96,6 +99,21 @@ public class ServerInstanceWrapper private DeploymentManager _deploymentManager; + + /* ------------------------------------------------------------ */ + public static void addContainerTldBundleDiscoverer (TldBundleDiscoverer tldBundleDiscoverer) + { + __containerTldBundleDiscoverers.add(tldBundleDiscoverer); + } + + /* ------------------------------------------------------------ */ + public static Collection getContainerTldBundleDiscoverers() + { + return __containerTldBundleDiscoverers; + } + + + /* ------------------------------------------------------------ */ public ServerInstanceWrapper(String managedServerName) { @@ -173,9 +191,29 @@ public class ServerInstanceWrapper configure(server, props); init(); + + //if support for jsp is enabled, we need to convert locations of bundles that contain tlds into urls. + //these are tlds that we want jasper to treat as if they are on the container's classpath. Web bundles + //can use the Require-TldBundle MANIFEST header to name other tld-containing bundles that should be regarded + //as on the webapp classpath. + if (!__containerTldBundleDiscoverers.isEmpty()) + { + Set urls = new HashSet(); + //discover bundles with tlds that need to be on the container's classpath as URLs + for (TldBundleDiscoverer d:__containerTldBundleDiscoverers) + { + URL[] list = d.getUrlsForBundlesWithTlds(_deploymentManager, BundleFileLocatorHelperFactory.getFactory().getHelper()); + if (list != null) + { + for (URL u:list) + urls.add(u); + } + } + _commonParentClassLoaderForWebapps = new FakeURLClassLoader(libExtClassLoader, urls.toArray(new URL[urls.size()])); + } + else + _commonParentClassLoaderForWebapps = libExtClassLoader; - URL[] jarsWithTlds = getJarsWithTlds(); - _commonParentClassLoaderForWebapps = jarsWithTlds == null ? libExtClassLoader : new TldLocatableURLClassloader(libExtClassLoader, jarsWithTlds); if (LOG.isDebugEnabled()) LOG.debug("common classloader = "+_commonParentClassLoaderForWebapps); @@ -219,54 +257,7 @@ public class ServerInstanceWrapper } - /* ------------------------------------------------------------ */ - /** - * TODO: right now only the jetty-jsp bundle is scanned for common taglibs. - * Should support a way to plug more bundles that contain taglibs. - * - * The jasper TldScanner expects a URLClassloader to parse a jar for the - * /META-INF/*.tld it may contain. We place the bundles that we know contain - * such tag-libraries. Please note that it will work if and only if the - * bundle is a jar (!) Currently we just hardcode the bundle that contains - * the jstl implementation. - * - * A workaround when the tld cannot be parsed with this method is to copy - * and paste it inside the WEB-INF of the webapplication where it is used. - * - * Support only 2 types of packaging for the bundle: - the bundle is a jar - * (recommended for runtime.) - the bundle is a folder and contain jars in - * the root and/or in the lib folder (nice for PDE development situations) - * Unsupported: the bundle is a jar that embeds more jars. - * - * @return - * @throws Exception - */ - private URL[] getJarsWithTlds() throws Exception - { - - //Jars that are added onto the equivalent of the container classpath are: - // jstl jars: identified by the class WhenTag (and the boot-bundle manifest imports the jstl packages - // bundles identified by System property org.eclipse.jetty.osgi.tldbundles - // bundle symbolic name patterns defined in the DeploymentManager - // - // Any bundles mentioned in the Require-TldBundle manifest header of the webapp bundle MUST ALSO HAVE Import-Bundle - // in order to get them onto the classpath of the webapp. - - ArrayList res = new ArrayList(); - for (WebappRegistrationCustomizer regCustomizer : WebBundleTrackerCustomizer.JSP_REGISTRATION_HELPERS) - { - URL[] urls = regCustomizer.getJarsWithTlds(_deploymentManager, BundleFileLocatorHelperFactory.getFactory().getHelper()); - for (URL url : urls) - { - if (!res.contains(url)) res.add(url); - } - } - if (!res.isEmpty()) - return res.toArray(new URL[res.size()]); - else - return null; - } - + /* ------------------------------------------------------------ */ private void configure(Server server, Dictionary props) throws Exception @@ -340,7 +331,9 @@ public class ServerInstanceWrapper } } - + + + /* ------------------------------------------------------------ */ /** * Must be called after the server is configured. * @@ -438,7 +431,9 @@ public class ServerInstanceWrapper } } } - + + + /* ------------------------------------------------------------ */ /** * @return The default folder in which the context files of the osgi bundles * are located and watched. Or null when the system property @@ -463,7 +458,7 @@ public class ServerInstanceWrapper return new File(jettyHome, "/contexts"); } - + /* ------------------------------------------------------------ */ /** * @return the urls in this string. */ @@ -485,7 +480,9 @@ public class ServerInstanceWrapper } return urls; } - + + + /* ------------------------------------------------------------ */ /** * Get the folders that might contain jars for the legacy J2EE shared * libraries diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/IWebBundleDeployerHelper.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/IWebBundleDeployerHelper.java deleted file mode 100644 index 1c5cd3e6c0a..00000000000 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/IWebBundleDeployerHelper.java +++ /dev/null @@ -1,88 +0,0 @@ -// -// ======================================================================== -// Copyright (c) 1995-2013 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 -// -// The Apache License v2.0 is available at -// http://www.opensource.org/licenses/apache2.0.php -// -// You may elect to redistribute this code under either of these licenses. -// ======================================================================== -// - -package org.eclipse.jetty.osgi.boot.internal.webapp; - - -import org.eclipse.jetty.server.handler.ContextHandler; -import org.eclipse.jetty.webapp.WebAppContext; -import org.osgi.framework.Bundle; - -/** - * Internal interface for the class that deploys a webapp on a server. Used as - * we migrate from the single instance of the jety server to multiple jetty - * servers. - */ -public interface IWebBundleDeployerHelper -{ - - /** - * when this property is present, the type of context handler registered is - * not known in advance. - */ - public static final String INTERNAL_SERVICE_PROP_UNKNOWN_CONTEXT_HANDLER_TYPE = "unknownContextHandlerType"; - - /** - * Deploy a new web application on the jetty server. - * - * @param bundle The bundle - * @param webappFolderPath The path to the root of the webapp. Must be a - * path relative to bundle; either an absolute path. - * @param contextPath The context path. Must start with "/" - * @param extraClasspath - * @param overrideBundleInstallLocation - * @param requireTldBundle The list of bundles's symbolic names that contain - * tld files that are required by this WAB. - * @param webXmlPath - * @param defaultWebXmlPath TODO: parameter description - * @return The contexthandler created and started - * @throws Exception - */ - public abstract WebAppContext registerWebapplication(Bundle bundle, String webappFolderPath, String contextPath, String extraClasspath, - String overrideBundleInstallLocation, String requireTldBundle, String webXmlPath, - String defaultWebXmlPath, WebAppContext webAppContext) throws Exception; - - /** - * Stop a ContextHandler and remove it from the collection. - * - * @see ContextDeployer#undeploy - * @param contextHandler - * @throws Exception - */ - public abstract void unregister(ContextHandler contextHandler) throws Exception; - - /** - * This type of registration relies on jetty's complete context xml file. - * Context encompasses jndi and all other things. This makes the definition - * of the webapp a lot more self-contained. - * - * @param contributor - * @param contextFileRelativePath - * @param extraClasspath - * @param overrideBundleInstallLocation - * @param requireTldBundle The list of bundles'symbolic name that contain - * tld files for this webapp. - * @param handler the context handler passed in the server reference that - * will be configured, deployed and started. - * @return The contexthandler created and started - * @throws Exception - */ - public abstract ContextHandler registerContext(Bundle contributor, String contextFileRelativePath, String extraClasspath, - String overrideBundleInstallLocation, String requireTldBundle, ContextHandler handler) throws Exception; - -} \ No newline at end of file diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/LibExtClassLoaderHelper.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/LibExtClassLoaderHelper.java index 705c9cfa722..76738348d7d 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/LibExtClassLoaderHelper.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/LibExtClassLoaderHelper.java @@ -60,17 +60,23 @@ import org.eclipse.jetty.server.Server; */ public class LibExtClassLoaderHelper { - + /* ------------------------------------------------------------ */ /** - * Class called back + * IFilesInJettyHomeResourcesProcessor + * + * Interface for callback impls */ public interface IFilesInJettyHomeResourcesProcessor { void processFilesInResourcesFolder(File jettyHome, Map filesInResourcesFolder); } + + public static Set registeredFilesInJettyHomeResourcesProcessors = new HashSet(); + + /* ------------------------------------------------------------ */ /** * @param server * @return a url classloader with the jars of resources, lib/ext and the @@ -125,6 +131,8 @@ public class LibExtClassLoaderHelper return new URLClassLoader(urls.toArray(new URL[urls.size()]), parentClassLoader); } + + /* ------------------------------------------------------------ */ /** * @param server * @return a url classloader with the jars of resources, lib/ext and the @@ -168,6 +176,7 @@ public class LibExtClassLoaderHelper return new URLClassLoader(urls.toArray(new URL[urls.size()]), parentClassLoader); } + /* ------------------------------------------------------------ */ /** * When we find files typically used for central logging configuration we do * what it takes in this method to do what the user expects. Without diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/OSGiWebappClassLoader.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/OSGiWebappClassLoader.java index 71e9e7936fc..e963b91344a 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/OSGiWebappClassLoader.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/OSGiWebappClassLoader.java @@ -80,7 +80,7 @@ public class OSGiWebappClassLoader extends WebAppClassLoader implements BundleRe private boolean _lookInOsgiFirst = true; - + /* ------------------------------------------------------------ */ /** * @param parent The parent classloader. * @param context The WebAppContext @@ -94,7 +94,10 @@ public class OSGiWebappClassLoader extends WebAppClassLoader implements BundleRe _contributor = contributor; _osgiBundleClassLoader = BundleClassLoaderHelperFactory.getFactory().getHelper().getBundleClassLoader(contributor); } - + + + + /* ------------------------------------------------------------ */ /** * Returns the Bundle that defined this web-application. * @@ -106,7 +109,7 @@ public class OSGiWebappClassLoader extends WebAppClassLoader implements BundleRe return _contributor; } - + /* ------------------------------------------------------------ */ @Override public Enumeration getResources(String name) throws IOException { @@ -121,7 +124,10 @@ public class OSGiWebappClassLoader extends WebAppClassLoader implements BundleRe return Collections.enumeration(toList(urls, osgiUrls)); } } - + + + + /* ------------------------------------------------------------ */ @Override public URL getResource(String name) { @@ -136,7 +142,10 @@ public class OSGiWebappClassLoader extends WebAppClassLoader implements BundleRe return url != null ? url : _osgiBundleClassLoader.getResource(name); } } - + + + + /* ------------------------------------------------------------ */ private List toList(Enumeration e, Enumeration e2) { List list = new ArrayList(); @@ -147,9 +156,8 @@ public class OSGiWebappClassLoader extends WebAppClassLoader implements BundleRe return list; } - /** - * - */ + + /* ------------------------------------------------------------ */ protected Class findClass(String name) throws ClassNotFoundException { try @@ -168,7 +176,10 @@ public class OSGiWebappClassLoader extends WebAppClassLoader implements BundleRe } } } - + + + + /* ------------------------------------------------------------ */ /** * Parse the classpath ourselves to be able to filter things. This is a * derivative work of the super class @@ -197,6 +208,8 @@ public class OSGiWebappClassLoader extends WebAppClassLoader implements BundleRe } + + /* ------------------------------------------------------------ */ /** * @param lib * @return true if the lib should be included in the webapp classloader. @@ -245,6 +258,8 @@ public class OSGiWebappClassLoader extends WebAppClassLoader implements BundleRe private static Field _contextField; + + /* ------------------------------------------------------------ */ /** * In the case of the generation of a webapp via a jetty context file we * need a proper classloader to setup the app before we have the diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/WebBundleTrackerCustomizer.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/WebBundleTrackerCustomizer.java index 5181b33b51c..ab0c32b9159 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/WebBundleTrackerCustomizer.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/WebBundleTrackerCustomizer.java @@ -28,7 +28,7 @@ import java.util.Map.Entry; import org.eclipse.jetty.osgi.boot.BundleProvider; import org.eclipse.jetty.osgi.boot.OSGiServerConstants; -import org.eclipse.jetty.osgi.boot.utils.WebappRegistrationCustomizer; +import org.eclipse.jetty.osgi.boot.utils.TldBundleDiscoverer; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; import org.osgi.framework.Bundle; @@ -53,7 +53,7 @@ public class WebBundleTrackerCustomizer implements BundleTrackerCustomizer { private static final Logger LOG = Log.getLogger(WebBundleTrackerCustomizer.class); - public static Collection JSP_REGISTRATION_HELPERS = new ArrayList(); + public static Collection JSP_REGISTRATION_HELPERS = new ArrayList(); public static final String FILTER = "(objectclass=" + BundleProvider.class.getName() + ")"; @@ -78,24 +78,28 @@ public class WebBundleTrackerCustomizer implements BundleTrackerCustomizer } - + /* ------------------------------------------------------------ */ public boolean isWaitForDefaultServer() { return _waitForDefaultServer; } - + /* ------------------------------------------------------------ */ public void setWaitForDefaultServer(boolean waitForDefaultServer) { _waitForDefaultServer = waitForDefaultServer; } + + /* ------------------------------------------------------------ */ public void setBundleTracker (BundleTracker bundleTracker) { _bundleTracker = bundleTracker; } + + /* ------------------------------------------------------------ */ public void open () throws Exception { if (_waitForDefaultServer && !_defaultServerReady) diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/BundleClassLoaderHelper.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/BundleClassLoaderHelper.java index 4c4382f3d42..ba99ac21d35 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/BundleClassLoaderHelper.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/BundleClassLoaderHelper.java @@ -22,6 +22,10 @@ import org.eclipse.jetty.osgi.boot.utils.internal.DefaultBundleClassLoaderHelper import org.osgi.framework.Bundle; /** + * + * BundleClassLoaderHelper + * + * * Is there a clean OSGi way to go from the Bundle object to the classloader of * the Bundle ? You can certainly take a class inside the bundle and get the * bundle's classloader that way. Getting the classloader directly from the diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/BundleClassLoaderHelperFactory.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/BundleClassLoaderHelperFactory.java index edcfde0f572..297f0f3c716 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/BundleClassLoaderHelperFactory.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/BundleClassLoaderHelperFactory.java @@ -32,15 +32,19 @@ public class BundleClassLoaderHelperFactory private static BundleClassLoaderHelperFactory _instance = new BundleClassLoaderHelperFactory(); + + /* ------------------------------------------------------------ */ public static BundleClassLoaderHelperFactory getFactory() { return _instance; } + /* ------------------------------------------------------------ */ private BundleClassLoaderHelperFactory() { } + /* ------------------------------------------------------------ */ public BundleClassLoaderHelper getHelper() { //use the default diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/BundleFileLocatorHelper.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/BundleFileLocatorHelper.java index 0809b72906b..2abd7a0ab1d 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/BundleFileLocatorHelper.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/BundleFileLocatorHelper.java @@ -26,6 +26,9 @@ import org.eclipse.jetty.osgi.boot.utils.internal.DefaultFileLocatorHelper; import org.osgi.framework.Bundle; /** + * BundleFileLocatorHelper + * + * * From a bundle to its location on the filesystem. Assumes the bundle is not a * jar. * diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/EventSender.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/EventSender.java index 13703fa416f..c4e06a2b5c8 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/EventSender.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/EventSender.java @@ -21,14 +21,18 @@ package org.eclipse.jetty.osgi.boot.utils; import java.util.Dictionary; import java.util.Hashtable; -import javax.security.auth.login.FailedLoginException; - import org.osgi.framework.Bundle; import org.osgi.framework.FrameworkUtil; import org.osgi.framework.ServiceReference; import org.osgi.service.event.Event; import org.osgi.service.event.EventAdmin; +/** + * EventSender + * + * Utility class for emiting OSGi EventAdmin events + * + */ public class EventSender { //OSGi Event Admin events for webapps @@ -43,6 +47,13 @@ public class EventSender private Bundle _myBundle; private EventAdmin _eventAdmin; + + + + /* ------------------------------------------------------------ */ + /** + * + */ private EventSender () { _myBundle = FrameworkUtil.getBundle(EventSender.class); @@ -50,13 +61,27 @@ public class EventSender if (ref != null) _eventAdmin = (EventAdmin)_myBundle.getBundleContext().getService(ref); } - + + + + /* ------------------------------------------------------------ */ + /** + * @return + */ public static EventSender getInstance() { return __instance; } + + + /* ------------------------------------------------------------ */ + /** + * @param topic + * @param wab + * @param contextPath + */ public void send (String topic, Bundle wab, String contextPath) { if (topic==null || wab==null || contextPath==null) @@ -66,6 +91,14 @@ public class EventSender } + + /* ------------------------------------------------------------ */ + /** + * @param topic + * @param wab + * @param contextPath + * @param ex + */ public void send (String topic, Bundle wab, String contextPath, Exception ex) { if (_eventAdmin == null) diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/jsp/TldLocatableURLClassloader.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/FakeURLClassLoader.java similarity index 55% rename from jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/jsp/TldLocatableURLClassloader.java rename to jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/FakeURLClassLoader.java index 4b48aef2a36..77f85100e31 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/jsp/TldLocatableURLClassloader.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/FakeURLClassLoader.java @@ -16,29 +16,42 @@ // ======================================================================== // -package org.eclipse.jetty.osgi.boot.internal.jsp; +package org.eclipse.jetty.osgi.boot.utils; import java.net.URL; import java.net.URLClassLoader; /** - * Tricky url classloader. In fact we don't want a real URLClassLoader: we want - * OSGi to provide its classloader and let it does. But to let - * {@link org.apache.jasper.compiler.TldLocationsCache} find the core tlds - * inside the jars we must be a URLClassLoader that returns an array of jars - * where tlds are stored when the method getURLs is called. + * + * FakeURLClassLoader + * + * A URLClassloader that overrides the getURLs() method to return the list + * of urls passed in to the constructor, but otherwise acts as if it has no + * urls, which would cause it to delegate to the parent classloader (in this + * case an OSGi classloader). + * + * The main use of this class is with jars containing tlds. Jasper expects a + * URL classloader to inspect for jars with tlds. + * */ -public class TldLocatableURLClassloader extends URLClassLoader +public class FakeURLClassLoader extends URLClassLoader { - private URL[] _jarsWithTldsInside; - - public TldLocatableURLClassloader(ClassLoader osgiClassLoader, URL[] jarsWithTldsInside) + private URL[] _jars; + + + /* ------------------------------------------------------------ */ + /** + * @param osgiClassLoader + * @param jars + */ + public FakeURLClassLoader(ClassLoader osgiClassLoader, URL[] jars) { super(new URL[] {},osgiClassLoader); - _jarsWithTldsInside = jarsWithTldsInside; + _jars = jars; } + /* ------------------------------------------------------------ */ /** * @return the jars that contains tlds so that TldLocationsCache or * TldScanner can find them. @@ -46,16 +59,21 @@ public class TldLocatableURLClassloader extends URLClassLoader @Override public URL[] getURLs() { - return _jarsWithTldsInside; + return _jars; } + + /* ------------------------------------------------------------ */ + /** + * @see java.lang.Object#toString() + */ public String toString() { StringBuilder builder = new StringBuilder(); - if (_jarsWithTldsInside != null) + if (_jars != null) { - for (URL u:_jarsWithTldsInside) + for (URL u:_jars) builder.append(" "+u.toString()); return builder.toString(); } diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/WebappRegistrationCustomizer.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/TldBundleDiscoverer.java similarity index 69% rename from jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/WebappRegistrationCustomizer.java rename to jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/TldBundleDiscoverer.java index 736fcb254ff..bdd6168f212 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/WebappRegistrationCustomizer.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/TldBundleDiscoverer.java @@ -24,20 +24,12 @@ import org.eclipse.jetty.deploy.DeploymentManager; /** - * WebappRegistrationCustomizer + * TldBundleDiscoverer * * Convert bundles that contain tlds into URL locations for consumption by jasper. */ -public interface WebappRegistrationCustomizer +public interface TldBundleDiscoverer { - /** - * we could do something a lot more pluggable with a custom header in the - * manifest or some customer declarative services let's keep it simple for - * now. hopefully the rest of the world won't need to customize this. - */ - public static final String CLASS_NAME = "org.eclipse.jetty.osgi.boot.jasper.WebappRegistrationCustomizerImpl"; - - /** * Find bundles that contain tlds and convert into URL references to their location. * @@ -46,6 +38,6 @@ public interface WebappRegistrationCustomizer * @return array of URLs representing locations of tld containing bundles * @throws Exception */ - URL[] getJarsWithTlds(DeploymentManager manager, BundleFileLocatorHelper fileLocator) throws Exception; + URL[] getUrlsForBundlesWithTlds(DeploymentManager manager, BundleFileLocatorHelper fileLocator) throws Exception; } diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/internal/PackageAdminServiceTracker.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/internal/PackageAdminServiceTracker.java index c3fd3aa5912..7ce7551aedd 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/internal/PackageAdminServiceTracker.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/internal/PackageAdminServiceTracker.java @@ -39,7 +39,10 @@ import org.osgi.service.startlevel.StartLevel; * * * When the PackageAdmin service is activated we can look for the fragments - * attached to this bundle and "activate" them. + * attached to this bundle and do a fake "activate" on them. + * + * See particularly the jetty-osgi-boot-jsp fragment bundle that uses this + * facility. */ public class PackageAdminServiceTracker implements ServiceListener { From 8a0ba267c16f3f1fc7f90dadb2d6d2898b2f8fa8 Mon Sep 17 00:00:00 2001 From: Jan Bartel Date: Thu, 11 Apr 2013 15:07:50 +1000 Subject: [PATCH 16/30] Rename some jetty-osgi classes, add comments, organize imports. --- .../osgi/boot/AbstractContextProvider.java | 5 ++--- .../osgi/boot/BundleContextProvider.java | 5 ----- .../jetty/osgi/boot/BundleWebAppProvider.java | 1 - .../osgi/boot/JettyBootstrapActivator.java | 20 ++++++++++++------- .../osgi/boot/OSGiWebInfConfiguration.java | 9 ++++----- ...ckerCustomizer.java => BundleWatcher.java} | 8 ++++---- ...erviceTracker.java => ServiceWatcher.java} | 8 ++++---- .../internal/DefaultFileLocatorHelper.java | 2 +- 8 files changed, 28 insertions(+), 30 deletions(-) rename jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/{WebBundleTrackerCustomizer.java => BundleWatcher.java} (97%) rename jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/{JettyContextHandlerServiceTracker.java => ServiceWatcher.java} (96%) diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/AbstractContextProvider.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/AbstractContextProvider.java index afb831361fd..5d801c614eb 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/AbstractContextProvider.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/AbstractContextProvider.java @@ -52,8 +52,7 @@ public abstract class AbstractContextProvider extends AbstractLifeCycle implemen { private static final Logger LOG = Log.getLogger(AbstractContextProvider.class); - private DeploymentManager _deploymentManager; - + private DeploymentManager _deploymentManager; private ServerInstanceWrapper _serverWrapper; @@ -62,7 +61,7 @@ public abstract class AbstractContextProvider extends AbstractLifeCycle implemen /* ------------------------------------------------------------ */ /** - * BundleApp + * OSGiApp * * */ diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleContextProvider.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleContextProvider.java index 6ec082e9038..92dcbd45c28 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleContextProvider.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleContextProvider.java @@ -26,16 +26,11 @@ import java.util.List; import java.util.Map; import org.eclipse.jetty.deploy.App; -import org.eclipse.jetty.deploy.DeploymentManager; import org.eclipse.jetty.osgi.boot.internal.serverfactory.ServerInstanceWrapper; -import org.eclipse.jetty.osgi.boot.utils.EventSender; -import org.eclipse.jetty.server.handler.ContextHandler; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; -import org.eclipse.jetty.webapp.WebAppContext; import org.osgi.framework.Bundle; import org.osgi.framework.FrameworkUtil; -import org.osgi.framework.ServiceReference; import org.osgi.framework.ServiceRegistration; diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleWebAppProvider.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleWebAppProvider.java index 2a5e6e3cd0d..ab38f29ac67 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleWebAppProvider.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/BundleWebAppProvider.java @@ -25,7 +25,6 @@ import java.util.Map; import org.eclipse.jetty.deploy.App; import org.eclipse.jetty.osgi.boot.internal.serverfactory.ServerInstanceWrapper; -import org.eclipse.jetty.osgi.boot.utils.EventSender; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; import org.osgi.framework.Bundle; diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/JettyBootstrapActivator.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/JettyBootstrapActivator.java index 91fb3a388a7..8763ece7b9d 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/JettyBootstrapActivator.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/JettyBootstrapActivator.java @@ -20,8 +20,8 @@ package org.eclipse.jetty.osgi.boot; import org.eclipse.jetty.osgi.boot.internal.serverfactory.DefaultJettyAtJettyHomeHelper; import org.eclipse.jetty.osgi.boot.internal.serverfactory.JettyServerServiceTracker; -import org.eclipse.jetty.osgi.boot.internal.webapp.JettyContextHandlerServiceTracker; -import org.eclipse.jetty.osgi.boot.internal.webapp.WebBundleTrackerCustomizer; +import org.eclipse.jetty.osgi.boot.internal.webapp.BundleWatcher; +import org.eclipse.jetty.osgi.boot.internal.webapp.ServiceWatcher; import org.eclipse.jetty.osgi.boot.utils.internal.PackageAdminServiceTracker; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.handler.ContextHandler; @@ -56,7 +56,7 @@ public class JettyBootstrapActivator implements BundleActivator private ServiceRegistration _registeredServer; - private JettyContextHandlerServiceTracker _jettyContextHandlerTracker; + private ServiceWatcher _jettyContextHandlerTracker; private PackageAdminServiceTracker _packageAdminServiceTracker; @@ -65,7 +65,10 @@ public class JettyBootstrapActivator implements BundleActivator private BundleContext _bundleContext; private JettyServerServiceTracker _jettyServerServiceTracker; - + + + + /* ------------------------------------------------------------ */ /** * Setup a new jetty Server, registers it as a service. Setup the Service * tracker for the jetty ContextHandlers that are in charge of deploying the @@ -88,20 +91,23 @@ public class JettyBootstrapActivator implements BundleActivator context.addServiceListener(_jettyServerServiceTracker, "(objectclass=" + Server.class.getName() + ")"); // track ContextHandler class instances and deploy them to one of the known Servers - _jettyContextHandlerTracker = new JettyContextHandlerServiceTracker(); + _jettyContextHandlerTracker = new ServiceWatcher(); context.addServiceListener(_jettyContextHandlerTracker, "(objectclass=" + ContextHandler.class.getName() + ")"); // Create a default jetty instance right now. Server defaultServer = DefaultJettyAtJettyHomeHelper.startJettyAtJettyHome(context); //Create a bundle tracker to help deploy webapps and ContextHandlers - WebBundleTrackerCustomizer bundleTrackerCustomizer = new WebBundleTrackerCustomizer(); + BundleWatcher bundleTrackerCustomizer = new BundleWatcher(); bundleTrackerCustomizer.setWaitForDefaultServer(defaultServer != null); _webBundleTracker = new BundleTracker(context, Bundle.ACTIVE | Bundle.STOPPING, bundleTrackerCustomizer); bundleTrackerCustomizer.setBundleTracker(_webBundleTracker); bundleTrackerCustomizer.open(); } - + + + + /* ------------------------------------------------------------ */ /** * Stop the activator. * diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiWebInfConfiguration.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiWebInfConfiguration.java index 988ebb244f2..76eb8ade44d 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiWebInfConfiguration.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiWebInfConfiguration.java @@ -52,7 +52,7 @@ public class OSGiWebInfConfiguration extends WebInfConfiguration public static final String CONTAINER_BUNDLE_PATTERN = "org.eclipse.jetty.server.webapp.containerIncludeBundlePattern"; - + /* ------------------------------------------------------------ */ /** * Check to see if there have been any bundle symbolic names added of bundles that should be * regarded as being on the container classpath, and scanned for fragments, tlds etc etc. @@ -120,7 +120,7 @@ public class OSGiWebInfConfiguration extends WebInfConfiguration } - + /* ------------------------------------------------------------ */ /** * Consider the fragment bundles associated with the bundle of the webapp being deployed. * @@ -148,7 +148,7 @@ public class OSGiWebInfConfiguration extends WebInfConfiguration return mergedResources; } - + /* ------------------------------------------------------------ */ /** * Allow fragments to supply some resources that are added to the baseResource of the webapp. * @@ -227,11 +227,10 @@ public class OSGiWebInfConfiguration extends WebInfConfiguration resources[resources.length-1] = context.getBaseResource(); context.setBaseResource(new ResourceCollection(resources)); } - } - + /* ------------------------------------------------------------ */ /** * Resolves the bundle. Usually that would be a single URL per bundle. But we do some more work if there are jars * embedded in the bundle. diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/WebBundleTrackerCustomizer.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/BundleWatcher.java similarity index 97% rename from jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/WebBundleTrackerCustomizer.java rename to jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/BundleWatcher.java index ab0c32b9159..74622c36b12 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/WebBundleTrackerCustomizer.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/BundleWatcher.java @@ -40,7 +40,7 @@ import org.osgi.util.tracker.BundleTrackerCustomizer; import org.osgi.util.tracker.ServiceTracker; /** - * WebBundleTrackerCustomizer + * BundleWatcher * * * Tracks the installation and removal of Bundles in the OSGi environment. Any bundles @@ -49,9 +49,9 @@ import org.osgi.util.tracker.ServiceTracker; * * @author hmalphettes */ -public class WebBundleTrackerCustomizer implements BundleTrackerCustomizer +public class BundleWatcher implements BundleTrackerCustomizer { - private static final Logger LOG = Log.getLogger(WebBundleTrackerCustomizer.class); + private static final Logger LOG = Log.getLogger(BundleWatcher.class); public static Collection JSP_REGISTRATION_HELPERS = new ArrayList(); @@ -69,7 +69,7 @@ public class WebBundleTrackerCustomizer implements BundleTrackerCustomizer /** * @throws Exception */ - public WebBundleTrackerCustomizer() throws Exception + public BundleWatcher() throws Exception { _bundle = FrameworkUtil.getBundle(this.getClass()); //Track all BundleProviders (Jetty DeploymentManager Providers that can deploy bundles) diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/JettyContextHandlerServiceTracker.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/ServiceWatcher.java similarity index 96% rename from jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/JettyContextHandlerServiceTracker.java rename to jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/ServiceWatcher.java index 83dc00d265b..08dbd4a9025 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/JettyContextHandlerServiceTracker.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/ServiceWatcher.java @@ -39,7 +39,7 @@ import org.osgi.framework.ServiceReference; import org.osgi.util.tracker.ServiceTracker; /** - * JettyContextHandlerServiceTracker + * ServiceWatcher * * When a {@link ContextHandler} is activated as an osgi service we find a jetty deployer * for it. The ContextHandler could be either a WebAppContext or any other derivative of @@ -49,9 +49,9 @@ import org.osgi.util.tracker.ServiceTracker; * osgi services. Instead, they can be deployed via manifest headers inside bundles. See * {@link WebBundleTrackerCustomizer}. */ -public class JettyContextHandlerServiceTracker implements ServiceListener +public class ServiceWatcher implements ServiceListener { - private static Logger LOG = Log.getLogger(JettyContextHandlerServiceTracker.class); + private static Logger LOG = Log.getLogger(ServiceWatcher.class); public static final String FILTER = "(objectclass=" + ServiceProvider.class.getName() + ")"; @@ -65,7 +65,7 @@ public class JettyContextHandlerServiceTracker implements ServiceListener /** * @param registry */ - public JettyContextHandlerServiceTracker() throws Exception + public ServiceWatcher() throws Exception { //track all instances of deployers of webapps Bundle myBundle = FrameworkUtil.getBundle(this.getClass()); diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/internal/DefaultFileLocatorHelper.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/internal/DefaultFileLocatorHelper.java index eb23d5924bf..7349cd08bb6 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/internal/DefaultFileLocatorHelper.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/utils/internal/DefaultFileLocatorHelper.java @@ -31,8 +31,8 @@ import java.util.zip.ZipFile; import org.eclipse.jetty.osgi.boot.utils.BundleFileLocatorHelper; import org.eclipse.jetty.util.URIUtil; -import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.util.resource.FileResource; +import org.eclipse.jetty.util.resource.Resource; import org.osgi.framework.Bundle; /** From 7ed3a343ad6084f2e24c056cf98988ffcb0a2daa Mon Sep 17 00:00:00 2001 From: Thomas Becker Date: Thu, 11 Apr 2013 12:28:06 +0200 Subject: [PATCH 17/30] 405449 spdy improve handling of duplicate stream Ids --- .../eclipse/jetty/spdy/StandardSession.java | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardSession.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardSession.java index a0bda51d2ed..30dc870721d 100644 --- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardSession.java +++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardSession.java @@ -244,7 +244,6 @@ public class StandardSession implements ISession, Parser.Listener, Dumpable @Override public PingResultInfo ping(PingInfo pingInfo) throws ExecutionException, InterruptedException, TimeoutException { - //TODO: find a better name for PingResultInfo FuturePromise result = new FuturePromise<>(); ping(pingInfo, result); if (pingInfo.getTimeout() > 0) @@ -548,10 +547,10 @@ public class StandardSession implements ISession, Parser.Listener, Dumpable int maxConcurrentStreams = maxConcurrentLocalStreams; if (maxConcurrentStreams > -1 && oldStreamCountValue >= maxConcurrentStreams) { - String msg = String.format("Max concurrent local streams (%d) exceeded.", + String message = String.format("Max concurrent local streams (%d) exceeded.", maxConcurrentStreams); - LOG.debug(msg); - promise.failed(new SPDYException(msg)); + LOG.debug(message); + promise.failed(new SPDYException(message)); return null; } if (localStreamCount.compareAndSet(oldStreamCountValue, oldStreamCountValue + 1)) @@ -561,22 +560,17 @@ public class StandardSession implements ISession, Parser.Listener, Dumpable if (streams.putIfAbsent(streamId, stream) != null) { - //TODO: fail promise + String message = "Duplicate stream id " + streamId; + IllegalStateException duplicateIdException = new IllegalStateException(message); + promise.failed(duplicateIdException); if (local) { localStreamCount.decrementAndGet(); - throw new IllegalStateException("Duplicate stream id " + streamId); + throw duplicateIdException; } RstInfo rstInfo = new RstInfo(streamId, StreamStatus.PROTOCOL_ERROR); LOG.debug("Duplicate stream, {}", rstInfo); - try - { - rst(rstInfo); //TODO: non blocking reset or find the reason why blocking is used - } - catch (InterruptedException | ExecutionException | TimeoutException e) - { - e.printStackTrace(); // TODO: really catch??? - } + rst(rstInfo, new Callback.Adapter()); // We don't care (too much) if the reset fails. return null; } else From 9885449bdf82397f363035f391389b9b3a7b454d Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Fri, 12 Apr 2013 20:36:57 +1000 Subject: [PATCH 18/30] 364921 improved close of SSL to avoid FINWAITs --- .../eclipse/jetty/io/ssl/SslConnection.java | 41 +++++++++++++++---- .../io/SelectChannelEndPointSslTest.java | 23 +++++++---- 2 files changed, 48 insertions(+), 16 deletions(-) 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 4fca18f3f1b..ab441263cb8 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 @@ -22,6 +22,7 @@ import java.io.IOException; import java.net.SocketException; import java.nio.ByteBuffer; import java.nio.channels.ClosedChannelException; +import java.nio.channels.ReadPendingException; import java.util.Arrays; import java.util.concurrent.Executor; import javax.net.ssl.SSLEngine; @@ -726,6 +727,7 @@ public class SslConnection extends AbstractConnection { _cannotAcceptMoreAppDataToFlush = true; getEndPoint().flush(_encryptedOutput); + getEndPoint().shutdownOutput(); // If we failed to flush the close handshake then we will just pretend that // the write has progressed normally and let a subsequent call to flush // (or WriteFlusher#onIncompleteFlushed) to finish writing the close handshake. @@ -735,6 +737,7 @@ public class SslConnection extends AbstractConnection } // otherwise we have written, and the caller will close the underlying connection + getEndPoint().shutdownOutput(); return allConsumed; case BUFFER_UNDERFLOW: @@ -831,16 +834,40 @@ public class SslConnection extends AbstractConnection @Override public void shutdownOutput() { - _sslEngine.closeOutbound(); - try + if (isInputShutdown()) { - flush(BufferUtil.EMPTY_BUFFER); - } - catch (IOException e) - { - LOG.ignore(e); + // Aggressively close because inbound close handshake already processed + // and most impls are expecting a FIN rather than a reply. When a reply is sent, many impls will do + // a RST. getEndPoint().close(); } + else + { + try + { + _sslEngine.closeOutbound(); + flush(BufferUtil.EMPTY_BUFFER); + fillInterested(new Callback() + { + @Override + public void succeeded() + { + getEndPoint().close(); + } + + @Override + public void failed(Throwable x) + { + getEndPoint().close(); + } + }); + } + catch (Exception e) + { + LOG.ignore(e); + getEndPoint().close(); + } + } } @Override diff --git a/jetty-io/src/test/java/org/eclipse/jetty/io/SelectChannelEndPointSslTest.java b/jetty-io/src/test/java/org/eclipse/jetty/io/SelectChannelEndPointSslTest.java index 77aea8b0081..7bd05967742 100644 --- a/jetty-io/src/test/java/org/eclipse/jetty/io/SelectChannelEndPointSslTest.java +++ b/jetty-io/src/test/java/org/eclipse/jetty/io/SelectChannelEndPointSslTest.java @@ -202,16 +202,21 @@ public class SelectChannelEndPointSslTest extends SelectChannelEndPointTest filled=client.read(sslIn); if (debug) System.err.println("in="+filled); - sslIn.flip(); - try + + if (filled>=0) { - // Since the client closed abruptly, the server is sending a close alert with a failure - engine.unwrap(sslIn, appIn); - Assert.fail(); - } - catch (SSLException x) - { - // Expected + // this is the old behaviour. + sslIn.flip(); + try + { + // Since the client closed abruptly, the server is sending a close alert with a failure + engine.unwrap(sslIn, appIn); + Assert.fail(); + } + catch (SSLException x) + { + // Expected + } } sslIn.clear(); From f57a4a45a67a4b3a4083f433ba46f2ec18547901 Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Fri, 12 Apr 2013 13:50:31 +0200 Subject: [PATCH 19/30] 405551 - InputStreamResponseListener.await returns null when request fails. Moved the success/failure logic to onComplete(), to be notified even if only the request fails. --- .../util/InputStreamResponseListener.java | 33 ++++++++----------- .../jetty/client/HttpClientStreamTest.java | 14 ++++++++ 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/util/InputStreamResponseListener.java b/jetty-client/src/main/java/org/eclipse/jetty/client/util/InputStreamResponseListener.java index 644326aae5c..6ac55e6f65e 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/util/InputStreamResponseListener.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/util/InputStreamResponseListener.java @@ -129,29 +129,24 @@ public class InputStreamResponseListener extends Response.Listener.Empty } } - @Override - public void onFailure(Response response, Throwable failure) - { - LOG.debug("Queuing failure {} {}", FAILURE, failure); - queue.offer(FAILURE); - responseLatch.countDown(); - resultLatch.countDown(); - this.failure = failure; - signal(); - } - - @Override - public void onSuccess(Response response) - { - LOG.debug("Queuing end of content {}{}", EOF, ""); - queue.offer(EOF); - } - @Override public void onComplete(Result result) { this.result = result; + if (result.isSucceeded()) + { + LOG.debug("Queuing end of content {}{}", EOF, ""); + queue.offer(EOF); + } + else + { + LOG.debug("Queuing failure {} {}", FAILURE, failure); + queue.offer(FAILURE); + this.failure = result.getFailure(); + responseLatch.countDown(); + } resultLatch.countDown(); + signal(); } protected boolean await() @@ -176,7 +171,7 @@ public class InputStreamResponseListener extends Response.Listener.Empty { synchronized (this) { - notify(); + notifyAll(); } } diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientStreamTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientStreamTest.java index 218f0e090aa..5a800af8549 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientStreamTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientStreamTest.java @@ -445,6 +445,20 @@ public class HttpClientStreamTest extends AbstractHttpClientServerTest Assert.assertNull(failure.get()); } + @Test + public void testInputStreamResponseListenerFailedBeforeResponse() throws Exception + { + start(new EmptyServerHandler()); + + InputStreamResponseListener listener = new InputStreamResponseListener(); + // Connect to the wrong port + client.newRequest("localhost", 0) + .scheme(scheme) + .send(listener); + Result result = listener.await(5, TimeUnit.SECONDS); + Assert.assertNotNull(result); + } + @Test(expected = ExecutionException.class) public void testInputStreamContentProviderThrowingWhileReading() throws Exception { From de7adaf0d23fae2302a2956fe22df3005ade4e82 Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Fri, 12 Apr 2013 13:58:31 +0200 Subject: [PATCH 20/30] Reverted usages of ConcurrentArrayBlockingQueue until proven it's correctly implemented. --- jetty-server/src/main/config/etc/jetty.xml | 5 ----- .../eclipse/jetty/server/AsyncNCSARequestLog.java | 12 ++++++------ .../eclipse/jetty/util/thread/QueuedThreadPool.java | 5 ++--- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/jetty-server/src/main/config/etc/jetty.xml b/jetty-server/src/main/config/etc/jetty.xml index 2d9b8596e47..668980e13b5 100644 --- a/jetty-server/src/main/config/etc/jetty.xml +++ b/jetty-server/src/main/config/etc/jetty.xml @@ -47,11 +47,6 @@ 10 200 60000 - false diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/AsyncNCSARequestLog.java b/jetty-server/src/main/java/org/eclipse/jetty/server/AsyncNCSARequestLog.java index 300d23cc75c..9c5d4610b2d 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/AsyncNCSARequestLog.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/AsyncNCSARequestLog.java @@ -22,7 +22,7 @@ import java.io.IOException; import java.util.concurrent.BlockingQueue; import java.util.concurrent.TimeUnit; -import org.eclipse.jetty.util.ConcurrentArrayBlockingQueue; +import org.eclipse.jetty.util.BlockingArrayQueue; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; @@ -42,7 +42,7 @@ public class AsyncNCSARequestLog extends NCSARequestLog { this(null,null); } - + public AsyncNCSARequestLog(BlockingQueue queue) { this(null,queue); @@ -52,12 +52,12 @@ public class AsyncNCSARequestLog extends NCSARequestLog { this(filename,null); } - + public AsyncNCSARequestLog(String filename,BlockingQueue queue) { super(filename); if (queue==null) - queue=new ConcurrentArrayBlockingQueue.Unbounded(); + queue=new BlockingArrayQueue<>(1024); _queue=queue; } @@ -67,7 +67,7 @@ public class AsyncNCSARequestLog extends NCSARequestLog { setName("AsyncNCSARequestLog@"+Integer.toString(AsyncNCSARequestLog.this.hashCode(),16)); } - + @Override public void run() { @@ -78,7 +78,7 @@ public class AsyncNCSARequestLog extends NCSARequestLog String log = _queue.poll(10,TimeUnit.SECONDS); if (log!=null) AsyncNCSARequestLog.super.write(log); - + while(!_queue.isEmpty()) { log=_queue.poll(); diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/QueuedThreadPool.java b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/QueuedThreadPool.java index 4ffc8022b85..6aa32877ea9 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/QueuedThreadPool.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/QueuedThreadPool.java @@ -31,7 +31,6 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; import org.eclipse.jetty.util.BlockingArrayQueue; -import org.eclipse.jetty.util.ConcurrentArrayBlockingQueue; import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; @@ -90,9 +89,9 @@ public class QueuedThreadPool extends AbstractLifeCycle implements SizedThreadPo setMaxThreads(maxThreads); setIdleTimeout(idleTimeout); setStopTimeout(5000); - + if (queue==null) - queue=new ConcurrentArrayBlockingQueue.Unbounded(); + queue=new BlockingArrayQueue<>(_minThreads, _minThreads); _jobs=queue; } From 9fd155d36e7666538d71fc6178feced3b2baed2b Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Fri, 12 Apr 2013 14:07:58 +0200 Subject: [PATCH 21/30] Marked the test with @Stress. --- .../java/org/eclipse/jetty/util/QueueBenchmarkTest.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/QueueBenchmarkTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/QueueBenchmarkTest.java index 8990102bca4..750c288f61b 100644 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/QueueBenchmarkTest.java +++ b/jetty-util/src/test/java/org/eclipse/jetty/util/QueueBenchmarkTest.java @@ -29,15 +29,13 @@ import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.TimeUnit; import org.eclipse.jetty.toolchain.test.AdvancedRunner; -import org.eclipse.jetty.toolchain.test.annotation.Slow; +import org.eclipse.jetty.toolchain.test.annotation.Stress; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; import org.junit.Assume; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; -@Ignore @RunWith(AdvancedRunner.class) public class QueueBenchmarkTest { @@ -57,7 +55,7 @@ public class QueueBenchmarkTest } }; - @Slow + @Stress("High CPU") @Test public void testQueues() throws Exception { @@ -77,7 +75,7 @@ public class QueueBenchmarkTest testQueues(readers, writers, iterations, queues, false); } - @Slow + @Stress("High CPU") @Test public void testBlockingQueues() throws Exception { From 70e6655ec5a5b45839fcd6b6bbe7be7427f5e8ef Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Fri, 12 Apr 2013 23:17:24 +0200 Subject: [PATCH 22/30] 364921 - FIN WAIT sockets. Interim commit, as things are not working exactly right yet. --- .../jetty/client/ssl/SslBytesClientTest.java | 5 - .../jetty/client/ssl/SslBytesServerTest.java | 197 +++++------------- .../jetty/client/ssl/SslBytesTest.java | 8 +- .../eclipse/jetty/io/ssl/SslConnection.java | 52 ++--- 4 files changed, 81 insertions(+), 181 deletions(-) diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/ssl/SslBytesClientTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/ssl/SslBytesClientTest.java index 67c99310cc8..c7a685c5749 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/ssl/SslBytesClientTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/ssl/SslBytesClientTest.java @@ -356,13 +356,8 @@ public class SslBytesClientTest extends SslBytesTest Assert.assertEquals(TLSRecord.Type.HANDSHAKE, record.getType()); proxy.flushToClient(record); - record = proxy.readFromClient(); - Assert.assertEquals(TLSRecord.Type.ALERT, record.getType()); - proxy.flushToServer(record); - record = proxy.readFromClient(); Assert.assertNull(record); - proxy.flushToServer(record); server.close(); } diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/ssl/SslBytesServerTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/ssl/SslBytesServerTest.java index 1faca02d882..e0130ddb196 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/ssl/SslBytesServerTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/ssl/SslBytesServerTest.java @@ -72,7 +72,6 @@ import org.junit.After; import org.junit.Assert; import org.junit.Assume; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; public class SslBytesServerTest extends SslBytesTest @@ -87,6 +86,7 @@ public class SslBytesServerTest extends SslBytesTest private SslContextFactory sslContextFactory; private SSLContext sslContext; private SimpleProxy proxy; + private Runnable idleHook; @Before public void init() throws Exception @@ -119,6 +119,15 @@ public class SslBytesServerTest extends SslBytesTest } }; } + + @Override + protected boolean onReadTimeout() + { + final Runnable idleHook = SslBytesServerTest.this.idleHook; + if (idleHook != null) + idleHook.run(); + return super.onReadTimeout(); + } }, connector, endPoint); } }; @@ -165,7 +174,6 @@ public class SslBytesServerTest extends SslBytesTest } }; connector.setIdleTimeout(idleTimeout); -// connector.setPort(5870); connector.setPort(0); server.addConnector(connector); @@ -209,7 +217,7 @@ public class SslBytesServerTest extends SslBytesTest proxy = new SimpleProxy(threadPool, "localhost", serverPort); proxy.start(); - logger.debug(":{} <==> :{}", proxy.getPort(), serverPort); + logger.info("proxy:{} <==> server:{}", proxy.getPort(), serverPort); } @After @@ -377,13 +385,9 @@ public class SslBytesServerTest extends SslBytesTest Assert.assertNull(String.valueOf(record), record); proxy.flushToServer(record); - // Close Alert - record = proxy.readFromServer(); - proxy.flushToClient(record); // Socket close record = proxy.readFromServer(); Assert.assertNull(String.valueOf(record), record); - proxy.flushToClient(record); } @Test @@ -669,13 +673,9 @@ public class SslBytesServerTest extends SslBytesTest Assert.assertNull(String.valueOf(record), record); proxy.flushToServer(record); - // Close Alert - record = proxy.readFromServer(); - proxy.flushToClient(record); // Socket close record = proxy.readFromServer(); Assert.assertNull(String.valueOf(record), record); - proxy.flushToClient(record); } @Test @@ -728,22 +728,15 @@ public class SslBytesServerTest extends SslBytesTest Assert.assertEquals(TLSRecord.Type.APPLICATION, record.getType()); proxy.flushToClient(record); - // Close Alert + // Socket close record = proxy.readFromServer(); - Assert.assertNotNull(record); - Assert.assertEquals(TLSRecord.Type.ALERT, record.getType()); - // We can't forward to the client, its socket is already closed + Assert.assertNull(record); // Check that we did not spin TimeUnit.MILLISECONDS.sleep(500); Assert.assertThat(sslFills.get(), Matchers.lessThan(20)); Assert.assertThat(sslFlushes.get(), Matchers.lessThan(20)); Assert.assertThat(httpParses.get(), Matchers.lessThan(20)); - - // Socket close - record = proxy.readFromServer(); - Assert.assertNull(String.valueOf(record), record); - proxy.flushToClient(record); } @Test @@ -803,11 +796,9 @@ public class SslBytesServerTest extends SslBytesTest Assert.assertEquals(TLSRecord.Type.APPLICATION, record.getType()); proxy.flushToClient(record); - // Close Alert + // Socket close record = proxy.readFromServer(); - Assert.assertNotNull(record); - Assert.assertEquals(TLSRecord.Type.ALERT, record.getType()); - // We can't forward to the client, its socket is already closed + Assert.assertNull(String.valueOf(record), record); // Check that we did not spin TimeUnit.MILLISECONDS.sleep(500); @@ -819,11 +810,6 @@ public class SslBytesServerTest extends SslBytesTest record = proxy.readFromClient(); Assert.assertNull(String.valueOf(record), record); proxy.flushToServer(record); - - // Socket close - record = proxy.readFromServer(); - Assert.assertNull(String.valueOf(record), record); - proxy.flushToClient(record); } @Test @@ -864,12 +850,9 @@ public class SslBytesServerTest extends SslBytesTest // Close the raw socket, this generates a truncation attack proxy.flushToServer(null); - // Expect alert + raw close from server - record = proxy.readFromServer(); - Assert.assertEquals(TLSRecord.Type.ALERT, record.getType()); + // Expect raw close from server record = proxy.readFromServer(); Assert.assertNull(String.valueOf(record), record); - proxy.flushToClient(record); // Check that we did not spin TimeUnit.MILLISECONDS.sleep(500); @@ -917,12 +900,9 @@ public class SslBytesServerTest extends SslBytesTest Assert.assertEquals(TLSRecord.Type.APPLICATION, record.getType()); proxy.flushToClient(record); - // Expect alert + raw close from server - record = proxy.readFromServer(); - Assert.assertEquals(TLSRecord.Type.ALERT, record.getType()); + // Expect raw close from server record = proxy.readFromServer(); Assert.assertNull(String.valueOf(record), record); - proxy.flushToClient(record); // Check that we did not spin TimeUnit.MILLISECONDS.sleep(500); @@ -1099,6 +1079,7 @@ public class SslBytesServerTest extends SslBytesTest System.arraycopy(closeBytes, 0, bytes, dataBytes.length, closeBytes.length / 2); proxy.flushToServer(100, bytes); + // Send the other half of the close alert bytes bytes = new byte[closeBytes.length - closeBytes.length / 2]; System.arraycopy(closeBytes, closeBytes.length / 2, bytes, 0, bytes.length); proxy.flushToServer(100, bytes); @@ -1113,27 +1094,15 @@ public class SslBytesServerTest extends SslBytesTest Assert.assertEquals(TLSRecord.Type.APPLICATION, record.getType()); proxy.flushToClient(record); - // Close Alert + // Socket close record = proxy.readFromServer(); - Assert.assertNotNull(record); - Assert.assertEquals(TLSRecord.Type.ALERT, record.getType()); - // We can't forward to the client, its socket is already closed + Assert.assertNull(record); // Check that we did not spin TimeUnit.MILLISECONDS.sleep(500); Assert.assertThat(sslFills.get(), Matchers.lessThan(20)); Assert.assertThat(sslFlushes.get(), Matchers.lessThan(20)); Assert.assertThat(httpParses.get(), Matchers.lessThan(20)); - - // Socket close - record = proxy.readFromClient(); - Assert.assertNull(String.valueOf(record), record); - proxy.flushToServer(record); - - // Socket close - record = proxy.readFromServer(); - Assert.assertNull(String.valueOf(record), record); - proxy.flushToClient(record); } @Test @@ -1749,13 +1718,37 @@ public class SslBytesServerTest extends SslBytesTest client.close(); } - @Ignore @Test public void testRequestConcurrentWithIdleExpiration() throws Exception { final SSLSocket client = newClient(); + final OutputStream clientOutput = client.getOutputStream(); final CountDownLatch latch = new CountDownLatch(1); + idleHook = new Runnable() + { + public void run() + { + if (latch.getCount()==0) + return; + try + { + // Send request + clientOutput.write(("" + + "GET / HTTP/1.1\r\n" + + "Host: localhost\r\n" + + "\r\n").getBytes("UTF-8")); + clientOutput.flush(); + latch.countDown(); + } + catch (Exception x) + { + // Latch won't trigger and test will fail + x.printStackTrace(); + } + } + }; + SimpleProxy.AutomaticFlow automaticProxyFlow = proxy.startAutomaticFlow(); client.startHandshake(); Assert.assertTrue(automaticProxyFlow.stop(5, TimeUnit.SECONDS)); @@ -1779,86 +1772,13 @@ public class SslBytesServerTest extends SslBytesTest Assert.assertThat(sslFlushes.get(), Matchers.lessThan(20)); Assert.assertThat(httpParses.get(), Matchers.lessThan(50)); - completeClose(client); + record = proxy.readFromServer(); + Assert.assertNull(record); TimeUnit.MILLISECONDS.sleep(200); - //System.err.println(((Dumpable)server.getConnectors()[0]).dump()); Assert.assertThat(((Dumpable)server.getConnectors()[0]).dump(), Matchers.not(Matchers.containsString("SCEP@"))); - } - /* - @Test - public void testRequestWriteBlockedWithPipelinedRequest() throws Exception - { - final SSLSocket client = newClient(); - final OutputStream clientOutput = client.getOutputStream(); - - SimpleProxy.AutomaticFlow automaticProxyFlow = proxy.startAutomaticFlow(); - client.startHandshake(); - Assert.assertTrue(automaticProxyFlow.stop(5, TimeUnit.SECONDS)); - - byte[] data = new byte[128 * 1024]; - Arrays.fill(data, (byte)'X'); - final String content = new String(data, "UTF-8"); - Future request = threadPool.submit(new Callable() - { - public Object call() throws Exception - { - clientOutput.write(("" + - "POST /echo HTTP/1.1\r\n" + - "Host: localhost\r\n" + - "Content-Length: " + content.length() + "\r\n" + - "\r\n" + - content).getBytes("UTF-8")); - clientOutput.flush(); - return null; - } - }); - - // Nine TLSRecords will be generated for the request - for (int i = 0; i < 9; ++i) - { - // Application data - TLSRecord record = proxy.readFromClient(); - Assert.assertEquals(TLSRecord.Type.APPLICATION, record.getType()); - proxy.flushToServer(record, 0); - } - Assert.assertNull(request.get(5, TimeUnit.SECONDS)); - - // We do not read the big request to cause a write blocked on the server - TimeUnit.MILLISECONDS.sleep(500); - - // Now send the pipelined request - Future pipelined = threadPool.submit(new Callable() - { - public Object call() throws Exception - { - clientOutput.write(("" + - "GET /pipelined HTTP/1.1\r\n" + - "Host: localhost\r\n" + - "\r\n").getBytes("UTF-8")); - clientOutput.flush(); - return null; - } - }); - - TLSRecord record = proxy.readFromClient(); - Assert.assertEquals(TLSRecord.Type.APPLICATION, record.getType()); - proxy.flushToServer(record, 0); - Assert.assertNull(pipelined.get(5, TimeUnit.SECONDS)); - - // Check that we did not spin - TimeUnit.MILLISECONDS.sleep(500); - Assert.assertThat(sslFills.get(), lessThan(20)); - Assert.assertThat(sslFlushes.get(), lessThan(20)); - Assert.assertThat(httpParses.get(), lessThan(50)); - - Thread.sleep(5000); - - // closeClient(client); - } - */ private void assumeJavaVersionSupportsTLSRenegotiations() { // Due to a security bug, TLS renegotiations were disabled in JDK 1.6.0_19-21 @@ -1893,31 +1813,8 @@ public class SslBytesServerTest extends SslBytesTest Assert.assertNull(String.valueOf(record), record); proxy.flushToServer(record); - // Close Alert - record = proxy.readFromServer(); - proxy.flushToClient(record); - // Socket close record = proxy.readFromServer(); Assert.assertNull(String.valueOf(record), record); - proxy.flushToClient(record); - } - - private void completeClose(SSLSocket client) throws Exception - { - client.close(); - - // Close Alert - TLSRecord record = proxy.readFromClient(); - proxy.flushToServer(record); - // Socket close - record = proxy.readFromClient(); - Assert.assertNull(String.valueOf(record), record); - proxy.flushToServer(record); - - // Close Alert - record = proxy.readFromServer(); - proxy.flushToClient(record); - } } diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/ssl/SslBytesTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/ssl/SslBytesTest.java index c7fe7447ddc..b0f576995e7 100644 --- a/jetty-client/src/test/java/org/eclipse/jetty/client/ssl/SslBytesTest.java +++ b/jetty-client/src/test/java/org/eclipse/jetty/client/ssl/SslBytesTest.java @@ -34,12 +34,17 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; +import org.eclipse.jetty.toolchain.test.TestTracker; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; import org.junit.Assert; +import org.junit.Rule; public abstract class SslBytesTest { + @Rule + public TestTracker tracker = new TestTracker(); + protected final Logger logger = Log.getLogger(getClass()); public static class TLSRecord @@ -115,8 +120,7 @@ public abstract class SslBytesTest public void start() throws Exception { - serverSocket = new ServerSocket(47009); -// serverSocket = new ServerSocket(0); + serverSocket = new ServerSocket(0); Thread acceptor = new Thread(this); acceptor.start(); server = new Socket(serverHost, serverPort); 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 ab441263cb8..3af882389d2 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 @@ -22,7 +22,6 @@ import java.io.IOException; import java.net.SocketException; import java.nio.ByteBuffer; import java.nio.channels.ClosedChannelException; -import java.nio.channels.ReadPendingException; import java.util.Arrays; import java.util.concurrent.Executor; import javax.net.ssl.SSLEngine; @@ -426,7 +425,7 @@ public class SslConnection extends AbstractConnection return true; } } - else + else if (!isOutputShutdown()) { // Normal readable callback // Get called back on onfillable when then is more data to fill @@ -613,8 +612,21 @@ public class SslConnection extends AbstractConnection // maybe we will fill some more on a retry continue; } - // we need to wait for more net data - return 0; + else + { + if (isOutputShutdown()) + { + // We have sent the SSL Close Alert, and we read 0 bytes: + // it's a peer that it is not sending the FIN, so we just + // return -1 as if we did, so the connection will be closed. + return -1; + } + else + { + // we need to wait for more net data + return 0; + } + } case FINISHED: throw new IllegalStateException(); @@ -735,9 +747,11 @@ public class SslConnection extends AbstractConnection if (BufferUtil.hasContent(_encryptedOutput)) return false; } - // otherwise we have written, and the caller will close the underlying connection - getEndPoint().shutdownOutput(); + else + { + getEndPoint().shutdownOutput(); + } return allConsumed; case BUFFER_UNDERFLOW: @@ -834,11 +848,15 @@ public class SslConnection extends AbstractConnection @Override public void shutdownOutput() { - if (isInputShutdown()) + boolean ishut = isInputShutdown(); + if (DEBUG) + LOG.debug("{} shutdownOutput: oshut={}, ishut={}", SslConnection.this, isOutputShutdown(), ishut); + if (ishut) { - // Aggressively close because inbound close handshake already processed - // and most impls are expecting a FIN rather than a reply. When a reply is sent, many impls will do - // a RST. + // Aggressively close, since inbound close alert has already been processed + // and the TLS specification allows to close the connection directly, which + // is what most other implementations expect: a FIN rather than a TLS close + // reply. If a TLS close reply is sent, most implementation send a RST. getEndPoint().close(); } else @@ -847,20 +865,6 @@ public class SslConnection extends AbstractConnection { _sslEngine.closeOutbound(); flush(BufferUtil.EMPTY_BUFFER); - fillInterested(new Callback() - { - @Override - public void succeeded() - { - getEndPoint().close(); - } - - @Override - public void failed(Throwable x) - { - getEndPoint().close(); - } - }); } catch (Exception e) { From 9a26992c8aa2e8a39822cd5590617484d1508c6f Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Mon, 15 Apr 2013 11:06:06 +1000 Subject: [PATCH 23/30] 402885 reuse Deflaters in GzipFilter --- .../eclipse/jetty/servlets/GzipFilter.java | 124 +++++++++--------- .../jetty/servlets/gzip/GzipHandler.java | 32 +++-- .../jetty/servlets/gzip/GzipOutputStream.java | 70 ++++++++++ .../jetty/servlets/PipelineHelper.java | 4 +- 4 files changed, 156 insertions(+), 74 deletions(-) create mode 100644 jetty-servlets/src/main/java/org/eclipse/jetty/servlets/gzip/GzipOutputStream.java diff --git a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/GzipFilter.java b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/GzipFilter.java index bd5a21b9118..03752cb7f10 100644 --- a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/GzipFilter.java +++ b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/GzipFilter.java @@ -26,26 +26,22 @@ import java.util.StringTokenizer; import java.util.regex.Pattern; import java.util.zip.Deflater; import java.util.zip.DeflaterOutputStream; -import java.util.zip.GZIPOutputStream; +import javax.servlet.AsyncEvent; +import javax.servlet.AsyncListener; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletContext; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; -import javax.servlet.ServletResponseWrapper; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpServletResponseWrapper; -import org.eclipse.jetty.continuation.Continuation; -import org.eclipse.jetty.continuation.ContinuationListener; -import org.eclipse.jetty.continuation.ContinuationSupport; import org.eclipse.jetty.http.HttpMethod; import org.eclipse.jetty.servlets.gzip.AbstractCompressedStream; import org.eclipse.jetty.servlets.gzip.CompressedResponseWrapper; -import org.eclipse.jetty.util.StringUtil; +import org.eclipse.jetty.servlets.gzip.GzipOutputStream; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; @@ -129,6 +125,9 @@ public class GzipFilter extends UserAgentFilter protected int _minGzipSize=256; protected int _deflateCompressionLevel=Deflater.DEFAULT_COMPRESSION; protected boolean _deflateNoWrap = true; + + // non-static, as other GzipFilter instances may have different configurations + protected final ThreadLocal _deflater = new ThreadLocal(); protected final Set _methods=new HashSet(); protected Set _excludedAgents; @@ -296,10 +295,10 @@ public class GzipFilter extends UserAgentFilter } finally { - Continuation continuation = ContinuationSupport.getContinuation(request); - if (continuation.isSuspended() && continuation.isResponseWrapped()) + if (request.isAsyncStarted()) { - continuation.addContinuationListener(new ContinuationListenerWaitingForWrappedResponseToFinish(wrappedResponse)); + + request.getAsyncContext().addListener(new FinishOnCompleteListener(wrappedResponse)); } else if (exceptional && !response.isCommitted()) { @@ -403,64 +402,55 @@ public class GzipFilter extends UserAgentFilter protected CompressedResponseWrapper createWrappedResponse(HttpServletRequest request, HttpServletResponse response, final String compressionType) { CompressedResponseWrapper wrappedResponse = null; - if (compressionType==null) + wrappedResponse = new CompressedResponseWrapper(request,response) { - wrappedResponse = new CompressedResponseWrapper(request,response) + @Override + protected AbstractCompressedStream newCompressedStream(HttpServletRequest request, HttpServletResponse response) throws IOException { - @Override - protected AbstractCompressedStream newCompressedStream(HttpServletRequest request,HttpServletResponse response) throws IOException + return new AbstractCompressedStream(compressionType,request,this,_vary) { - return new AbstractCompressedStream(null,request,this,_vary) + private Deflater _allocatedDeflater; + + @Override + protected DeflaterOutputStream createStream() throws IOException { - @Override - protected DeflaterOutputStream createStream() throws IOException + if (compressionType == null) { return null; } - }; - } - }; - } - else if (compressionType.equals(GZIP)) - { - wrappedResponse = new CompressedResponseWrapper(request,response) - { - @Override - protected AbstractCompressedStream newCompressedStream(HttpServletRequest request,HttpServletResponse response) throws IOException - { - return new AbstractCompressedStream(compressionType,request,this,_vary) - { - @Override - protected DeflaterOutputStream createStream() throws IOException + + // acquire deflater instance + _allocatedDeflater = _deflater.get(); + if (_allocatedDeflater==null) + _allocatedDeflater = new Deflater(_deflateCompressionLevel,_deflateNoWrap); + else { - return new GZIPOutputStream(_response.getOutputStream(),_bufferSize); + _deflater.remove(); + _allocatedDeflater.reset(); } - }; - } - }; - } - else if (compressionType.equals(DEFLATE)) - { - wrappedResponse = new CompressedResponseWrapper(request,response) - { - @Override - protected AbstractCompressedStream newCompressedStream(HttpServletRequest request,HttpServletResponse response) throws IOException - { - return new AbstractCompressedStream(compressionType,request,this,_vary) - { - @Override - protected DeflaterOutputStream createStream() throws IOException + + switch (compressionType) { - return new DeflaterOutputStream(_response.getOutputStream(),new Deflater(_deflateCompressionLevel,_deflateNoWrap)); + case GZIP: + return new GzipOutputStream(_response.getOutputStream(),_allocatedDeflater,_bufferSize); + case DEFLATE: + return new DeflaterOutputStream(_response.getOutputStream(),_allocatedDeflater,_bufferSize); } - }; - } - }; - } - else - { - throw new IllegalStateException(compressionType + " not supported"); - } + throw new IllegalStateException(compressionType + " not supported"); + } + + @Override + public void finish() throws IOException + { + super.finish(); + if (_allocatedDeflater != null && _deflater.get() == null) + { + _deflater.set(_allocatedDeflater); + } + } + }; + } + }; configureWrappedResponse(wrappedResponse); return wrappedResponse; } @@ -472,18 +462,18 @@ public class GzipFilter extends UserAgentFilter wrappedResponse.setMinCompressSize(_minGzipSize); } - private class ContinuationListenerWaitingForWrappedResponseToFinish implements ContinuationListener + private class FinishOnCompleteListener implements AsyncListener { private CompressedResponseWrapper wrappedResponse; - public ContinuationListenerWaitingForWrappedResponseToFinish(CompressedResponseWrapper wrappedResponse) + public FinishOnCompleteListener(CompressedResponseWrapper wrappedResponse) { this.wrappedResponse = wrappedResponse; } @Override - public void onComplete(Continuation continuation) - { + public void onComplete(AsyncEvent event) throws IOException + { try { wrappedResponse.finish(); @@ -495,7 +485,17 @@ public class GzipFilter extends UserAgentFilter } @Override - public void onTimeout(Continuation continuation) + public void onTimeout(AsyncEvent event) throws IOException + { + } + + @Override + public void onError(AsyncEvent event) throws IOException + { + } + + @Override + public void onStartAsync(AsyncEvent event) throws IOException { } } diff --git a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/gzip/GzipHandler.java b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/gzip/GzipHandler.java index 3ea1c2af694..ec125b94295 100644 --- a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/gzip/GzipHandler.java +++ b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/gzip/GzipHandler.java @@ -29,13 +29,12 @@ import java.util.StringTokenizer; import java.util.zip.DeflaterOutputStream; import java.util.zip.GZIPOutputStream; +import javax.servlet.AsyncEvent; +import javax.servlet.AsyncListener; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.eclipse.jetty.continuation.Continuation; -import org.eclipse.jetty.continuation.ContinuationListener; -import org.eclipse.jetty.continuation.ContinuationSupport; import org.eclipse.jetty.http.HttpMethod; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.handler.HandlerWrapper; @@ -265,12 +264,28 @@ public class GzipHandler extends HandlerWrapper } finally { - Continuation continuation = ContinuationSupport.getContinuation(request); - if (continuation.isSuspended() && continuation.isResponseWrapped()) + if (request.isAsyncStarted()) { - continuation.addContinuationListener(new ContinuationListener() + request.getAsyncContext().addListener(new AsyncListener() { - public void onComplete(Continuation continuation) + + @Override + public void onTimeout(AsyncEvent event) throws IOException + { + } + + @Override + public void onStartAsync(AsyncEvent event) throws IOException + { + } + + @Override + public void onError(AsyncEvent event) throws IOException + { + } + + @Override + public void onComplete(AsyncEvent event) throws IOException { try { @@ -281,9 +296,6 @@ public class GzipHandler extends HandlerWrapper LOG.warn(e); } } - - public void onTimeout(Continuation continuation) - {} }); } else if (exceptional && !response.isCommitted()) diff --git a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/gzip/GzipOutputStream.java b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/gzip/GzipOutputStream.java new file mode 100644 index 00000000000..d19bb008b1a --- /dev/null +++ b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/gzip/GzipOutputStream.java @@ -0,0 +1,70 @@ +// +// ======================================================================== +// Copyright (c) 1995-2013 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 +// +// The Apache License v2.0 is available at +// http://www.opensource.org/licenses/apache2.0.php +// +// You may elect to redistribute this code under either of these licenses. +// ======================================================================== +// +package org.eclipse.jetty.servlets.gzip; + +import java.io.IOException; +import java.io.OutputStream; +import java.util.zip.CRC32; +import java.util.zip.Deflater; +import java.util.zip.DeflaterOutputStream; + +/** + * Reimplementation of {@link java.util.zip.GZIPOutputStream} that supports reusing a {@link Deflater} instance. + */ +public class GzipOutputStream extends DeflaterOutputStream +{ + + private final static byte[] GZIP_HEADER = new byte[] + { (byte)0x1f, (byte)0x8b, Deflater.DEFLATED, 0, 0, 0, 0, 0, 0, 0 }; + + private final CRC32 _crc = new CRC32(); + + public GzipOutputStream(OutputStream out, Deflater deflater, int size) throws IOException + { + super(out,deflater,size); + out.write(GZIP_HEADER); + } + + public synchronized void write(byte[] buf, int off, int len) throws IOException + { + super.write(buf,off,len); + _crc.update(buf,off,len); + } + + public void finish() throws IOException + { + if (!def.finished()) + { + super.finish(); + byte[] trailer = new byte[8]; + writeInt((int)_crc.getValue(),trailer,0); + writeInt(def.getTotalIn(),trailer,4); + out.write(trailer); + } + } + + private void writeInt(int i, byte[] buf, int offset) + { + int o = offset; + buf[o++] = (byte)(i & 0xFF); + buf[o++] = (byte)((i >>> 8) & 0xFF); + buf[o++] = (byte)((i >>> 16) & 0xFF); + buf[o++] = (byte)((i >>> 24) & 0xFF); + } + +} diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/PipelineHelper.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/PipelineHelper.java index 8e2fea7b560..95f0a23412a 100644 --- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/PipelineHelper.java +++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/PipelineHelper.java @@ -219,8 +219,8 @@ public class PipelineHelper int val = inputStream.read(); try { - if (left % 10 == 0) - Thread.sleep(1); + if (left % 1000 == 0) + Thread.sleep(10); } catch (InterruptedException e) { From 333f23bebd4d96a5608f736fda9999d7e06a54d4 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Mon, 15 Apr 2013 11:22:23 +1000 Subject: [PATCH 24/30] added magic empty line --- .../java/org/eclipse/jetty/servlets/gzip/GzipOutputStream.java | 1 + 1 file changed, 1 insertion(+) diff --git a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/gzip/GzipOutputStream.java b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/gzip/GzipOutputStream.java index d19bb008b1a..8f20c2f046e 100644 --- a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/gzip/GzipOutputStream.java +++ b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/gzip/GzipOutputStream.java @@ -15,6 +15,7 @@ // You may elect to redistribute this code under either of these licenses. // ======================================================================== // + package org.eclipse.jetty.servlets.gzip; import java.io.IOException; From 2e5dd6b4425294bc192ab362e6e6e94a4b0efde9 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Mon, 15 Apr 2013 11:59:48 +1000 Subject: [PATCH 25/30] 405679 example other server for documentation --- .../src/main/resources/jetty-otherserver.xml | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 examples/embedded/src/main/resources/jetty-otherserver.xml diff --git a/examples/embedded/src/main/resources/jetty-otherserver.xml b/examples/embedded/src/main/resources/jetty-otherserver.xml new file mode 100644 index 00000000000..04e3358bbb3 --- /dev/null +++ b/examples/embedded/src/main/resources/jetty-otherserver.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + 8888 + + + + + + + + + + + + + + + /other-webapps + /etc/webdefault.xml + + + + + + + + + + From 4e3c7367af210acbc1231ad7c0d50cfffca2b111 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Mon, 15 Apr 2013 12:29:08 +1000 Subject: [PATCH 26/30] virtual host example --- .../org/eclipse/jetty/server/handler/ContextHandler.java | 3 ++- .../test-jetty-webapp/src/main/config/webapps/test.xml | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java index 3d5fad459cb..48fa63858c3 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java @@ -303,7 +303,8 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu * * @param virtualHosts * Array of virtual hosts that this context responds to. A null host name or null/empty array means any hostname is acceptable. Host names may be - * String representation of IP addresses. Host names may start with '*.' to wildcard one level of names. + * String representation of IP addresses. Host names may start with '*.' to wildcard one level of names. Host names may start with '@', in which case they + * will match the {@link Connector#getName()} for the request. */ public void addVirtualHosts(String[] virtualHosts) { diff --git a/tests/test-webapps/test-jetty-webapp/src/main/config/webapps/test.xml b/tests/test-webapps/test-jetty-webapp/src/main/config/webapps/test.xml index 1bef8abc9dd..ff7eb6b8056 100644 --- a/tests/test-webapps/test-jetty-webapp/src/main/config/webapps/test.xml +++ b/tests/test-webapps/test-jetty-webapp/src/main/config/webapps/test.xml @@ -45,7 +45,10 @@ detected. 0;) + callContextDestroyed(_contextListeners.get(i),event); } if (_errorHandler != null) @@ -1094,20 +1094,15 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu if (!_requestListeners.isEmpty()) { final ServletRequestEvent sre = new ServletRequestEvent(_scontext,request); - ListIterator iter = _requestListeners.listIterator(_requestListeners.size()); - while (iter.hasNext()) - iter.next(); - while (iter.hasPrevious()) - iter.previous().requestDestroyed(sre); + for (int i=_requestListeners.size();i-->0;) + _requestListeners.get(i).requestDestroyed(sre); } if (!_requestAttributeListeners.isEmpty()) { ListIterator iter = _requestAttributeListeners.listIterator(_requestAttributeListeners.size()); - while(iter.hasNext()) - iter.next(); - while(iter.hasPrevious()) - baseRequest.removeEventListener(iter.previous()); + for (int i=_requestAttributeListeners.size();i-->0;) + baseRequest.removeEventListener(_requestAttributeListeners.get(i)); } } } From 668290b77e16335b356fd1def048e6023c3e08cc Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Mon, 15 Apr 2013 16:31:38 +1000 Subject: [PATCH 28/30] made QoS test more travis CI friendly --- .../eclipse/jetty/servlets/QoSFilterTest.java | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/QoSFilterTest.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/QoSFilterTest.java index f9296ceae30..61ff30ab6a0 100644 --- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/QoSFilterTest.java +++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/QoSFilterTest.java @@ -18,7 +18,6 @@ package org.eclipse.jetty.servlets; -import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import java.io.IOException; @@ -42,7 +41,9 @@ import org.eclipse.jetty.servlet.ServletTester; import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; +import org.hamcrest.Matchers; import org.junit.After; +import org.junit.Assert; import org.junit.Before; import org.junit.Test; @@ -91,8 +92,10 @@ public class QoSFilterTest _doneRequests.await(10,TimeUnit.SECONDS); - assertFalse("TEST WAS NOT PARALLEL ENOUGH!",TestServlet.__maxSleepers<=MAX_QOS); - assertTrue(TestServlet.__maxSleepers<=NUM_CONNECTIONS); + if (TestServlet.__maxSleepers<=MAX_QOS) + LOG.warn("TEST WAS NOT PARALLEL ENOUGH!"); + else + Assert.assertThat(TestServlet.__maxSleepers,Matchers.lessThanOrEqualTo(NUM_CONNECTIONS)); } @Test @@ -109,8 +112,10 @@ public class QoSFilterTest } _doneRequests.await(10,TimeUnit.SECONDS); - assertFalse("TEST WAS NOT PARALLEL ENOUGH!",TestServlet.__maxSleepers Date: Mon, 15 Apr 2013 17:19:35 +1000 Subject: [PATCH 29/30] 364921 - FIN WAIT sockets --- .../org/eclipse/jetty/embedded/ManyConnectors.java | 1 + .../src/main/resources/jetty-logging.properties | 3 ++- .../java/org/eclipse/jetty/io/ssl/SslConnection.java | 10 ++++++++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/examples/embedded/src/main/java/org/eclipse/jetty/embedded/ManyConnectors.java b/examples/embedded/src/main/java/org/eclipse/jetty/embedded/ManyConnectors.java index c8b5f94c4f5..d1ae0d73562 100644 --- a/examples/embedded/src/main/java/org/eclipse/jetty/embedded/ManyConnectors.java +++ b/examples/embedded/src/main/java/org/eclipse/jetty/embedded/ManyConnectors.java @@ -67,6 +67,7 @@ public class ManyConnectors new SslConnectionFactory(sslContextFactory,"http/1.1"), new HttpConnectionFactory(https_config)); https.setPort(8443); + https.setIdleTimeout(5000); // Set the connectors server.setConnectors(new Connector[] { http, https }); diff --git a/examples/embedded/src/main/resources/jetty-logging.properties b/examples/embedded/src/main/resources/jetty-logging.properties index f912160249f..73456ad27b3 100644 --- a/examples/embedded/src/main/resources/jetty-logging.properties +++ b/examples/embedded/src/main/resources/jetty-logging.properties @@ -5,5 +5,6 @@ org.eclipse.jetty.SOURCE=false #org.eclipse.jetty.STACKS=false #org.eclipse.jetty.spdy.LEVEL=DEBUG #org.eclipse.jetty.server.LEVEL=DEBUG -#org.eclipse.jetty.io.ssl.LEVEL=DEBUG +org.eclipse.jetty.io.LEVEL=DEBUG +org.eclipse.jetty.io.ssl.LEVEL=DEBUG #org.eclipse.jetty.spdy.server.LEVEL=DEBUG 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 3af882389d2..3709322b763 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 @@ -190,6 +190,10 @@ public class SslConnection extends AbstractConnection if (DEBUG) LOG.debug("onFillable enter {}", getEndPoint()); + // We have received a close handshake, close the end point to send FIN. + if (_decryptedEndPoint.isInputShutdown()) + getEndPoint().close(); + // wake up whoever is doing the fill or the flush so they can // do all the filling, unwrapping, wrapping and flushing _decryptedEndPoint.getFillInterest().fillable(); @@ -425,7 +429,7 @@ public class SslConnection extends AbstractConnection return true; } } - else if (!isOutputShutdown()) + else { // Normal readable callback // Get called back on onfillable when then is more data to fill @@ -864,7 +868,9 @@ public class SslConnection extends AbstractConnection try { _sslEngine.closeOutbound(); - flush(BufferUtil.EMPTY_BUFFER); + flush(BufferUtil.EMPTY_BUFFER); // Send close handshake + getEndPoint().shutdownOutput(); // Send FIN + SslConnection.this.fillInterested(); // seek reply FIN or RST or close handshake } catch (Exception e) { From c912231d749ffa4250b850b016b63b97379dbf23 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Mon, 15 Apr 2013 18:40:05 +1000 Subject: [PATCH 30/30] 364921 - FIN WAIT sockets --- .../eclipse/jetty/embedded/ManyConnectors.java | 2 +- .../org/eclipse/jetty/io/ssl/SslConnection.java | 17 ++--------------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/examples/embedded/src/main/java/org/eclipse/jetty/embedded/ManyConnectors.java b/examples/embedded/src/main/java/org/eclipse/jetty/embedded/ManyConnectors.java index d1ae0d73562..92f5ddbc929 100644 --- a/examples/embedded/src/main/java/org/eclipse/jetty/embedded/ManyConnectors.java +++ b/examples/embedded/src/main/java/org/eclipse/jetty/embedded/ManyConnectors.java @@ -67,7 +67,7 @@ public class ManyConnectors new SslConnectionFactory(sslContextFactory,"http/1.1"), new HttpConnectionFactory(https_config)); https.setPort(8443); - https.setIdleTimeout(5000); + https.setIdleTimeout(500000); // Set the connectors server.setConnectors(new Connector[] { http, https }); 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 3709322b763..19b65488f92 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 @@ -618,18 +618,8 @@ public class SslConnection extends AbstractConnection } else { - if (isOutputShutdown()) - { - // We have sent the SSL Close Alert, and we read 0 bytes: - // it's a peer that it is not sending the FIN, so we just - // return -1 as if we did, so the connection will be closed. - return -1; - } - else - { - // we need to wait for more net data - return 0; - } + // we need to wait for more net data + return 0; } case FINISHED: @@ -844,8 +834,6 @@ public class SslConnection extends AbstractConnection { _bufferPool.release(_encryptedOutput); _encryptedOutput = null; - if (_sslEngine.isOutboundDone()) - getEndPoint().shutdownOutput(); } } @@ -869,7 +857,6 @@ public class SslConnection extends AbstractConnection { _sslEngine.closeOutbound(); flush(BufferUtil.EMPTY_BUFFER); // Send close handshake - getEndPoint().shutdownOutput(); // Send FIN SslConnection.this.fillInterested(); // seek reply FIN or RST or close handshake } catch (Exception e)