Merge remote-tracking branch 'origin/master' into servlet-3.1-api

This commit is contained in:
Greg Wilkins 2013-05-23 09:50:27 +10:00
commit 15e0d50b79
180 changed files with 5632 additions and 28 deletions

View File

@ -0,0 +1,23 @@
//
// ========================================================================
// 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.
// ========================================================================
//
/**
* Jetty Annotations : Support for Servlet Annotations
*/
package org.eclipse.jetty.annotations;

View File

@ -0,0 +1,23 @@
//
// ========================================================================
// 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.
// ========================================================================
//
/**
* Jetty Ant : Ant Tasks and Configuration
*/
package org.eclipse.jetty.ant;

View File

@ -0,0 +1,23 @@
//
// ========================================================================
// 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.
// ========================================================================
//
/**
* Jetty Ant : Ant Wrappers of Jetty Internals
*/
package org.eclipse.jetty.ant.types;

View File

@ -0,0 +1,23 @@
//
// ========================================================================
// 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.
// ========================================================================
//
/**
* Jetty Ant : Utility Classes
*/
package org.eclipse.jetty.ant.utils;

View File

@ -0,0 +1,23 @@
//
// ========================================================================
// 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.
// ========================================================================
//
/**
* Jetty Client : API Classes
*/
package org.eclipse.jetty.client.api;

View File

@ -17,6 +17,8 @@
//
/**
* Jetty Client : Implementation and Core Classes
*
* This package provides APIs, utility classes and an implementation of an asynchronous HTTP client.
* <p />
* The core class is {@link HttpClient}, which acts as a central configuration object (for example

View File

@ -0,0 +1,23 @@
//
// ========================================================================
// 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.
// ========================================================================
//
/**
* Jetty Client : Utility Classes
*/
package org.eclipse.jetty.client.util;

View File

@ -0,0 +1,23 @@
//
// ========================================================================
// 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.
// ========================================================================
//
/**
* Jetty Continuation : Generic Async Servlet Method
*/
package org.eclipse.jetty.continuation;

View File

@ -0,0 +1,23 @@
//
// ========================================================================
// 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.
// ========================================================================
//
/**
* Jetty Deploy : Standard Deployment Bindings
*/
package org.eclipse.jetty.deploy.bindings;

View File

@ -0,0 +1,23 @@
//
// ========================================================================
// 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.
// ========================================================================
//
/**
* Jetty Deploy : Deployment Graph
*/
package org.eclipse.jetty.deploy.graph;

View File

@ -0,0 +1,23 @@
//
// ========================================================================
// 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.
// ========================================================================
//
/**
* Jetty Deploy : JMX Integration
*/
package org.eclipse.jetty.deploy.jmx;

View File

@ -0,0 +1,23 @@
//
// ========================================================================
// 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.
// ========================================================================
//
/**
* Jetty Deploy : Webapp Deploy Management
*/
package org.eclipse.jetty.deploy;

View File

@ -0,0 +1,23 @@
//
// ========================================================================
// 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.
// ========================================================================
//
/**
* Jetty Deploy : Webapp Deployment Providers
*/
package org.eclipse.jetty.deploy.providers;

View File

@ -0,0 +1,23 @@
//
// ========================================================================
// 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.
// ========================================================================
//
/**
* Jetty Deploy : Utilities
*/
package org.eclipse.jetty.deploy.util;

View File

@ -0,0 +1,23 @@
//
// ========================================================================
// 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.
// ========================================================================
//
/**
* Jetty Http : Tools for Http processing
*/
package org.eclipse.jetty.http;

View File

@ -0,0 +1,23 @@
//
// ========================================================================
// 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.
// ========================================================================
//
/**
* Jetty IO : Core classes for Jetty IO subsystem
*/
package org.eclipse.jetty.io;

View File

@ -0,0 +1,23 @@
//
// ========================================================================
// 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.
// ========================================================================
//
/**
* Jetty IO : Core SSL Support
*/
package org.eclipse.jetty.io.ssl;

View File

@ -0,0 +1,23 @@
//
// ========================================================================
// 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.
// ========================================================================
//
/**
* Jetty Jaas : Jaas Callbacks
*/
package org.eclipse.jetty.jaas.callback;

View File

@ -0,0 +1,23 @@
//
// ========================================================================
// 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.
// ========================================================================
//
/**
* Jetty Jaas : Support for Jaas
*/
package org.eclipse.jetty.jaas;

View File

@ -0,0 +1,23 @@
//
// ========================================================================
// 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.
// ========================================================================
//
/**
* Jetty Jaas : Various Jaas Implementations for Jetty
*/
package org.eclipse.jetty.jaas.spi;

View File

@ -0,0 +1,23 @@
//
// ========================================================================
// 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.
// ========================================================================
//
/**
* Jetty Jaspi : Callbacks
*/
package org.eclipse.jetty.security.jaspi.callback;

View File

@ -0,0 +1,23 @@
//
// ========================================================================
// 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.
// ========================================================================
//
/**
* Jetty Jaspi : Authentication Modules
*/
package org.eclipse.jetty.security.jaspi.modules;

View File

@ -0,0 +1,23 @@
//
// ========================================================================
// 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.
// ========================================================================
//
/**
* Jetty Jaspi : Java Authentication SPI
*/
package org.eclipse.jetty.security.jaspi;

View File

@ -0,0 +1,23 @@
//
// ========================================================================
// 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.
// ========================================================================
//
/**
* Jetty JMX : Integration for JMX in Jetty
*/
package org.eclipse.jetty.jmx;

View File

@ -0,0 +1,23 @@
//
// ========================================================================
// 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.
// ========================================================================
//
/**
* Jetty JMX : Jetty Logging JMX Integration
*/
package org.eclipse.jetty.util.log.jmx;

View File

@ -0,0 +1,23 @@
//
// ========================================================================
// 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.
// ========================================================================
//
/**
* Jetty Jndi : Factories
*/
package org.eclipse.jetty.jndi.factories;

View File

@ -0,0 +1,23 @@
//
// ========================================================================
// 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.
// ========================================================================
//
/**
* Jetty Jndi : Mappings for java
*/
package org.eclipse.jetty.jndi.java;

View File

@ -0,0 +1,23 @@
//
// ========================================================================
// 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.
// ========================================================================
//
/**
* Jetty Jndi : Mappings for local
*/
package org.eclipse.jetty.jndi.local;

View File

@ -0,0 +1,23 @@
//
// ========================================================================
// 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.
// ========================================================================
//
/**
* Jetty Jndi : Java Naming Directory Interface
*/
package org.eclipse.jetty.jndi;

View File

@ -0,0 +1,23 @@
//
// ========================================================================
// 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.
// ========================================================================
//
/**
* Jetty Jspc Maven Plugin : Support for precompiling jsps
*/
package org.eclipse.jetty.jspc.plugin;

View File

@ -0,0 +1,23 @@
//
// ========================================================================
// 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.
// ========================================================================
//
/**
* Jetty Maven Plugin : Support for Jetty in Maven build lifecycle
*/
package org.eclipse.jetty.maven.plugin;

View File

@ -0,0 +1,23 @@
//
// ========================================================================
// 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.
// ========================================================================
//
/**
* Jetty Monitor : Intregation with Java Monitor
*/
package org.eclipse.jetty.monitor.integration;

View File

@ -0,0 +1,23 @@
//
// ========================================================================
// 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.
// ========================================================================
//
/**
* Jetty Monitor : JMX Integration
*/
package org.eclipse.jetty.monitor.jmx;

View File

@ -0,0 +1,23 @@
//
// ========================================================================
// 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.
// ========================================================================
//
/**
* Jetty Monitor : Tool for Monitoring Threads
*/
package org.eclipse.jetty.monitor;

View File

@ -0,0 +1,23 @@
//
// ========================================================================
// 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.
// ========================================================================
//
/**
* Jetty Monitor : Thread Monitoring
*/
package org.eclipse.jetty.monitor.thread;

View File

@ -0,0 +1,23 @@
//
// ========================================================================
// 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.
// ========================================================================
//
/**
* Jetty Monitor : Triggers for Monitor Events
*/
package org.eclipse.jetty.monitor.triggers;

View File

@ -0,0 +1,23 @@
//
// ========================================================================
// 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.
// ========================================================================
//
/**
* Jetty NoSql : MongoDB Sessions JMX Integration
*/
package org.eclipse.jetty.nosql.mongodb.jmx;

View File

@ -0,0 +1,23 @@
//
// ========================================================================
// 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.
// ========================================================================
//
/**
* Jetty NoSql : MongoDB Integration
*/
package org.eclipse.jetty.nosql.mongodb;

View File

@ -0,0 +1,23 @@
//
// ========================================================================
// 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.
// ========================================================================
//
/**
* Jetty NoSql : Generic Nosql Session Management
*/
package org.eclipse.jetty.nosql;

View File

@ -0,0 +1,63 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-project</artifactId>
<version>9.0.4-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jetty-overlay-deployer</artifactId>
<name>Jetty :: Overlay Deployer</name>
<description>Overlayed deployer</description>
<properties>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>${basedir}/src/main/assembly/config.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-deploy</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-plus</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.orbit</groupId>
<artifactId>javax.transaction</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.toolchain</groupId>
<artifactId>jetty-test-helper</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<reporting>
</reporting>
</project>

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<assembly>
<id>config</id>
<includeBaseDirectory>false</includeBaseDirectory>
<formats>
<format>jar</format>
</formats>
<fileSets>
<fileSet>
<directory>src/main/config</directory>
<outputDirectory></outputDirectory>
<includes>
<include>etc/**</include>
<include>overlays/**</include>
</includes>
</fileSet>
</fileSets>
</assembly>

View File

@ -0,0 +1,24 @@
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<!-- =============================================================== -->
<!-- Add a ContextProvider to the deployment manager -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- This scans the webapps directory for war files and directories -->
<!-- to deploy. -->
<!-- This configuration must be used with jetty-deploy.xml, which -->
<!-- creates the deployment manager instance -->
<!-- =============================================================== -->
<Configure id="Server" class="org.eclipse.jetty.server.Server">
<Ref id="DeploymentManager">
<Call name="addAppProvider">
<Arg>
<New id="OverlayedAppProvider" class="org.eclipse.jetty.overlays.OverlayedAppProvider">
<Set name="scanDir"><Property name="jetty.home" default="." />/overlays</Set>
<Set name="nodeName"><Property name="node.name" default="nonameNode"/></Set>
<Set name="scanInterval">1</Set>
</New>
</Arg>
</Call>
</Ref>
</Configure>

View File

@ -0,0 +1,27 @@
Cloudtide instance
===================
This directory contains overlays (as directories or jars) that
are define instances of templates to be deployed.
An instance filename consists of a template name, the '=' character (or '--' string)
and then an instance identifier. For example:
mytemplate=redInstance
This defines a instance called redInstance using the template called mytemplate.
An overlay is structed as a WAR, but also may contain:
* WEB-INF/lib-overlay directory, which can contain jar files made available to
the overlay.xml configuration (unlike any overlayed WEB-INF/lib jars).
* A WEB-INF/overlay.xml file, which is an XmlConfiguration format file used to
inject the ContextHandler instance.
* A WEB-INF/web-overlay.xml fragment that is applied as an override descriptor
* Static content that overlays the static content of the webapp, node and template.
* WEB-INF/classes and WEB-INF/lib that overlays the code of the webapp, node and template.

View File

@ -0,0 +1,20 @@
Cloudtide nodes
===============
This directory contains overlays (as directories or jars) that
are applied to all instances for a given node.
An overlay is structed as a WAR, but also may contain:
* WEB-INF/lib-overlay directory, which can contain jar files made available to
the overlay.xml configuration (unlike any overlayed WEB-INF/lib jars).
* A WEB-INF/overlay.xml file, which is an XmlConfiguration format file used to
inject the ContextHandler instance.
* A WEB-INF/web-overlay.xml fragment that is applied as an override descriptor
* Static content that overlays the static content of the webapp, node and template.
* WEB-INF/classes and WEB-INF/lib that overlays the code of the webapp, node and template.

View File

@ -0,0 +1,32 @@
Cloudtide templates
===================
This directory contains overlays (as directories or jars) that
are applied to webapps to create templates. Templates are not directly
deployed, but are used by overlays in the instances directory.
A Template filename consists of a template name, the '=' character and
then the webapp name. For example:
mytemplate=mywebapp-1.2.3
This defines a template called mytemplate that overlays either the mywebapp-1.2.3.war
file or the mywebapp-1.2.3 directory in cloudtide/webapps.
An overlay is structed as a WAR, and may contain:
* WEB-INF/template.xml a XmlConfiguration formatted file that is applied to a shared
instance of TemplateContext to provide the common classloader and resource cache to
all instances of the template.
* WEB-INF/lib-overlay directory, which can contain jar files made available to
the overlay.xml configuration (unlike any overlayed WEB-INF/lib jars).
* A WEB-INF/overlay.xml file, which is an XmlConfiguration format file used to
inject the ContextHandler instance.
* A WEB-INF/web-overlay.xml fragment that is applied as an override descriptor
* Static content that overlays the static content of the webapp, node and template.
* WEB-INF/classes and WEB-INF/lib that overlays the code of the webapp, node and template.

View File

@ -0,0 +1,6 @@
Cloudtide webapplication
------------------------
This directory contains webapplication directories or war files that are used by the
cloudtide templates

View File

@ -0,0 +1,290 @@
//
// ========================================================================
// 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.overlays;
import java.io.IOException;
import java.security.PermissionCollection;
import java.util.Map;
import org.eclipse.jetty.http.MimeTypes;
import org.eclipse.jetty.server.ResourceCache;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.util.component.ContainerLifeCycle;
import org.eclipse.jetty.util.component.Destroyable;
import org.eclipse.jetty.util.resource.Resource;
import org.eclipse.jetty.webapp.ClasspathPattern;
import org.eclipse.jetty.webapp.WebAppClassLoader;
import org.eclipse.jetty.webapp.WebAppContext;
import org.eclipse.jetty.xml.XmlConfiguration;
/**
* A Cloudtide template context.
* <p>
* This class is configured by the template.xml files and is used to control the
* shared resource cache and classloader.
* <p>
* This class is an AggregateLifeCycle, so dependent beans may be added to the template and will be started, stopped and destroyed with the template.
* The template is started after the template.xml file have been applied. It is stopped and destroyed after the last instance using the template is undeployed.
*/
public class TemplateContext extends ContainerLifeCycle implements WebAppClassLoader.Context, Destroyable
{
private final ClassLoader _libLoader;
private final Resource _baseResource;
private final ResourceCache _resourceCache;
private final Server _server;
private final MimeTypes _mimeTypes;
private final WebAppClassLoader _webappLoader;
private ClasspathPattern _systemClasses;
private ClasspathPattern _serverClasses;
private PermissionCollection _permissions;
private boolean _parentLoaderPriority;
private String _extraClasspath;
private Map<String, Object> _idMap;
public ClassLoader getLibLoader()
{
return _libLoader;
}
public TemplateContext()
{
_server=null;
_baseResource=null;
_mimeTypes=new MimeTypes();
_resourceCache=null;
_webappLoader=null;
_libLoader=null;
}
public TemplateContext(String key, Server server,Resource baseResource, ClassLoader libLoader) throws IOException
{
_server=server;
_baseResource=baseResource;
_mimeTypes=new MimeTypes();
_resourceCache=new ResourceCache(null,baseResource,_mimeTypes,false,false);
String[] patterns = (String[])_server.getAttribute(WebAppContext.SERVER_SRV_CLASSES);
_serverClasses=new ClasspathPattern(patterns==null?WebAppContext.__dftServerClasses:patterns);
patterns = (String[])_server.getAttribute(WebAppContext.SERVER_SYS_CLASSES);
_systemClasses=new ClasspathPattern(patterns==null?WebAppContext.__dftSystemClasses:patterns);
_libLoader=libLoader;
// Is this a webapp or a normal context
Resource classes=getBaseResource().addPath("WEB-INF/classes/");
Resource lib=getBaseResource().addPath("WEB-INF/lib/");
if (classes.exists() && classes.isDirectory() || lib.exists() && lib.isDirectory())
{
_webappLoader=new WebAppClassLoader(_libLoader,this);
_webappLoader.setName(key);
if (classes.exists())
_webappLoader.addClassPath(classes);
if (lib.exists())
_webappLoader.addJars(lib);
}
else
_webappLoader=null;
}
/* ------------------------------------------------------------ */
public Resource getBaseResource()
{
return _baseResource;
}
/* ------------------------------------------------------------ */
/**
* @return Comma or semicolon separated path of filenames or URLs
* pointing to directories or jar files. Directories should end
* with '/'.
*/
public String getExtraClasspath()
{
return _extraClasspath;
}
/* ------------------------------------------------------------ */
public MimeTypes getMimeTypes()
{
return _mimeTypes;
}
/* ------------------------------------------------------------ */
public PermissionCollection getPermissions()
{
return _permissions;
}
/* ------------------------------------------------------------ */
public ResourceCache getResourceCache()
{
return _resourceCache;
}
/* ------------------------------------------------------------ */
public Server getServer()
{
return _server;
}
/* ------------------------------------------------------------ */
WebAppClassLoader getWebappLoader()
{
return _webappLoader;
}
/* ------------------------------------------------------------ */
public boolean isParentLoaderPriority()
{
return _parentLoaderPriority;
}
/* ------------------------------------------------------------ */
public boolean isServerClass(String clazz)
{
return _serverClasses.match(clazz);
}
/* ------------------------------------------------------------ */
public boolean isSystemClass(String clazz)
{
return _systemClasses.match(clazz);
}
/* ------------------------------------------------------------ */
public Resource newResource(String urlOrPath) throws IOException
{
return Resource.newResource(urlOrPath);
}
/* ------------------------------------------------------------ */
/**
* @param extraClasspath Comma or semicolon separated path of filenames or URLs
* pointing to directories or jar files. Directories should end
* with '/'.
*/
public void setExtraClasspath(String extraClasspath)
{
_extraClasspath=extraClasspath;
}
/* ------------------------------------------------------------ */
/**
* @param java2compliant The java2compliant to set.
*/
public void setParentLoaderPriority(boolean java2compliant)
{
_parentLoaderPriority = java2compliant;
}
/* ------------------------------------------------------------ */
/**
* @param permissions The permissions to set.
*/
public void setPermissions(PermissionCollection permissions)
{
_permissions = permissions;
}
/* ------------------------------------------------------------ */
/**
* Set the server classes patterns.
* <p>
* Server classes/packages are classes used to implement the server and are hidden
* from the context. If the context needs to load these classes, it must have its
* own copy of them in WEB-INF/lib or WEB-INF/classes.
* A class pattern is a string of one of the forms:<dl>
* <dt>org.package.Classname</dt><dd>Match a specific class</dd>
* <dt>org.package.</dt><dd>Match a specific package hierarchy</dd>
* <dt>-org.package.Classname</dt><dd>Exclude a specific class</dd>
* <dt>-org.package.</dt><dd>Exclude a specific package hierarchy</dd>
* </dl>
* @param serverClasses The serverClasses to set.
*/
public void setServerClasses(String[] serverClasses)
{
_serverClasses = new ClasspathPattern(serverClasses);
}
/* ------------------------------------------------------------ */
/**
* Set the system classes patterns.
* <p>
* System classes/packages are classes provided by the JVM and that
* cannot be replaced by classes of the same name from WEB-INF,
* regardless of the value of {@link #setParentLoaderPriority(boolean)}.
* A class pattern is a string of one of the forms:<dl>
* <dt>org.package.Classname</dt><dd>Match a specific class</dd>
* <dt>org.package.</dt><dd>Match a specific package hierarchy</dd>
* <dt>-org.package.Classname</dt><dd>Exclude a specific class</dd>
* <dt>-org.package.</dt><dd>Exclude a specific package hierarchy</dd>
* </dl>
* @param systemClasses The systemClasses to set.
*/
public void setSystemClasses(String[] systemClasses)
{
_systemClasses = new ClasspathPattern(systemClasses);
}
/* ------------------------------------------------------------ */
public void addSystemClass(String classname)
{
_systemClasses.addPattern(classname);
}
/* ------------------------------------------------------------ */
public void addServerClass(String classname)
{
_serverClasses.addPattern(classname);
}
/* ------------------------------------------------------------ */
public void destroy()
{
if (_baseResource!=null)
_baseResource.release();
if (_resourceCache!=null)
_resourceCache.flushCache();
if(_idMap!=null)
_idMap.clear();
}
/* ------------------------------------------------------------ */
public void setIdMap(Map<String, Object> idMap)
{
_idMap=idMap;
}
/* ------------------------------------------------------------ */
public Map<String, Object> getIdMap()
{
return _idMap;
}
}

View File

@ -0,0 +1,23 @@
//
// ========================================================================
// 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.
// ========================================================================
//
/**
* Jetty Overlay : Overlay Deployment Provider
*/
package org.eclipse.jetty.overlays;

View File

@ -0,0 +1,100 @@
//
// ========================================================================
// 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.overlays;
import java.io.File;
import org.eclipse.jetty.deploy.DeploymentManager;
import org.eclipse.jetty.jndi.NamingUtil;
import org.eclipse.jetty.overlays.OverlayedAppProvider;
import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
import org.eclipse.jetty.server.handler.ContextHandlerCollection;
import org.eclipse.jetty.server.handler.DefaultHandler;
import org.eclipse.jetty.server.handler.HandlerCollection;
import org.eclipse.jetty.server.handler.RequestLogHandler;
import org.eclipse.jetty.server.handler.StatisticsHandler;
public class OverlayServer
{
public static void main(String[] args) throws Exception
{
// NamingUtil.__log.setDebugEnabled(true);
String jetty_home = System.getProperty("jetty.home","target/test-classes/home");
System.setProperty("jetty.home",jetty_home);
Server server = new Server();
server.setAttribute("org.eclipse.jetty.webapp.configuration",
new String[]
{
org.eclipse.jetty.webapp.WebInfConfiguration.class.getCanonicalName(),
org.eclipse.jetty.webapp.WebXmlConfiguration.class.getCanonicalName(),
org.eclipse.jetty.webapp.MetaInfConfiguration.class.getCanonicalName(),
org.eclipse.jetty.webapp.FragmentConfiguration.class.getCanonicalName(),
org.eclipse.jetty.plus.webapp.EnvConfiguration.class.getCanonicalName(),
org.eclipse.jetty.plus.webapp.PlusConfiguration.class.getCanonicalName(),
org.eclipse.jetty.webapp.JettyWebXmlConfiguration.class.getCanonicalName(),
org.eclipse.jetty.webapp.TagLibConfiguration.class.getCanonicalName()
}
);
// Setup Connectors
ServerConnector connector = new ServerConnector(server);
connector.setPort(8080);
server.addConnector(connector);
HandlerCollection handlers = new HandlerCollection();
ContextHandlerCollection contexts = new ContextHandlerCollection();
RequestLogHandler requestLogHandler = new RequestLogHandler();
handlers.setHandlers(new Handler[]
{ contexts, new DefaultHandler(), requestLogHandler });
StatisticsHandler stats = new StatisticsHandler();
stats.setHandler(handlers);
server.setHandler(stats);
// Setup deployers
DeploymentManager deployer = new DeploymentManager();
deployer.setContexts(contexts);
server.addBean(deployer);
OverlayedAppProvider provider = new OverlayedAppProvider();
provider.setNodeName("nodeA");
provider.setScanDir(new File(jetty_home + "/overlays"));
provider.setScanInterval(2);
deployer.addAppProvider(provider);
server.setStopAtShutdown(true);
//server.setSendServerVersion(true);
// Uncomment to work with JNDI examples
// new org.eclipse.jetty.plus.jndi.Transaction(new com.atomikos.icatch.jta.UserTransactionImp());
server.start();
server.join();
}
}

View File

@ -0,0 +1,589 @@
//
// ========================================================================
// 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.overlays;
import java.io.File;
import java.io.FileOutputStream;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.Set;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
import org.eclipse.jetty.util.IO;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
public class OverlayedAppProviderTest
{
File _tmp;
File _scan;
File _webapps;
File _templates;
File _nodes;
File _instances;
@Before
public void before() throws Exception
{
_tmp=File.createTempFile("OAPTest",null);
if (_tmp.exists())
IO.delete(_tmp);
_tmp.mkdir();
_scan = new File(_tmp,"scan").getCanonicalFile();
_webapps = new File(_scan,OverlayedAppProvider.WEBAPPS);
_templates = new File(_scan,OverlayedAppProvider.TEMPLATES);
_nodes = new File(_scan,OverlayedAppProvider.NODES);
_instances = new File(_scan,OverlayedAppProvider.INSTANCES);
_webapps.mkdirs();
_templates.mkdir();
_nodes.mkdir();
_instances.mkdir();
}
@After
public void after() throws Exception
{
if (_tmp.exists())
IO.delete(_tmp);
}
@Test
public void testScanForWars() throws Exception
{
final ConcurrentLinkedQueue<Set<String>> scanned = new ConcurrentLinkedQueue<Set<String>>();
OverlayedAppProvider provider = new OverlayedAppProvider()
{
/* ------------------------------------------------------------ */
/**
* @see org.eclipse.jetty.overlays.OverlayedAppProvider#updateLayers(java.util.Set)
*/
@Override
protected void updateLayers(Set<String> filenames)
{
scanned.offer(filenames);
}
};
provider.setScanInterval(0);
provider.setScanDir(_scan);
provider.start();
provider.scan();
provider.scan();
assertTrue(scanned.isEmpty());
// Check scanning for archives
File war = new File(_webapps,"foo-1.2.3.war");
touch(war);
File template = new File(_templates,"foo=foo-1.2.3.war");
touch(template);
File node = new File(_nodes,"nodeA.war");
touch(node);
File instance = new File(_instances,"foo=instance.war");
touch(instance);
provider.scan();
provider.scan();
Set<String> results = scanned.poll();
assertTrue(results!=null);
assertEquals(4,results.size());
assertTrue(results.contains("webapps/foo-1.2.3.war"));
assertTrue(results.contains("templates/foo=foo-1.2.3.war"));
assertTrue(results.contains("nodes/nodeA.war"));
assertTrue(results.contains("instances/foo=instance.war"));
provider.scan();
provider.scan();
assertTrue(scanned.isEmpty());
IO.delete(war);
IO.delete(template);
IO.delete(node);
IO.delete(instance);
provider.scan();
provider.scan();
results = scanned.poll();
assertTrue(results!=null);
assertEquals(4,results.size());
assertTrue(results.contains("webapps/foo-1.2.3.war"));
assertTrue(results.contains("templates/foo=foo-1.2.3.war"));
assertTrue(results.contains("nodes/nodeA.war"));
assertTrue(results.contains("instances/foo=instance.war"));
}
@Test
public void testScanForDirs() throws Exception
{
final ConcurrentLinkedQueue<Set<String>> scanned = new ConcurrentLinkedQueue<Set<String>>();
OverlayedAppProvider provider = new OverlayedAppProvider()
{
/* ------------------------------------------------------------ */
/**
* @see org.eclipse.jetty.overlays.OverlayedAppProvider#updateLayers(java.util.Set)
*/
@Override
protected void updateLayers(Set<String> filenames)
{
scanned.offer(filenames);
}
};
provider.setScanInterval(0);
provider.setScanDir(_scan);
provider.start();
provider.scan();
assertTrue(scanned.isEmpty());
// Check scanning for directories
File war = new File(_webapps,"foo-1.2.3");
war.mkdir();
File template = new File(_templates,"foo=foo-1.2.3");
template.mkdir();
File node = new File(_nodes,"nodeA");
node.mkdir();
File instance = new File(_instances,"foo=instance");
instance.mkdir();
for (File f : new File[] { war,template,node,instance } )
{
File webinf = new File(f,"WEB-INF");
webinf.mkdir();
touch(webinf,"web.xml");
}
provider.scan();
provider.scan();
Set<String> results = scanned.poll();
assertTrue(results!=null);
assertEquals(4,results.size());
assertTrue(results.contains("webapps/foo-1.2.3"));
assertTrue(results.contains("templates/foo=foo-1.2.3"));
assertTrue(results.contains("nodes/nodeA"));
assertTrue(results.contains("instances/foo=instance"));
provider.scan();
provider.scan();
assertTrue(scanned.isEmpty());
// Touch everything
touch(war,"WEB-INF/web.xml");
touch(war,"WEB-INF/spring.XML");
touch(war,"WEB-INF/other");
touch(war,"WEB-INF/lib/bar.jar");
touch(war,"WEB-INF/classes/bar.class");
for (File d : new File[]{template,node,instance})
{
touch(d,"WEB-INF/web-fragment.xml");
touch(d,"WEB-INF/overlay.xml");
touch(d,"WEB-INF/other");
touch(d,"WEB-INF/lib/bar.jar");
}
provider.scan();
provider.scan();
results = scanned.poll();
assertTrue(results!=null);
assertEquals(4,results.size());
assertTrue(results.contains("webapps/foo-1.2.3"));
assertTrue(results.contains("templates/foo=foo-1.2.3"));
assertTrue(results.contains("nodes/nodeA"));
assertTrue(results.contains("instances/foo=instance"));
// Touch xml
Thread.sleep(1000); // needed so last modified is different
for (File d : new File[]{war,template,node,instance})
touch(d,"WEB-INF/web.xml");
provider.scan();
provider.scan();
results = scanned.poll();
assertTrue(results!=null);
assertEquals(4,results.size());
assertTrue(results.contains("webapps/foo-1.2.3"));
assertTrue(results.contains("templates/foo=foo-1.2.3"));
assertTrue(results.contains("nodes/nodeA"));
assertTrue(results.contains("instances/foo=instance"));
// Touch XML
Thread.sleep(1000);
for (File d : new File[]{war,template,node,instance})
touch(d,"WEB-INF/spring.XML");
provider.scan();
provider.scan();
results = scanned.poll();
assertTrue(results!=null);
assertEquals(4,results.size());
assertTrue(results.contains("webapps/foo-1.2.3"));
assertTrue(results.contains("templates/foo=foo-1.2.3"));
assertTrue(results.contains("nodes/nodeA"));
assertTrue(results.contains("instances/foo=instance"));
// Touch unrelated
for (File d : new File[]{war,template,node,instance})
touch(d,"index.html");
provider.scan();
provider.scan();
results = scanned.poll();
assertEquals(null,results);
// Touch jar
Thread.sleep(1000);
for (File d : new File[]{war,template,node,instance})
touch(d,"WEB-INF/lib/bar.jar");
provider.scan();
provider.scan();
results = scanned.poll();
assertTrue(results!=null);
assertEquals(4,results.size());
assertTrue(results.contains("webapps/foo-1.2.3"));
assertTrue(results.contains("templates/foo=foo-1.2.3"));
assertTrue(results.contains("nodes/nodeA"));
assertTrue(results.contains("instances/foo=instance"));
// touch other class
Thread.sleep(1000);
for (File d : new File[]{war,template,node,instance})
touch(d,"index.html");
provider.scan();
provider.scan();
results = scanned.poll();
assertTrue(scanned.isEmpty());
// delete all
IO.delete(war);
IO.delete(template);
IO.delete(node);
IO.delete(instance);
provider.scan();
provider.scan();
results = scanned.poll();
assertTrue(results!=null);
assertEquals(4,results.size());
assertTrue(results.contains("webapps/foo-1.2.3"));
assertTrue(results.contains("templates/foo=foo-1.2.3"));
assertTrue(results.contains("nodes/nodeA"));
assertTrue(results.contains("instances/foo=instance"));
}
@Test
public void testTriageURI() throws Exception
{
final BlockingQueue<String> scanned = new LinkedBlockingQueue<String>();
OverlayedAppProvider provider = new OverlayedAppProvider()
{
protected void removeInstance(String name)
{
scanned.add("removeInstance "+name);
}
protected Instance loadInstance(String name, File origin)
{
scanned.add("loadInstance "+name);
scanned.add(origin.getAbsolutePath());
return null;
}
protected void removeNode()
{
scanned.add("removeNode");
}
protected Node loadNode(File origin)
{
scanned.add("loadNode");
scanned.add(origin.getAbsolutePath());
return null;
}
protected void removeTemplate(String name)
{
scanned.add("removeTemplate "+name);
}
protected Template loadTemplate(String name, File origin)
{
scanned.add("loadTemplate "+name);
scanned.add(origin.getAbsolutePath());
return null;
}
protected void removeWebapp(String name)
{
scanned.add("removeWebapp "+name);
}
protected Webapp loadWebapp(String name, File origin)
{
scanned.add("loadWebapp "+name);
scanned.add(origin.getAbsolutePath());
return null;
}
protected void redeploy()
{
}
};
provider.setScanInterval(0);
provider.setNodeName("nodeA");
provider.setScanDir(_scan);
provider.start();
provider.scan();
assertTrue(scanned.isEmpty());
// Add a war
File war = new File(_webapps,"foo-1.2.3.war");
touch(war);
provider.scan();
provider.scan();
assertEquals("loadWebapp foo-1.2.3",scanned.poll(1,TimeUnit.SECONDS));
assertEquals(war.getAbsolutePath(),scanned.poll(1,TimeUnit.SECONDS));
// Add a template
File template = new File(_templates,"foo=foo-1.2.3.war");
touch(template);
provider.scan();
provider.scan();
assertEquals("loadTemplate foo=foo-1.2.3",scanned.poll(1,TimeUnit.SECONDS));
assertEquals(template.getAbsolutePath(),scanned.poll(1,TimeUnit.SECONDS));
// Add a node
File nodeA = new File(_nodes,"nodeA.war");
touch(nodeA);
provider.scan();
provider.scan();
assertEquals("loadNode",scanned.poll(1,TimeUnit.SECONDS));
assertEquals(nodeA.getAbsolutePath(),scanned.poll(1,TimeUnit.SECONDS));
// Add another node
File nodeB = new File(_nodes,"nodeB.war");
provider.scan();
provider.scan();
assertTrue(scanned.isEmpty());
// Add an instance
File instance = new File(_instances,"foo=instance.war");
touch(instance);
provider.scan();
provider.scan();
assertEquals("loadInstance foo=instance",scanned.poll(1,TimeUnit.SECONDS));
assertEquals(instance.getAbsolutePath(),scanned.poll(1,TimeUnit.SECONDS));
// Add a war dir
File warDir = new File(_webapps,"foo-1.2.3");
warDir.mkdir();
File warDirWI = new File(warDir,"WEB-INF");
warDirWI.mkdir();
touch(warDirWI,"web.xml");
provider.scan();
provider.scan();
assertEquals("loadWebapp foo-1.2.3",scanned.poll(1,TimeUnit.SECONDS));
assertEquals(warDir.getAbsolutePath(),scanned.poll(1,TimeUnit.SECONDS));
// Add a template dir
File templateDir = new File(_templates,"foo=foo-1.2.3");
templateDir.mkdir();
File templateDirWI = new File(templateDir,"WEB-INF");
templateDirWI.mkdir();
touch(templateDirWI,"web.xml");
provider.scan();
provider.scan();
assertEquals("loadTemplate foo=foo-1.2.3",scanned.poll(1,TimeUnit.SECONDS));
assertEquals(templateDir.getAbsolutePath(),scanned.poll(1,TimeUnit.SECONDS));
// Add a node dir
File nodeADir = new File(_nodes,"nodeA");
nodeADir.mkdir();
File nodeADirWI = new File(nodeADir,"WEB-INF");
nodeADirWI.mkdir();
touch(nodeADirWI,"web.xml");
provider.scan();
provider.scan();
assertEquals("loadNode",scanned.poll(1,TimeUnit.SECONDS));
assertEquals(nodeADir.getAbsolutePath(),scanned.poll(1,TimeUnit.SECONDS));
// Add another node dir
File nodeBDir = new File(_nodes,"nodeB");
nodeBDir.mkdir();
File nodeBDirWI = new File(nodeBDir,"WEB-INF");
nodeBDirWI.mkdir();
touch(nodeBDirWI,"web.xml");
provider.scan();
provider.scan();
assertTrue(scanned.isEmpty());
// Add an instance dir
File instanceDir = new File(_instances,"foo=instance");
instanceDir.mkdir();
File instanceDirWI = new File(instanceDir,"WEB-INF");
instanceDirWI.mkdir();
touch(instanceDirWI,"web.xml");
provider.scan();
provider.scan();
assertEquals("loadInstance foo=instance",scanned.poll(1,TimeUnit.SECONDS));
assertEquals(instanceDir.getAbsolutePath(),scanned.poll(1,TimeUnit.SECONDS));
// touch archives will be ignored.
Thread.sleep(1000);
touch(war);
touch(template);
touch(nodeA);
touch(nodeB);
touch(instance);
provider.scan();
provider.scan();
assertTrue(scanned.isEmpty());
// Touch directories
for (File d : new File[]{warDir,templateDir,nodeADir,nodeBDir,instanceDir})
touch(d,"WEB-INF/web.xml");
provider.scan();
provider.scan();
assertEquals(8,scanned.size());
scanned.clear();
// Remove web dir
IO.delete(warDir);
provider.scan();
provider.scan();
assertEquals("removeWebapp foo-1.2.3",scanned.poll(1,TimeUnit.SECONDS));
assertEquals("loadWebapp foo-1.2.3",scanned.poll(1,TimeUnit.SECONDS));
assertEquals(war.getAbsolutePath(),scanned.poll(1,TimeUnit.SECONDS));
// Remove template dir
IO.delete(templateDir);
provider.scan();
provider.scan();
assertEquals("removeTemplate foo=foo-1.2.3",scanned.poll(1,TimeUnit.SECONDS));
assertEquals("loadTemplate foo=foo-1.2.3",scanned.poll(1,TimeUnit.SECONDS));
assertEquals(template.getAbsolutePath(),scanned.poll(1,TimeUnit.SECONDS));
// Remove nodeA dir
IO.delete(nodeADir);
provider.scan();
provider.scan();
assertEquals("removeNode",scanned.poll(1,TimeUnit.SECONDS));
assertEquals("loadNode",scanned.poll(1,TimeUnit.SECONDS));
assertEquals(nodeA.getAbsolutePath(),scanned.poll(1,TimeUnit.SECONDS));
// Remove nodeB dir
IO.delete(nodeBDir);
provider.scan();
provider.scan();
assertTrue(scanned.isEmpty());
// Remove instance dir
IO.delete(instanceDir);
provider.scan();
provider.scan();
assertEquals("removeInstance foo=instance",scanned.poll(1,TimeUnit.SECONDS));
assertEquals("loadInstance foo=instance",scanned.poll(1,TimeUnit.SECONDS));
assertEquals(instance.getAbsolutePath(),scanned.poll(1,TimeUnit.SECONDS));
// Remove web
IO.delete(war);
provider.scan();
provider.scan();
assertEquals("removeWebapp foo-1.2.3",scanned.poll(1,TimeUnit.SECONDS));
// Remove template
IO.delete(template);
provider.scan();
provider.scan();
assertEquals("removeTemplate foo=foo-1.2.3",scanned.poll(1,TimeUnit.SECONDS));
// Remove nodeA dir
IO.delete(nodeA);
provider.scan();
provider.scan();
assertEquals("removeNode",scanned.poll(1,TimeUnit.SECONDS));
// Remove nodeB dir
IO.delete(nodeB);
provider.scan();
provider.scan();
assertTrue(scanned.isEmpty());
// Remove instance dir
IO.delete(instance);
provider.scan();
provider.scan();
assertEquals("removeInstance foo=instance",scanned.poll(1,TimeUnit.SECONDS));
provider.scan();
provider.scan();
assertTrue(scanned.isEmpty());
}
private void touch(File base,String path)
{
try
{
File target = new File(new URI(base.toURI().toString()+path));
target.getParentFile().mkdirs();
touch(target);
}
catch (URISyntaxException e)
{
e.printStackTrace();
}
}
private void touch(File file)
{
try
{
IO.delete(file);
FileOutputStream out = new FileOutputStream(file,false);
out.write("<h1>Hello</h1>".getBytes());
out.close();
}
catch(Exception e)
{
e.printStackTrace();
}
}
}

View File

@ -0,0 +1 @@
instance myfoo=blue WEB-INF classes

View File

@ -0,0 +1 @@
instance myfoo=blue WEB-INF classes

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="contextPath">/blue</Set>
<!--
<Set name="virtualHosts">
<Array type="String">
<Item>blue.myVirtualDomain.com</Item>
</Array>
</Set>
-->
</Configure>

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<display-name>Blue Test WebApp</display-name>
<context-param>
<param-name>overlay</param-name>
<param-value>instances/myfoo=blue/web.xml</param-value>
</context-param>
<context-param>
<param-name>instance</param-name>
<param-value>instances/myfoo=blue/web.xml</param-value>
</context-param>
</web-app>

View File

@ -0,0 +1,3 @@
Manifest-Version: 1.0
Created-By: 1.6.0_20 (Sun Microsystems Inc.)

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -0,0 +1 @@
instance myfoo=blue WEB-INF classes

View File

@ -0,0 +1 @@
instance myfoo=blue WEB-INF classes

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -0,0 +1 @@
instance myfoo=green WEB-INF classes

View File

@ -0,0 +1 @@
instance myfoo=green WEB-INF classes

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="contextPath">/green</Set>
<!--
<Set name="virtualHosts">
<Array type="String">
<Item>green.myVirtualDomain.com</Item>
</Array>
</Set>
-->
</Configure>

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<display-name>Green Test WebApp</display-name>
<context-param>
<param-name>overlay</param-name>
<param-value>instances/myfoo=green/web.xml</param-value>
</context-param>
<context-param>
<param-name>instance</param-name>
<param-value>instances/myfoo=green/web.xml</param-value>
</context-param>
</web-app>

View File

@ -0,0 +1,3 @@
Manifest-Version: 1.0
Created-By: 1.6.0_20 (Sun Microsystems Inc.)

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -0,0 +1 @@
instance myfoo=green WEB-INF classes

View File

@ -0,0 +1 @@
instance myfoo=green WEB-INF classes

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -0,0 +1 @@
instance myfoo=red WEB-INF classes

View File

@ -0,0 +1 @@
instance myfoo=red WEB-INF classes

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="contextPath">/red</Set>
<!--
<Set name="virtualHosts">
<Array type="String">
<Item>red.myVirtualDomain.com</Item>
</Array>
</Set>
-->
</Configure>

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<display-name>Red Test WebApp</display-name>
<context-param>
<param-name>overlay</param-name>
<param-value>instances/myfoo=red/web.xml</param-value>
</context-param>
<context-param>
<param-name>instance</param-name>
<param-value>instances/myfoo=red/web.xml</param-value>
</context-param>
</web-app>

View File

@ -0,0 +1,3 @@
Manifest-Version: 1.0
Created-By: 1.6.0_20 (Sun Microsystems Inc.)

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

@ -0,0 +1 @@
instance myfoo=red WEB-INF classes

View File

@ -0,0 +1 @@
instance myfoo=red WEB-INF classes

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure class="org.eclipse.jetty.server.handler.ContextHandler">
<!--
<Set name="virtualHosts">
<Array type="String">
<Item>red.myVirtualDomain.com</Item>
</Array>
</Set>
-->
</Configure>

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<context-param>
<param-name>overlay</param-name>
<param-value>nodes/nodeA/web.xml</param-value>
</context-param>
<context-param>
<param-name>node</param-name>
<param-value>nodes/nodeA/web.xml</param-value>
</context-param>
</web-app>

View File

@ -0,0 +1,3 @@
Manifest-Version: 1.0
Created-By: 1.6.0_20 (Sun Microsystems Inc.)

View File

@ -0,0 +1,3 @@
Manifest-Version: 1.0
Created-By: 1.6.0_20 (Sun Microsystems Inc.)

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<context-param>
<param-name>overlay</param-name>
<param-value>nodes/nodeB/web.xml</param-value>
</context-param>
<context-param>
<param-name>node</param-name>
<param-value>nodes/nodeB/web.xml</param-value>
</context-param>
</web-app>

Some files were not shown because too many files have changed in this diff Show More