Merge branch 'master' into release-9
This commit is contained in:
commit
10b6c574ae
|
@ -2,7 +2,7 @@
|
|||
protonego-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.0.0.v20140317/alpn-boot-7.0.0.v20140317.jar:lib/alpn/alpn-boot-7.0.0.v20140317.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.0.0.v20140317/alpn-boot-7.0.0.v20140317.jar|lib/alpn/alpn-boot-7.0.0.v20140317.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/alpn/alpn-boot-7.0.0.v20140317.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
protonego-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.0.0.v20140317/alpn-boot-7.0.0.v20140317.jar:lib/alpn/alpn-boot-7.0.0.v20140317.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.0.0.v20140317/alpn-boot-7.0.0.v20140317.jar|lib/alpn/alpn-boot-7.0.0.v20140317.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/alpn/alpn-boot-7.0.0.v20140317.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
protonego-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.0.0.v20140317/alpn-boot-7.0.0.v20140317.jar:lib/alpn/alpn-boot-7.0.0.v20140317.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.0.0.v20140317/alpn-boot-7.0.0.v20140317.jar|lib/alpn/alpn-boot-7.0.0.v20140317.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/alpn/alpn-boot-7.0.0.v20140317.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
protonego-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.0.0.v20140317/alpn-boot-7.0.0.v20140317.jar:lib/alpn/alpn-boot-7.0.0.v20140317.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.0.0.v20140317/alpn-boot-7.0.0.v20140317.jar|lib/alpn/alpn-boot-7.0.0.v20140317.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/alpn/alpn-boot-7.0.0.v20140317.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
protonego-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.0.0.v20140317/alpn-boot-8.0.0.v20140317.jar:lib/alpn/alpn-boot-8.0.0.v20140317.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.0.0.v20140317/alpn-boot-8.0.0.v20140317.jar|lib/alpn/alpn-boot-8.0.0.v20140317.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/alpn/alpn-boot-8.0.0.v20140317.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
protonego-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.0.0.v20140317/alpn-boot-8.0.0.v20140317.jar:lib/alpn/alpn-boot-8.0.0.v20140317.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.0.0.v20140317/alpn-boot-8.0.0.v20140317.jar|lib/alpn/alpn-boot-8.0.0.v20140317.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/alpn/alpn-boot-8.0.0.v20140317.jar
|
||||
|
|
|
@ -28,12 +28,17 @@ import org.eclipse.jetty.webapp.WebAppContext;
|
|||
*/
|
||||
public class AnnotationDecorator implements Decorator
|
||||
{
|
||||
AnnotationIntrospector _introspector = new AnnotationIntrospector();
|
||||
protected AnnotationIntrospector _introspector = new AnnotationIntrospector();
|
||||
|
||||
/**
|
||||
* @param context
|
||||
*/
|
||||
public AnnotationDecorator(WebAppContext context)
|
||||
{
|
||||
registerHandlers(context);
|
||||
}
|
||||
|
||||
public void registerHandlers (WebAppContext context)
|
||||
{
|
||||
_introspector.registerHandler(new ResourceAnnotationHandler(context));
|
||||
_introspector.registerHandler(new ResourcesAnnotationHandler(context));
|
||||
|
|
|
@ -24,13 +24,13 @@ import java.util.concurrent.atomic.AtomicInteger;
|
|||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.eclipse.jetty.server.session.AbstractSession;
|
||||
import org.eclipse.jetty.server.session.MemSession;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
public class NoSqlSession extends AbstractSession
|
||||
public class NoSqlSession extends MemSession
|
||||
{
|
||||
private final static Logger __log = Log.getLogger("org.eclipse.jetty.server.session");
|
||||
|
||||
|
|
|
@ -60,12 +60,12 @@ public class PlusDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
{
|
||||
try
|
||||
{
|
||||
registerVisitor("env-entry", getClass().getDeclaredMethod("visitEnvEntry", __signature));
|
||||
registerVisitor("resource-ref", getClass().getDeclaredMethod("visitResourceRef", __signature));
|
||||
registerVisitor("resource-env-ref", getClass().getDeclaredMethod("visitResourceEnvRef", __signature));
|
||||
registerVisitor("message-destination-ref", getClass().getDeclaredMethod("visitMessageDestinationRef", __signature));
|
||||
registerVisitor("post-construct", getClass().getDeclaredMethod("visitPostConstruct", __signature));
|
||||
registerVisitor("pre-destroy", getClass().getDeclaredMethod("visitPreDestroy", __signature));
|
||||
registerVisitor("env-entry", getClass().getMethod("visitEnvEntry", __signature));
|
||||
registerVisitor("resource-ref", getClass().getMethod("visitResourceRef", __signature));
|
||||
registerVisitor("resource-env-ref", getClass().getMethod("visitResourceEnvRef", __signature));
|
||||
registerVisitor("message-destination-ref", getClass().getMethod("visitMessageDestinationRef", __signature));
|
||||
registerVisitor("post-construct", getClass().getMethod("visitPostConstruct", __signature));
|
||||
registerVisitor("pre-destroy", getClass().getMethod("visitPreDestroy", __signature));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
|
|
@ -41,11 +41,13 @@
|
|||
<groupId>org.eclipse.jetty.tests</groupId>
|
||||
<artifactId>test-mock-resources</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.orbit</groupId>
|
||||
<artifactId>javax.mail.glassfish</artifactId>
|
||||
<version>1.4.1.v201005082020</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
|
|
|
@ -45,11 +45,11 @@ public class PreconfigureDescriptorProcessor extends IterativeDescriptorProcesso
|
|||
_showOrigin=LOG.isDebugEnabled();
|
||||
try
|
||||
{
|
||||
registerVisitor("env-entry", getClass().getDeclaredMethod("saveSnippet", __signature));
|
||||
registerVisitor("resource-ref", getClass().getDeclaredMethod("saveSnippet", __signature));
|
||||
registerVisitor("resource-env-ref", getClass().getDeclaredMethod("saveSnippet", __signature));
|
||||
registerVisitor("message-destination-ref", getClass().getDeclaredMethod("saveSnippet", __signature));
|
||||
registerVisitor("data-source", getClass().getDeclaredMethod("saveSnippet", __signature));
|
||||
registerVisitor("env-entry", getClass().getMethod("saveSnippet", __signature));
|
||||
registerVisitor("resource-ref", getClass().getMethod("saveSnippet", __signature));
|
||||
registerVisitor("resource-env-ref", getClass().getMethod("saveSnippet", __signature));
|
||||
registerVisitor("message-destination-ref", getClass().getMethod("saveSnippet", __signature));
|
||||
registerVisitor("data-source", getClass().getMethod("saveSnippet", __signature));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
|
|
@ -51,7 +51,7 @@ public class QuickStartDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
{
|
||||
try
|
||||
{
|
||||
registerVisitor("context-param", this.getClass().getDeclaredMethod("visitContextParam", __signature));
|
||||
registerVisitor("context-param", this.getClass().getMethod("visitContextParam", __signature));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
|
||||
[lib]
|
||||
resources
|
||||
resources/
|
||||
|
||||
[files]
|
||||
resources/
|
||||
|
|
|
@ -9,7 +9,7 @@ server
|
|||
etc/jetty-ssl.xml
|
||||
|
||||
[files]
|
||||
http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/plain/jetty-server/src/main/config/etc/keystore:etc/keystore
|
||||
http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/plain/jetty-server/src/main/config/etc/keystore|etc/keystore
|
||||
|
||||
[ini-template]
|
||||
## SSL Keystore Configuration
|
||||
|
|
|
@ -21,8 +21,6 @@ package org.eclipse.jetty.server.session;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -54,7 +52,6 @@ public abstract class AbstractSession implements AbstractSessionManager.SessionI
|
|||
private String _clusterId; // ID without any node (ie "worker") id appended
|
||||
private String _nodeId; // ID of session with node(ie "worker") id appended
|
||||
private final AbstractSessionManager _manager;
|
||||
private final Map<String,Object> _attributes=new HashMap<String, Object>();
|
||||
private boolean _idChanged;
|
||||
private final long _created;
|
||||
private long _cookieSet;
|
||||
|
@ -139,53 +136,21 @@ public abstract class AbstractSession implements AbstractSessionManager.SessionI
|
|||
}
|
||||
|
||||
/* ------------------------------------------------------------- */
|
||||
public Map<String,Object> getAttributeMap()
|
||||
{
|
||||
return _attributes;
|
||||
}
|
||||
public abstract Map<String,Object> getAttributeMap();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
@Override
|
||||
public Object getAttribute(String name)
|
||||
{
|
||||
synchronized (this)
|
||||
{
|
||||
checkValid();
|
||||
return _attributes.get(name);
|
||||
}
|
||||
}
|
||||
public abstract int getAttributes();
|
||||
|
||||
|
||||
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
public int getAttributes()
|
||||
{
|
||||
synchronized (this)
|
||||
{
|
||||
checkValid();
|
||||
return _attributes.size();
|
||||
}
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
@SuppressWarnings({ "unchecked" })
|
||||
@Override
|
||||
public Enumeration<String> getAttributeNames()
|
||||
{
|
||||
synchronized (this)
|
||||
{
|
||||
checkValid();
|
||||
List<String> names=_attributes==null?Collections.EMPTY_LIST:new ArrayList<String>(_attributes.keySet());
|
||||
return Collections.enumeration(names);
|
||||
}
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
public Set<String> getNames()
|
||||
{
|
||||
synchronized (this)
|
||||
{
|
||||
return new HashSet<String>(_attributes.keySet());
|
||||
}
|
||||
}
|
||||
public abstract Set<String> getNames();
|
||||
|
||||
|
||||
/* ------------------------------------------------------------- */
|
||||
public long getCookieSetTime()
|
||||
|
@ -272,25 +237,7 @@ public abstract class AbstractSession implements AbstractSessionManager.SessionI
|
|||
return getAttribute(name);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------- */
|
||||
/**
|
||||
* @deprecated As of Version 2.2, this method is replaced by
|
||||
* {@link #getAttributeNames}
|
||||
*/
|
||||
@Deprecated
|
||||
@Override
|
||||
public String[] getValueNames() throws IllegalStateException
|
||||
{
|
||||
synchronized(this)
|
||||
{
|
||||
checkValid();
|
||||
if (_attributes==null)
|
||||
return new String[0];
|
||||
String[] a=new String[_attributes.size()];
|
||||
return (String[])_attributes.keySet().toArray(a);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
public void renewId(HttpServletRequest request)
|
||||
|
@ -403,34 +350,8 @@ public abstract class AbstractSession implements AbstractSessionManager.SessionI
|
|||
}
|
||||
|
||||
/* ------------------------------------------------------------- */
|
||||
public void clearAttributes()
|
||||
{
|
||||
while (_attributes!=null && _attributes.size()>0)
|
||||
{
|
||||
ArrayList<String> keys;
|
||||
synchronized(this)
|
||||
{
|
||||
keys=new ArrayList<String>(_attributes.keySet());
|
||||
}
|
||||
|
||||
Iterator<String> iter=keys.iterator();
|
||||
while (iter.hasNext())
|
||||
{
|
||||
String key=(String)iter.next();
|
||||
|
||||
Object value;
|
||||
synchronized(this)
|
||||
{
|
||||
value=doPutOrRemove(key,null);
|
||||
}
|
||||
unbindValue(key,value);
|
||||
|
||||
_manager.doSessionAttributeListeners(this,key,value,null);
|
||||
}
|
||||
}
|
||||
if (_attributes!=null)
|
||||
_attributes.clear();
|
||||
}
|
||||
public abstract void clearAttributes();
|
||||
|
||||
|
||||
/* ------------------------------------------------------------- */
|
||||
public boolean isIdChanged()
|
||||
|
@ -476,18 +397,65 @@ public abstract class AbstractSession implements AbstractSessionManager.SessionI
|
|||
{
|
||||
removeAttribute(name);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
@SuppressWarnings({ "unchecked" })
|
||||
@Override
|
||||
public Enumeration<String> getAttributeNames()
|
||||
{
|
||||
synchronized (this)
|
||||
{
|
||||
checkValid();
|
||||
return doGetAttributeNames();
|
||||
}
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------- */
|
||||
/**
|
||||
* @deprecated As of Version 2.2, this method is replaced by
|
||||
* {@link #getAttributeNames}
|
||||
*/
|
||||
@Deprecated
|
||||
@Override
|
||||
public String[] getValueNames() throws IllegalStateException
|
||||
{
|
||||
synchronized(this)
|
||||
{
|
||||
checkValid();
|
||||
Enumeration<String> anames = doGetAttributeNames();
|
||||
if (anames == null)
|
||||
return new String[0];
|
||||
ArrayList<String> names = new ArrayList<String>();
|
||||
while (anames.hasMoreElements())
|
||||
names.add(anames.nextElement());
|
||||
return names.toArray(new String[names.size()]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
protected Object doPutOrRemove(String name, Object value)
|
||||
{
|
||||
return value==null?_attributes.remove(name):_attributes.put(name,value);
|
||||
}
|
||||
public abstract Object doPutOrRemove(String name, Object value);
|
||||
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
protected Object doGet(String name)
|
||||
public abstract Object doGet(String name);
|
||||
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
public abstract Enumeration<String> doGetAttributeNames();
|
||||
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
@Override
|
||||
public Object getAttribute(String name)
|
||||
{
|
||||
return _attributes.get(name);
|
||||
synchronized (this)
|
||||
{
|
||||
checkValid();
|
||||
return doGet(name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
@Override
|
||||
|
@ -571,12 +539,7 @@ public abstract class AbstractSession implements AbstractSessionManager.SessionI
|
|||
_manager.doSessionAttributeListeners(this,name,oldValue,newValue);
|
||||
}
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
protected void addAttributes(Map<String,Object> map)
|
||||
{
|
||||
_attributes.putAll(map);
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------------------- */
|
||||
public void setIdChanged(boolean changed)
|
||||
|
@ -653,7 +616,7 @@ public abstract class AbstractSession implements AbstractSessionManager.SessionI
|
|||
synchronized(this)
|
||||
{
|
||||
HttpSessionEvent event = new HttpSessionEvent(this);
|
||||
for (Iterator<Object> iter = _attributes.values().iterator(); iter.hasNext();)
|
||||
for (Iterator<Object> iter = getAttributeMap().values().iterator(); iter.hasNext();)
|
||||
{
|
||||
Object value = iter.next();
|
||||
if (value instanceof HttpSessionActivationListener)
|
||||
|
@ -671,7 +634,7 @@ public abstract class AbstractSession implements AbstractSessionManager.SessionI
|
|||
synchronized(this)
|
||||
{
|
||||
HttpSessionEvent event = new HttpSessionEvent(this);
|
||||
for (Iterator<Object> iter = _attributes.values().iterator(); iter.hasNext();)
|
||||
for (Iterator<Object> iter = getAttributeMap().values().iterator(); iter.hasNext();)
|
||||
{
|
||||
Object value = iter.next();
|
||||
if (value instanceof HttpSessionActivationListener)
|
||||
|
|
|
@ -34,7 +34,7 @@ import org.eclipse.jetty.util.IO;
|
|||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
public class HashedSession extends AbstractSession
|
||||
public class HashedSession extends MemSession
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(HashedSession.class);
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ public class JDBCSessionManager extends AbstractSessionManager
|
|||
*
|
||||
* Session instance.
|
||||
*/
|
||||
public class Session extends AbstractSession
|
||||
public class Session extends MemSession
|
||||
{
|
||||
private static final long serialVersionUID = 5208464051134226143L;
|
||||
|
||||
|
|
|
@ -0,0 +1,146 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2014 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.server.session;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
|
||||
/**
|
||||
* MemSession
|
||||
*
|
||||
* A session whose data is kept in memory
|
||||
*/
|
||||
public class MemSession extends AbstractSession
|
||||
{
|
||||
|
||||
private final Map<String,Object> _attributes=new HashMap<String, Object>();
|
||||
|
||||
protected MemSession(AbstractSessionManager abstractSessionManager, HttpServletRequest request)
|
||||
{
|
||||
super(abstractSessionManager, request);
|
||||
}
|
||||
|
||||
public MemSession(AbstractSessionManager abstractSessionManager, long created, long accessed, String clusterId)
|
||||
{
|
||||
super(abstractSessionManager, created, accessed, clusterId);
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------------------- */
|
||||
@Override
|
||||
public Map<String,Object> getAttributeMap()
|
||||
{
|
||||
return _attributes;
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
@Override
|
||||
public int getAttributes()
|
||||
{
|
||||
synchronized (this)
|
||||
{
|
||||
checkValid();
|
||||
return _attributes.size();
|
||||
}
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
@SuppressWarnings({ "unchecked" })
|
||||
@Override
|
||||
public Enumeration<String> doGetAttributeNames()
|
||||
{
|
||||
List<String> names=_attributes==null?Collections.EMPTY_LIST:new ArrayList<String>(_attributes.keySet());
|
||||
return Collections.enumeration(names);
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
@Override
|
||||
public Set<String> getNames()
|
||||
{
|
||||
synchronized (this)
|
||||
{
|
||||
return new HashSet<String>(_attributes.keySet());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------------------- */
|
||||
@Override
|
||||
public void clearAttributes()
|
||||
{
|
||||
while (_attributes!=null && _attributes.size()>0)
|
||||
{
|
||||
ArrayList<String> keys;
|
||||
synchronized(this)
|
||||
{
|
||||
keys=new ArrayList<String>(_attributes.keySet());
|
||||
}
|
||||
|
||||
Iterator<String> iter=keys.iterator();
|
||||
while (iter.hasNext())
|
||||
{
|
||||
String key=(String)iter.next();
|
||||
|
||||
Object value;
|
||||
synchronized(this)
|
||||
{
|
||||
value=doPutOrRemove(key,null);
|
||||
}
|
||||
unbindValue(key,value);
|
||||
|
||||
((AbstractSessionManager)getSessionManager()).doSessionAttributeListeners(this,key,value,null);
|
||||
}
|
||||
}
|
||||
if (_attributes!=null)
|
||||
_attributes.clear();
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
public void addAttributes(Map<String,Object> map)
|
||||
{
|
||||
_attributes.putAll(map);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
@Override
|
||||
public Object doPutOrRemove(String name, Object value)
|
||||
{
|
||||
return value==null?_attributes.remove(name):_attributes.put(name,value);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
@Override
|
||||
public Object doGet(String name)
|
||||
{
|
||||
return _attributes.get(name);
|
||||
}
|
||||
|
||||
}
|
|
@ -21,6 +21,10 @@ package org.eclipse.jetty.server.session;
|
|||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Enumeration;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.servlet.SessionCookieConfig;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
@ -50,6 +54,96 @@ public class SessionCookieTest
|
|||
super(abstractSessionManager, created, accessed, clusterId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see javax.servlet.http.HttpSession#getAttribute(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Object getAttribute(String name)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see javax.servlet.http.HttpSession#getAttributeNames()
|
||||
*/
|
||||
@Override
|
||||
public Enumeration<String> getAttributeNames()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see javax.servlet.http.HttpSession#getValueNames()
|
||||
*/
|
||||
@Override
|
||||
public String[] getValueNames()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.jetty.server.session.AbstractSession#getAttributeMap()
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> getAttributeMap()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.jetty.server.session.AbstractSession#getAttributes()
|
||||
*/
|
||||
@Override
|
||||
public int getAttributes()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.jetty.server.session.AbstractSession#getNames()
|
||||
*/
|
||||
@Override
|
||||
public Set<String> getNames()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.jetty.server.session.AbstractSession#clearAttributes()
|
||||
*/
|
||||
@Override
|
||||
public void clearAttributes()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.jetty.server.session.AbstractSession#doPutOrRemove(java.lang.String, java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public Object doPutOrRemove(String name, Object value)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.jetty.server.session.AbstractSession#doGet(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Object doGet(String name)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.jetty.server.session.AbstractSession#doGetAttributeNames()
|
||||
*/
|
||||
@Override
|
||||
public Enumeration<String> doGetAttributeNames()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class MockSessionIdManager extends AbstractSessionIdManager
|
||||
|
|
|
@ -38,7 +38,9 @@ import javax.servlet.http.HttpServletRequest;
|
|||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.eclipse.jetty.http.HttpContent;
|
||||
import org.eclipse.jetty.http.HttpField;
|
||||
import org.eclipse.jetty.http.HttpFields;
|
||||
import org.eclipse.jetty.http.HttpGenerator.CachedHttpField;
|
||||
import org.eclipse.jetty.http.HttpHeader;
|
||||
import org.eclipse.jetty.http.HttpMethod;
|
||||
import org.eclipse.jetty.http.MimeTypes;
|
||||
|
@ -136,6 +138,9 @@ public class DefaultServlet extends HttpServlet implements ResourceFactory
|
|||
private static final Logger LOG = Log.getLogger(DefaultServlet.class);
|
||||
|
||||
private static final long serialVersionUID = 4930458713846881193L;
|
||||
|
||||
private static final CachedHttpField ACCEPT_RANGES = new CachedHttpField(HttpHeader.ACCEPT_RANGES, "bytes");
|
||||
|
||||
private ServletContext _servletContext;
|
||||
private ContextHandler _contextHandler;
|
||||
|
||||
|
@ -155,7 +160,7 @@ public class DefaultServlet extends HttpServlet implements ResourceFactory
|
|||
private String[] _welcomes;
|
||||
private Resource _stylesheet;
|
||||
private boolean _useFileMappedBuffer=false;
|
||||
private String _cacheControl;
|
||||
private HttpField _cacheControl;
|
||||
private String _relativeResourceBase;
|
||||
private ServletHandler _servletHandler;
|
||||
private ServletHolder _defaultHolder;
|
||||
|
@ -228,8 +233,10 @@ public class DefaultServlet extends HttpServlet implements ResourceFactory
|
|||
LOG.debug(e);
|
||||
}
|
||||
|
||||
_cacheControl=getInitParameter("cacheControl");
|
||||
|
||||
String cc=getInitParameter("cacheControl");
|
||||
if (cc!=null)
|
||||
_cacheControl=new CachedHttpField(HttpHeader.CACHE_CONTROL, cc);
|
||||
|
||||
String resourceCache = getInitParameter("resourceCache");
|
||||
int max_cache_size=getInitInt("maxCacheSize", -2);
|
||||
int max_cached_file_size=getInitInt("maxCachedFileSize", -2);
|
||||
|
@ -1062,10 +1069,10 @@ public class DefaultServlet extends HttpServlet implements ResourceFactory
|
|||
protected void writeOptionHeaders(HttpFields fields)
|
||||
{
|
||||
if (_acceptRanges)
|
||||
fields.put(HttpHeader.ACCEPT_RANGES,"bytes");
|
||||
fields.put(ACCEPT_RANGES);
|
||||
|
||||
if (_cacheControl!=null)
|
||||
fields.put(HttpHeader.CACHE_CONTROL,_cacheControl);
|
||||
fields.put(_cacheControl);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
|
@ -1075,7 +1082,7 @@ public class DefaultServlet extends HttpServlet implements ResourceFactory
|
|||
response.setHeader(HttpHeader.ACCEPT_RANGES.asString(),"bytes");
|
||||
|
||||
if (_cacheControl!=null)
|
||||
response.setHeader(HttpHeader.CACHE_CONTROL.asString(),_cacheControl);
|
||||
response.setHeader(HttpHeader.CACHE_CONTROL.asString(),_cacheControl.getValue());
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
|
|
|
@ -373,16 +373,14 @@ public abstract class AbstractCompressedStream extends ServletOutputStream
|
|||
@Override
|
||||
public void setWriteListener(WriteListener writeListener)
|
||||
{
|
||||
// TODO 3.1 Auto-generated method stub
|
||||
|
||||
throw new UnsupportedOperationException("Use AsyncGzipFilter");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isReady()
|
||||
{
|
||||
// TODO 3.1 Auto-generated method stub
|
||||
return false;
|
||||
throw new UnsupportedOperationException("Use AsyncGzipFilter");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
protonego-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.0.v20120525/npn-boot-1.1.0.v20120525.jar:lib/npn/npn-boot-1.1.0.v20120525.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.0.v20120525/npn-boot-1.1.0.v20120525.jar|lib/npn/npn-boot-1.1.0.v20120525.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.0.v20120525.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
protonego-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.0.v20120525/npn-boot-1.1.0.v20120525.jar:lib/npn/npn-boot-1.1.0.v20120525.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.0.v20120525/npn-boot-1.1.0.v20120525.jar|lib/npn/npn-boot-1.1.0.v20120525.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.0.v20120525.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
protonego-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.1.v20121030/npn-boot-1.1.1.v20121030.jar:lib/npn/npn-boot-1.1.1.v20121030.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.1.v20121030/npn-boot-1.1.1.v20121030.jar|lib/npn/npn-boot-1.1.1.v20121030.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.1.v20121030.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
protonego-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.1.v20121030/npn-boot-1.1.1.v20121030.jar:lib/npn/npn-boot-1.1.1.v20121030.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.1.v20121030/npn-boot-1.1.1.v20121030.jar|lib/npn/npn-boot-1.1.1.v20121030.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.1.v20121030.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
protonego-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar:lib/npn/npn-boot-1.1.3.v20130313.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar|lib/npn/npn-boot-1.1.3.v20130313.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.3.v20130313.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
protonego-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar:lib/npn/npn-boot-1.1.3.v20130313.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar|lib/npn/npn-boot-1.1.3.v20130313.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.3.v20130313.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
protonego-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar:lib/npn/npn-boot-1.1.3.v20130313.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar|lib/npn/npn-boot-1.1.3.v20130313.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.3.v20130313.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
protonego-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.4.v20130313/npn-boot-1.1.4.v20130313.jar:lib/npn/npn-boot-1.1.4.v20130313.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.4.v20130313/npn-boot-1.1.4.v20130313.jar|lib/npn/npn-boot-1.1.4.v20130313.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.4.v20130313.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
protonego-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar:lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar|lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
protonego-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar:lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar|lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
protonego-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar:lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar|lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
protonego-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar:lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar|lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
protonego-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar:lib/npn/npn-boot-1.1.6.v20130911.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar|lib/npn/npn-boot-1.1.6.v20130911.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.6.v20130911.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
protonego-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar:lib/npn/npn-boot-1.1.6.v20130911.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar|lib/npn/npn-boot-1.1.6.v20130911.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.6.v20130911.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
protonego-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar:lib/npn/npn-boot-1.1.6.v20130911.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar|lib/npn/npn-boot-1.1.6.v20130911.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.6.v20130911.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
protonego-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.7.v20140316/npn-boot-1.1.7.v20140316.jar:lib/npn/npn-boot-1.1.7.v20140316.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.7.v20140316/npn-boot-1.1.7.v20140316.jar|lib/npn/npn-boot-1.1.7.v20140316.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.7.v20140316.jar
|
||||
|
|
|
@ -23,21 +23,25 @@ public class FileArg
|
|||
public String uri;
|
||||
public String location;
|
||||
|
||||
public FileArg(String uriLocation)
|
||||
public FileArg(final String uriLocation)
|
||||
{
|
||||
String parts[] = uriLocation.split(":",3);
|
||||
if (parts.length == 3)
|
||||
String parts[] = uriLocation.split("\\|",3);
|
||||
if (parts.length > 2)
|
||||
{
|
||||
if (!"http".equalsIgnoreCase(parts[0]))
|
||||
{
|
||||
throw new IllegalArgumentException("Download only supports http protocol");
|
||||
}
|
||||
if (!parts[1].startsWith("//"))
|
||||
{
|
||||
throw new IllegalArgumentException("Download URI invalid: " + uriLocation);
|
||||
}
|
||||
this.uri = String.format("%s:%s",parts[0],parts[1]);
|
||||
this.location = parts[2];
|
||||
StringBuilder err = new StringBuilder();
|
||||
final String LN = System.lineSeparator();
|
||||
err.append("Unrecognized [file] argument: ").append(uriLocation);
|
||||
err.append(LN).append("Valid Syntaxes: ");
|
||||
err.append(LN).append(" <relative-path> - eg: resources/");
|
||||
err.append(LN).append(" or <absolute-path> - eg: /var/run/jetty.pid");
|
||||
err.append(LN).append(" or <uri>|<relative-path> - eg: http://machine/my.conf|resources/my.conf");
|
||||
err.append(LN).append(" or <uri>|<absolute-path> - eg: http://machine/glob.dat|/opt/run/glob.dat");
|
||||
throw new IllegalArgumentException(err.toString());
|
||||
}
|
||||
if (parts.length == 2)
|
||||
{
|
||||
this.uri = parts[0];
|
||||
this.location = parts[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -375,15 +375,15 @@ public class Main
|
|||
// Find any named ini file and check it follows the convention
|
||||
Path start_ini = baseHome.getBasePath("start.ini");
|
||||
String short_start_ini = baseHome.toShortForm(start_ini);
|
||||
Path ini = start_d.resolve(name + ".ini");
|
||||
String short_ini = baseHome.toShortForm(ini);
|
||||
Path startd_ini = start_d.resolve(name + ".ini");
|
||||
String short_startd_ini = baseHome.toShortForm(startd_ini);
|
||||
StartIni module_ini = null;
|
||||
if (FS.exists(ini))
|
||||
if (FS.exists(startd_ini))
|
||||
{
|
||||
module_ini = new StartIni(ini);
|
||||
module_ini = new StartIni(startd_ini);
|
||||
if (module_ini.getLineMatches(Pattern.compile("--module=(.*, *)*" + name)).size() == 0)
|
||||
{
|
||||
StartLog.warn("ERROR: %s is not enabled in %s!",name,short_ini);
|
||||
StartLog.warn("ERROR: %s is not enabled in %s!",name,short_startd_ini);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -392,7 +392,7 @@ public class Main
|
|||
boolean has_ini_lines = module.getInitialise().size() > 0;
|
||||
|
||||
// If it is not enabled or is transitive with ini template lines or toplevel and doesn't exist
|
||||
if (!module.isEnabled() || (transitive && has_ini_lines) || (topLevel && !FS.exists(ini) && !appendStartIni))
|
||||
if (!module.isEnabled() || (transitive && has_ini_lines) || (topLevel && !FS.exists(startd_ini) && !appendStartIni))
|
||||
{
|
||||
// File BufferedWriter
|
||||
BufferedWriter writer = null;
|
||||
|
@ -412,9 +412,9 @@ public class Main
|
|||
// Create the directory if needed
|
||||
FS.ensureDirectoryExists(start_d);
|
||||
FS.ensureDirectoryWritable(start_d);
|
||||
source = short_ini;
|
||||
source = short_startd_ini;
|
||||
StartLog.info("%-15s initialised in %s (created)",name,source);
|
||||
writer = Files.newBufferedWriter(ini,StandardCharsets.UTF_8,StandardOpenOption.CREATE_NEW,StandardOpenOption.WRITE);
|
||||
writer = Files.newBufferedWriter(startd_ini,StandardCharsets.UTF_8,StandardOpenOption.CREATE_NEW,StandardOpenOption.WRITE);
|
||||
out = new PrintWriter(writer);
|
||||
}
|
||||
|
||||
|
@ -463,9 +463,9 @@ public class Main
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (FS.exists(ini))
|
||||
else if (FS.exists(startd_ini))
|
||||
{
|
||||
StartLog.info("%-15s initialised in %s",name,short_ini);
|
||||
StartLog.info("%-15s initialised in %s",name,short_startd_ini);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -475,7 +475,8 @@ public class Main
|
|||
// Also list other places this module is enabled
|
||||
for (String source : module.getSources())
|
||||
{
|
||||
if (!short_ini.equals(source))
|
||||
StartLog.debug("also enabled in: %s",source);
|
||||
if (!short_start_ini.equals(source))
|
||||
{
|
||||
StartLog.info("%-15s enabled in %s",name,baseHome.toShortForm(source));
|
||||
}
|
||||
|
|
|
@ -23,12 +23,12 @@ import static org.eclipse.jetty.start.UsageException.*;
|
|||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.Stack;
|
||||
import java.util.TreeMap;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
|
@ -98,7 +98,7 @@ public final class Props implements Iterable<Prop>
|
|||
return l;
|
||||
}
|
||||
|
||||
private Map<String, Prop> props = new HashMap<>();
|
||||
private Map<String, Prop> props = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
|
||||
private List<String> sysPropTracking = new ArrayList<>();
|
||||
|
||||
public void addAll(Props other)
|
||||
|
@ -114,7 +114,7 @@ public final class Props implements Iterable<Prop>
|
|||
* @param arg the argument to parse for a potential property
|
||||
* @param source the source for this argument (to track origin of property from)
|
||||
*/
|
||||
public void addPossibleProperty(String arg, String source)
|
||||
public boolean addPossibleProperty(String arg, String source)
|
||||
{
|
||||
// Start property (syntax similar to System property)
|
||||
if (arg.startsWith("-D"))
|
||||
|
@ -125,15 +125,14 @@ public final class Props implements Iterable<Prop>
|
|||
case 2:
|
||||
setSystemProperty(assign[0],assign[1]);
|
||||
setProperty(assign[0],assign[1],source);
|
||||
break;
|
||||
return true;
|
||||
case 1:
|
||||
setSystemProperty(assign[0],"");
|
||||
setProperty(assign[0],"",source);
|
||||
break;
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
return false;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Is this a raw property declaration?
|
||||
|
@ -144,10 +143,11 @@ public final class Props implements Iterable<Prop>
|
|||
String value = arg.substring(idx + 1);
|
||||
|
||||
setProperty(key,value,source);
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
// All other strings are ignored
|
||||
return false;
|
||||
}
|
||||
|
||||
public String cleanReference(String property)
|
||||
|
|
|
@ -0,0 +1,97 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2014 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.start;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.jetty.start.RawArgs.Entry;
|
||||
|
||||
public class RawArgs implements Iterable<Entry>
|
||||
{
|
||||
public class Entry
|
||||
{
|
||||
private String line;
|
||||
private String origin;
|
||||
|
||||
private Entry(String line, String origin)
|
||||
{
|
||||
this.line = line;
|
||||
this.origin = origin;
|
||||
}
|
||||
|
||||
public String getLine()
|
||||
{
|
||||
return line;
|
||||
}
|
||||
|
||||
public String getOrigin()
|
||||
{
|
||||
return origin;
|
||||
}
|
||||
|
||||
public boolean startsWith(String val)
|
||||
{
|
||||
return line.startsWith(val);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* All of the args, in argument order
|
||||
*/
|
||||
private List<Entry> args = new ArrayList<>();
|
||||
|
||||
public void addAll(List<String> lines, Path sourceFile)
|
||||
{
|
||||
String source = sourceFile.toAbsolutePath().toString();
|
||||
for (String line : lines)
|
||||
{
|
||||
addArg(line,source);
|
||||
}
|
||||
}
|
||||
|
||||
public void addArg(final String rawline, final String source)
|
||||
{
|
||||
if (rawline == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
String line = rawline.trim();
|
||||
if (line.length() == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
args.add(new Entry(line,source));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<Entry> iterator()
|
||||
{
|
||||
return args.iterator();
|
||||
}
|
||||
|
||||
public int size()
|
||||
{
|
||||
return args.size();
|
||||
}
|
||||
}
|
|
@ -639,9 +639,9 @@ public class StartArgs
|
|||
while (iter.hasPrevious())
|
||||
{
|
||||
ConfigSource source = iter.previous();
|
||||
for (String arg : source.getArgs())
|
||||
for (RawArgs.Entry arg : source.getArgs())
|
||||
{
|
||||
parse(arg,source.getId());
|
||||
parse(arg.getLine(),arg.getOrigin());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -96,9 +96,9 @@ public class StartLog
|
|||
|
||||
String logFileName = cmdLineSource.getProperty("start-log-file");
|
||||
|
||||
for (String arg : cmdLineSource.getArgs())
|
||||
for (RawArgs.Entry arg : cmdLineSource.getArgs())
|
||||
{
|
||||
if ("--debug".equals(arg))
|
||||
if ("--debug".equals(arg.getLine()))
|
||||
{
|
||||
debug = true;
|
||||
continue;
|
||||
|
@ -106,14 +106,14 @@ public class StartLog
|
|||
|
||||
if (arg.startsWith("--start-log-file"))
|
||||
{
|
||||
logFileName = Props.getValue(arg);
|
||||
logFileName = Props.getValue(arg.getLine());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (logFileName != null)
|
||||
{
|
||||
Path logfile = baseHome.getBasePath(logFileName);
|
||||
Path logfile = baseHome.getPath(logFileName);
|
||||
initLogFile(logfile);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,8 +23,6 @@ import java.net.URI;
|
|||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
|
@ -32,6 +30,7 @@ import org.eclipse.jetty.start.BaseHome;
|
|||
import org.eclipse.jetty.start.FS;
|
||||
import org.eclipse.jetty.start.Props;
|
||||
import org.eclipse.jetty.start.Props.Prop;
|
||||
import org.eclipse.jetty.start.RawArgs;
|
||||
import org.eclipse.jetty.start.UsageException;
|
||||
|
||||
/**
|
||||
|
@ -42,17 +41,18 @@ public class CommandLineConfigSource implements ConfigSource
|
|||
public static final String ORIGIN_INTERNAL_FALLBACK = "<internal-fallback>";
|
||||
public static final String ORIGIN_CMD_LINE = "<command-line>";
|
||||
|
||||
private final List<String> args;
|
||||
private final RawArgs args;
|
||||
private final Props props;
|
||||
private final Path homePath;
|
||||
private final Path basePath;
|
||||
|
||||
public CommandLineConfigSource(String rawargs[])
|
||||
{
|
||||
this.args = Arrays.asList(rawargs);
|
||||
this.args = new RawArgs();
|
||||
this.props = new Props();
|
||||
for (String arg : args)
|
||||
for (String arg : rawargs)
|
||||
{
|
||||
this.args.addArg(arg,ORIGIN_CMD_LINE);
|
||||
this.props.addPossibleProperty(arg,ORIGIN_CMD_LINE);
|
||||
}
|
||||
|
||||
|
@ -179,7 +179,7 @@ public class CommandLineConfigSource implements ConfigSource
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<String> getArgs()
|
||||
public RawArgs getArgs()
|
||||
{
|
||||
return args;
|
||||
}
|
||||
|
|
|
@ -18,9 +18,8 @@
|
|||
|
||||
package org.eclipse.jetty.start.config;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.jetty.start.Props;
|
||||
import org.eclipse.jetty.start.RawArgs;
|
||||
|
||||
/**
|
||||
* A Configuration Source
|
||||
|
@ -57,7 +56,7 @@ public interface ConfigSource
|
|||
*
|
||||
* @return the list of Arguments for this ConfigSource
|
||||
*/
|
||||
public List<String> getArgs();
|
||||
public RawArgs getArgs();
|
||||
|
||||
/**
|
||||
* The properties for this ConfigSource
|
||||
|
|
|
@ -31,6 +31,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
|||
|
||||
import org.eclipse.jetty.start.FS;
|
||||
import org.eclipse.jetty.start.Props;
|
||||
import org.eclipse.jetty.start.RawArgs;
|
||||
import org.eclipse.jetty.start.Props.Prop;
|
||||
import org.eclipse.jetty.start.UsageException;
|
||||
|
||||
|
@ -67,11 +68,11 @@ public class ConfigSources implements Iterable<ConfigSource>
|
|||
updateProps();
|
||||
|
||||
// look for --include-jetty-dir entries
|
||||
for (String arg : source.getArgs())
|
||||
for (RawArgs.Entry arg : source.getArgs())
|
||||
{
|
||||
if (arg.startsWith("--include-jetty-dir"))
|
||||
{
|
||||
String ref = getValue(arg);
|
||||
String ref = getValue(arg.getLine());
|
||||
String dirName = props.expand(ref);
|
||||
Path dir = FS.toPath(dirName);
|
||||
DirConfigSource dirsource = new DirConfigSource(ref,dir,sourceWeight.incrementAndGet(),true);
|
||||
|
|
|
@ -33,6 +33,7 @@ import org.eclipse.jetty.start.FS;
|
|||
import org.eclipse.jetty.start.NaturalSort;
|
||||
import org.eclipse.jetty.start.PathMatchers;
|
||||
import org.eclipse.jetty.start.Props;
|
||||
import org.eclipse.jetty.start.RawArgs;
|
||||
import org.eclipse.jetty.start.UsageException;
|
||||
import org.eclipse.jetty.start.Props.Prop;
|
||||
import org.eclipse.jetty.start.StartIni;
|
||||
|
@ -71,7 +72,7 @@ public class DirConfigSource implements ConfigSource
|
|||
private final String id;
|
||||
private final Path dir;
|
||||
private final int weight;
|
||||
private final List<String> args;
|
||||
private final RawArgs args;
|
||||
private final Props props;
|
||||
|
||||
/**
|
||||
|
@ -95,7 +96,7 @@ public class DirConfigSource implements ConfigSource
|
|||
this.weight = weight;
|
||||
this.props = new Props();
|
||||
|
||||
this.args = new ArrayList<>();
|
||||
this.args = new RawArgs();
|
||||
|
||||
if (canHaveArgs)
|
||||
{
|
||||
|
@ -103,7 +104,7 @@ public class DirConfigSource implements ConfigSource
|
|||
if (FS.canReadFile(iniFile))
|
||||
{
|
||||
StartIni ini = new StartIni(iniFile);
|
||||
args.addAll(ini.getLines());
|
||||
args.addAll(ini.getLines(),iniFile);
|
||||
parseAllArgs(ini.getLines(),iniFile.toString());
|
||||
}
|
||||
|
||||
|
@ -138,7 +139,7 @@ public class DirConfigSource implements ConfigSource
|
|||
{
|
||||
StartLog.debug("Reading %s/start.d/%s - %s",id,diniFile.getFileName(),diniFile);
|
||||
StartIni ini = new StartIni(diniFile);
|
||||
args.addAll(ini.getLines());
|
||||
args.addAll(ini.getLines(),diniFile);
|
||||
parseAllArgs(ini.getLines(),diniFile.toString());
|
||||
}
|
||||
}
|
||||
|
@ -194,7 +195,7 @@ public class DirConfigSource implements ConfigSource
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<String> getArgs()
|
||||
public RawArgs getArgs()
|
||||
{
|
||||
return args;
|
||||
}
|
||||
|
|
|
@ -98,6 +98,7 @@ Module Management:
|
|||
modules. This may download a file from the network if the
|
||||
module provides a URL.
|
||||
|
||||
|
||||
Startup / Shutdown Command Line:
|
||||
--------------------------------
|
||||
|
||||
|
@ -120,44 +121,26 @@ Properties:
|
|||
Jetty server has stopped. If not specified, the stopper will wait
|
||||
indefinitely. Use in conjunction with the --stop option.
|
||||
|
||||
|
||||
Advanced Commands:
|
||||
------------------
|
||||
|
||||
--download=<http-uri>:<location>
|
||||
Advanced usage, If the file does not exist at the given
|
||||
location, download it from the given http URI.
|
||||
Note: location is always relative to ${jetty.base}
|
||||
|
||||
--lib=<classpath>
|
||||
Add arbitrary classpath entries to the the server classpath.
|
||||
|
||||
--include-jetty-dir=<path>
|
||||
Include an extra jetty directory to use as a source
|
||||
for configuration details. This directory behaves similarly
|
||||
to ${jetty.base} but sits at a layer between ${jetty.base}
|
||||
and ${jetty.home}. This allows for some complex hierarchies
|
||||
of configuration details.
|
||||
|
||||
System Properties:
|
||||
------------------
|
||||
|
||||
These are set with a command line like "java -Dname=value ..." and are
|
||||
accessible via the java.lang.System#getProperty(String) API.
|
||||
Some key system properties are:
|
||||
|
||||
org.eclipse.jetty.util.log.class=[class]
|
||||
A Low Level Jetty Logger Implementation to use
|
||||
(default: org.eclipse.jetty.util.log.Slf4jLog)
|
||||
|
||||
[name|hierarchy].LEVEL=[loglevel]
|
||||
Change loglevel for the stderr and javautil Loggers. Slf4j
|
||||
and other loggers must be separately configured for debug.
|
||||
For example: Dorg.eclipse.jetty.LEVEL=DEBUG
|
||||
(default: INFO)
|
||||
|
||||
org.eclipse.jetty.util.log.IGNORED=[boolean]
|
||||
Ignored exceptions are logged, independent of DEBUG settings
|
||||
(default: false)
|
||||
|
||||
org.eclipse.jetty.util.log.SOURCE=[boolean]
|
||||
The source location of logs is logged in the stderr Logger.
|
||||
(default: false)
|
||||
|
||||
com.sun.management.jmxremote
|
||||
Enable remote JMX management in Sun JVMS.
|
||||
--download=<http-uri>|<location>
|
||||
Advanced usage, If the file does not exist at the given
|
||||
location, download it from the given http URI.
|
||||
Notes: location is always relative to ${jetty.base}.
|
||||
you might need to escape the slash "\|" to use
|
||||
this on some environments.
|
||||
|
||||
|
||||
Properties:
|
||||
|
@ -180,6 +163,18 @@ Properties:
|
|||
Defaults:
|
||||
---------
|
||||
|
||||
A ${jetty.base}/start.ini file and/or ${jetty.base|/start.d/*.ini files may be
|
||||
used to specify default arguments to start.jar. In case of a conflict between
|
||||
the command line, and ini files, the command line will win.
|
||||
Command line arguments can come from any jetty configuration directory
|
||||
(except ${jetty.home}), such as ${jetty.base} and any added jetty directories
|
||||
(see --include-jetty-dir=<path>).
|
||||
The contents of <path>/start.ini and <path>/start.d/*.ini are all used
|
||||
to build up your command line arguments.
|
||||
In case of a conflict, the resolution of who wins, will look like this.
|
||||
|
||||
1) <command-line itself>
|
||||
2) ${jetty.base}/start.ini
|
||||
3) ${jetty.base}/start.d/*.ini
|
||||
4) <jetty-dir>/start.ini
|
||||
5) <jetty-dir>/start.d/*.ini
|
||||
|
||||
For more information on startup, see the online documentation at
|
||||
http://www.eclipse.org/jetty/documentation/
|
||||
|
|
|
@ -124,7 +124,7 @@ public class ConfigurationAssert
|
|||
{
|
||||
if (darg.uri != null)
|
||||
{
|
||||
actualDownloads.add(String.format("%s:%s",darg.uri,darg.location));
|
||||
actualDownloads.add(String.format("%s|%s",darg.uri,darg.location));
|
||||
}
|
||||
}
|
||||
assertContainsUnordered("Downloads",expectedDownloads,actualDownloads);
|
||||
|
|
|
@ -0,0 +1,100 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2014 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.start;
|
||||
|
||||
import static org.hamcrest.Matchers.*;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
import org.junit.runners.Parameterized.Parameter;
|
||||
import org.junit.runners.Parameterized.Parameters;
|
||||
|
||||
@RunWith(Parameterized.class)
|
||||
public class FileArgTest
|
||||
{
|
||||
@SuppressWarnings("serial")
|
||||
private static class UseCases extends ArrayList<String[]>
|
||||
{
|
||||
public void add(String rawfileref, String expectedUri, String expectedLocation)
|
||||
{
|
||||
this.add(new String[] { rawfileref, expectedUri, expectedLocation });
|
||||
}
|
||||
}
|
||||
|
||||
@Parameters(name = "{0}")
|
||||
public static List<String[]> data()
|
||||
{
|
||||
UseCases data = new UseCases();
|
||||
data.add("resource",null,"resource");
|
||||
data.add("lib/logging",null,"lib/logging");
|
||||
|
||||
// -- URI with relative location --
|
||||
data.add("http://machine.com/my.conf|resources/my.conf","http://machine.com/my.conf","resources/my.conf");
|
||||
data.add("http://machine.com:8080/my.conf|resources/my.conf","http://machine.com:8080/my.conf","resources/my.conf");
|
||||
data.add("https://machine.com:8080/my.conf|resources/my.conf","https://machine.com:8080/my.conf","resources/my.conf");
|
||||
// Windows URI (drive mapped)
|
||||
data.add("file:///Z:/share/my.conf|resources/my.conf","file:///Z:/share/my.conf","resources/my.conf");
|
||||
// Windows URI (network share)
|
||||
data.add("file:////nas/share/my.conf|resources/my.conf","file:////nas/share/my.conf","resources/my.conf");
|
||||
|
||||
// -- URI with absolute location --
|
||||
data.add("http://machine.com/db.dat|/var/run/db.dat","http://machine.com/db.dat","/var/run/db.dat");
|
||||
data.add("http://machine.com:8080/b/db.dat|/var/run/db.dat","http://machine.com:8080/b/db.dat","/var/run/db.dat");
|
||||
data.add("https://machine.com:8080/c/db.dat|/var/run/db.dat","https://machine.com:8080/c/db.dat","/var/run/db.dat");
|
||||
// Windows URI (drive mapped) to drive mapped output
|
||||
data.add("file:///Z:/share/my.conf|C:/db/db.dat","file:///Z:/share/my.conf","C:/db/db.dat");
|
||||
data.add("file:///Z:/share/my.conf|C:\\db\\db.dat","file:///Z:/share/my.conf","C:\\db\\db.dat");
|
||||
// Windows URI (drive mapped) to network share output
|
||||
data.add("file:///Z:/share/my.conf|\\\\nas\\apps\\db\\db.dat","file:///Z:/share/my.conf","\\\\nas\\apps\\db\\db.dat");
|
||||
// Windows URI (network share) to drive mapped output
|
||||
data.add("file:////nas/share/my.conf|C:/db/db.dat","file:////nas/share/my.conf","C:/db/db.dat");
|
||||
data.add("file:////nas/share/my.conf|C:\\db\\db.dat","file:////nas/share/my.conf","C:\\db\\db.dat");
|
||||
// Windows URI (network share) to network share output
|
||||
data.add("file:////nas/share/my.conf|\\\\nas\\apps\\db\\db.dat","file:////nas/share/my.conf","\\\\nas\\apps\\db\\db.dat");
|
||||
return data;
|
||||
}
|
||||
|
||||
@Parameter(value = 0)
|
||||
public String rawFileRef;
|
||||
@Parameter(value = 1)
|
||||
public String expectedUri;
|
||||
@Parameter(value = 2)
|
||||
public String expectedLocation;
|
||||
|
||||
@Test
|
||||
public void testFileArg()
|
||||
{
|
||||
FileArg arg = new FileArg(rawFileRef);
|
||||
if (expectedUri == null)
|
||||
{
|
||||
assertThat("URI",arg.uri,nullValue());
|
||||
}
|
||||
else
|
||||
{
|
||||
assertThat("URI",arg.uri,is(expectedUri));
|
||||
}
|
||||
assertThat("Location",arg.location,is(expectedLocation));
|
||||
}
|
||||
|
||||
}
|
|
@ -31,7 +31,7 @@ PROP|jetty.truststore.password=sundae
|
|||
PROP|java.version=1.7.0_21
|
||||
|
||||
# The Downloads
|
||||
DOWNLOAD|http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar:lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
DOWNLOAD|http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar|lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
|
||||
# The Bootlib
|
||||
BOOTLIB|-Xbootclasspath/p:lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
# The XMLs we expect (order is important)
|
||||
XML|${jetty.home}/etc/jetty-logging.xml
|
||||
XML|${jetty.home}/etc/jetty.xml
|
||||
XML|${jetty.home}/etc/jetty-http.xml
|
||||
|
||||
|
@ -23,4 +22,11 @@ PROP|jetty.port=9090
|
|||
|
||||
# Other File References
|
||||
FILE|logs/
|
||||
FILE|resources/
|
||||
FILE|resources/
|
||||
|
||||
# Downloads
|
||||
DOWNLOAD|http://central.maven.org/maven2/org/slf4j/slf4j-api/1.6.6/slf4j-api-1.6.6.jar|lib/logging/slf4j-api-1.6.6.jar
|
||||
DOWNLOAD|http://repo1.maven.org/maven2/ch/qos/logback/logback-core/1.0.7/logback-core-1.0.7.jar|lib/logging/logback-core-1.0.7.jar
|
||||
DOWNLOAD|http://repo1.maven.org/maven2/ch/qos/logback/logback-classic/1.0.7/logback-classic-1.0.7.jar|lib/logging/logback-classic-1.0.7.jar
|
||||
DOWNLOAD|https://raw.githubusercontent.com/jetty-project/logging-modules/master/logback/logback.xml|resources/logback.xml
|
||||
DOWNLOAD|https://raw.githubusercontent.com/jetty-project/logging-modules/master/logback/jetty-logging.properties|resources/jetty-logging.properties
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
#
|
||||
# Jetty with logback logging
|
||||
#
|
||||
|
||||
[depend]
|
||||
resources
|
||||
|
||||
[files]
|
||||
logs/
|
||||
resources/
|
||||
http://central.maven.org/maven2/org/slf4j/slf4j-api/1.6.6/slf4j-api-1.6.6.jar|lib/logging/slf4j-api-1.6.6.jar
|
||||
http://repo1.maven.org/maven2/ch/qos/logback/logback-core/1.0.7/logback-core-1.0.7.jar|lib/logging/logback-core-1.0.7.jar
|
||||
http://repo1.maven.org/maven2/ch/qos/logback/logback-classic/1.0.7/logback-classic-1.0.7.jar|lib/logging/logback-classic-1.0.7.jar
|
||||
https://raw.githubusercontent.com/jetty-project/logging-modules/master/logback/logback.xml|resources/logback.xml
|
||||
https://raw.githubusercontent.com/jetty-project/logging-modules/master/logback/jetty-logging.properties|resources/jetty-logging.properties
|
||||
|
||||
[lib]
|
||||
lib/logging/**.jar
|
||||
resources/
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
# Configure Jetty for SLf4j Logging
|
||||
org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.Slf4jLog
|
|
@ -2,7 +2,7 @@
|
|||
npn-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.0.v20120525/npn-boot-1.1.0.v20120525.jar:lib/npn/npn-boot-1.1.0.v20120525.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.0.v20120525/npn-boot-1.1.0.v20120525.jar|lib/npn/npn-boot-1.1.0.v20120525.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.0.v20120525.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
npn-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.0.v20120525/npn-boot-1.1.0.v20120525.jar:lib/npn/npn-boot-1.1.0.v20120525.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.0.v20120525/npn-boot-1.1.0.v20120525.jar|lib/npn/npn-boot-1.1.0.v20120525.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.0.v20120525.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
npn-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.1.v20121030/npn-boot-1.1.1.v20121030.jar:lib/npn/npn-boot-1.1.1.v20121030.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.1.v20121030/npn-boot-1.1.1.v20121030.jar|lib/npn/npn-boot-1.1.1.v20121030.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.1.v20121030.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
npn-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.1.v20121030/npn-boot-1.1.1.v20121030.jar:lib/npn/npn-boot-1.1.1.v20121030.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.1.v20121030/npn-boot-1.1.1.v20121030.jar|lib/npn/npn-boot-1.1.1.v20121030.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.1.v20121030.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
npn-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar:lib/npn/npn-boot-1.1.3.v20130313.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar|lib/npn/npn-boot-1.1.3.v20130313.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.3.v20130313.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
npn-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar:lib/npn/npn-boot-1.1.3.v20130313.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar|lib/npn/npn-boot-1.1.3.v20130313.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.3.v20130313.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
npn-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar:lib/npn/npn-boot-1.1.3.v20130313.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar|lib/npn/npn-boot-1.1.3.v20130313.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.3.v20130313.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
npn-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.4.v20130313/npn-boot-1.1.4.v20130313.jar:lib/npn/npn-boot-1.1.4.v20130313.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.4.v20130313/npn-boot-1.1.4.v20130313.jar|lib/npn/npn-boot-1.1.4.v20130313.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.4.v20130313.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
npn-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar:lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar|lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
npn-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar:lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar|lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
npn-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar:lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar|lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
npn-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar:lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar|lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
npn-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar:lib/npn/npn-boot-1.1.6.v20130911.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar|lib/npn/npn-boot-1.1.6.v20130911.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.6.v20130911.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
npn-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar:lib/npn/npn-boot-1.1.6.v20130911.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar|lib/npn/npn-boot-1.1.6.v20130911.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.6.v20130911.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
npn-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar:lib/npn/npn-boot-1.1.6.v20130911.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar|lib/npn/npn-boot-1.1.6.v20130911.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.6.v20130911.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
npn-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.7.v20140316/npn-boot-1.1.7.v20140316.jar:lib/npn/npn-boot-1.1.7.v20140316.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.7.v20140316/npn-boot-1.1.7.v20140316.jar|lib/npn/npn-boot-1.1.7.v20140316.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.7.v20140316.jar
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
</goals>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<Import-Package>javax.servlet.*;version="[2.6.0,3.2)",org.slf4j;version="[1.5,2.0)";resolution:=optional,org.slf4j.impl;version="[1.5,2.0)";resolution:=optional,*</Import-Package>
|
||||
<Import-Package>javax.servlet.*;version="[2.6.0,3.2)",org.slf4j;version="[1.6,2.0)";resolution:=optional,org.slf4j.impl;version="[1.6,2.0)";resolution:=optional,*</Import-Package>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</execution>
|
||||
|
|
|
@ -22,6 +22,8 @@ import java.io.Closeable;
|
|||
import java.io.IOException;
|
||||
import java.io.InterruptedIOException;
|
||||
import java.util.concurrent.CancellationException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
import java.util.concurrent.locks.Condition;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
|
@ -66,6 +68,15 @@ public class SharedBlockingCallback
|
|||
return "SUCCEEDED";
|
||||
}
|
||||
};
|
||||
|
||||
private static Throwable FAILED = new Throwable()
|
||||
{
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "FAILED";
|
||||
}
|
||||
};
|
||||
|
||||
final Blocker _blocker;
|
||||
|
||||
|
@ -148,7 +159,10 @@ public class SharedBlockingCallback
|
|||
{
|
||||
if (_state == null)
|
||||
{
|
||||
_state = cause;
|
||||
// TODO remove when feedback received on 435322
|
||||
if (cause==null)
|
||||
LOG.warn("null failed cause (please report stack trace) ",new Throwable());
|
||||
_state = cause==null?FAILED:cause;
|
||||
_complete.signalAll();
|
||||
}
|
||||
else if (_state == IDLE)
|
||||
|
@ -176,7 +190,16 @@ public class SharedBlockingCallback
|
|||
try
|
||||
{
|
||||
while (_state == null)
|
||||
_complete.await();
|
||||
{
|
||||
// TODO remove this debug timout!
|
||||
// This is here to help debug 435322,
|
||||
if (!_complete.await(10,TimeUnit.MINUTES))
|
||||
{
|
||||
IOException x = new IOException("DEBUG timeout");
|
||||
LOG.warn("Blocked too long (please report!!!) "+this, x);
|
||||
_state=x;
|
||||
}
|
||||
}
|
||||
|
||||
if (_state == SUCCEEDED)
|
||||
return;
|
||||
|
|
|
@ -81,25 +81,25 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
{
|
||||
try
|
||||
{
|
||||
registerVisitor("context-param", this.getClass().getDeclaredMethod("visitContextParam", __signature));
|
||||
registerVisitor("display-name", this.getClass().getDeclaredMethod("visitDisplayName", __signature));
|
||||
registerVisitor("servlet", this.getClass().getDeclaredMethod("visitServlet", __signature));
|
||||
registerVisitor("servlet-mapping", this.getClass().getDeclaredMethod("visitServletMapping", __signature));
|
||||
registerVisitor("session-config", this.getClass().getDeclaredMethod("visitSessionConfig", __signature));
|
||||
registerVisitor("mime-mapping", this.getClass().getDeclaredMethod("visitMimeMapping", __signature));
|
||||
registerVisitor("welcome-file-list", this.getClass().getDeclaredMethod("visitWelcomeFileList", __signature));
|
||||
registerVisitor("locale-encoding-mapping-list", this.getClass().getDeclaredMethod("visitLocaleEncodingList", __signature));
|
||||
registerVisitor("error-page", this.getClass().getDeclaredMethod("visitErrorPage", __signature));
|
||||
registerVisitor("taglib", this.getClass().getDeclaredMethod("visitTagLib", __signature));
|
||||
registerVisitor("jsp-config", this.getClass().getDeclaredMethod("visitJspConfig", __signature));
|
||||
registerVisitor("security-constraint", this.getClass().getDeclaredMethod("visitSecurityConstraint", __signature));
|
||||
registerVisitor("login-config", this.getClass().getDeclaredMethod("visitLoginConfig", __signature));
|
||||
registerVisitor("security-role", this.getClass().getDeclaredMethod("visitSecurityRole", __signature));
|
||||
registerVisitor("filter", this.getClass().getDeclaredMethod("visitFilter", __signature));
|
||||
registerVisitor("filter-mapping", this.getClass().getDeclaredMethod("visitFilterMapping", __signature));
|
||||
registerVisitor("listener", this.getClass().getDeclaredMethod("visitListener", __signature));
|
||||
registerVisitor("distributable", this.getClass().getDeclaredMethod("visitDistributable", __signature));
|
||||
registerVisitor("deny-uncovered-http-methods", this.getClass().getDeclaredMethod("visitDenyUncoveredHttpMethods", __signature));
|
||||
registerVisitor("context-param", this.getClass().getMethod("visitContextParam", __signature));
|
||||
registerVisitor("display-name", this.getClass().getMethod("visitDisplayName", __signature));
|
||||
registerVisitor("servlet", this.getClass().getMethod("visitServlet", __signature));
|
||||
registerVisitor("servlet-mapping", this.getClass().getMethod("visitServletMapping", __signature));
|
||||
registerVisitor("session-config", this.getClass().getMethod("visitSessionConfig", __signature));
|
||||
registerVisitor("mime-mapping", this.getClass().getMethod("visitMimeMapping", __signature));
|
||||
registerVisitor("welcome-file-list", this.getClass().getMethod("visitWelcomeFileList", __signature));
|
||||
registerVisitor("locale-encoding-mapping-list", this.getClass().getMethod("visitLocaleEncodingList", __signature));
|
||||
registerVisitor("error-page", this.getClass().getMethod("visitErrorPage", __signature));
|
||||
registerVisitor("taglib", this.getClass().getMethod("visitTagLib", __signature));
|
||||
registerVisitor("jsp-config", this.getClass().getMethod("visitJspConfig", __signature));
|
||||
registerVisitor("security-constraint", this.getClass().getMethod("visitSecurityConstraint", __signature));
|
||||
registerVisitor("login-config", this.getClass().getMethod("visitLoginConfig", __signature));
|
||||
registerVisitor("security-role", this.getClass().getMethod("visitSecurityRole", __signature));
|
||||
registerVisitor("filter", this.getClass().getMethod("visitFilter", __signature));
|
||||
registerVisitor("filter-mapping", this.getClass().getMethod("visitFilterMapping", __signature));
|
||||
registerVisitor("listener", this.getClass().getMethod("visitListener", __signature));
|
||||
registerVisitor("distributable", this.getClass().getMethod("visitDistributable", __signature));
|
||||
registerVisitor("deny-uncovered-http-methods", this.getClass().getMethod("visitDenyUncoveredHttpMethods", __signature));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
@ -205,7 +205,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
* @param descriptor
|
||||
* @param node
|
||||
*/
|
||||
protected void visitDisplayName(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
public void visitDisplayName(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
{
|
||||
//Servlet Spec 3.0 p. 74 Ignore from web-fragments
|
||||
if (!(descriptor instanceof FragmentDescriptor))
|
||||
|
@ -221,7 +221,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
* @param descriptor
|
||||
* @param node
|
||||
*/
|
||||
protected void visitServlet(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
public void visitServlet(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
{
|
||||
String id = node.getAttribute("id");
|
||||
|
||||
|
@ -638,7 +638,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
* @param descriptor
|
||||
* @param node
|
||||
*/
|
||||
protected void visitServletMapping(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
public void visitServletMapping(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
{
|
||||
//Servlet Spec 3.0, p74
|
||||
//servlet-mappings are always additive, whether from web xml descriptors (web.xml/web-default.xml/web-override.xml) or web-fragments.
|
||||
|
@ -685,7 +685,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
* @param descriptor
|
||||
* @param node
|
||||
*/
|
||||
protected void visitSessionConfig(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
public void visitSessionConfig(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
{
|
||||
XmlParser.Node tNode = node.get("session-timeout");
|
||||
if (tNode != null)
|
||||
|
@ -1014,7 +1014,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
* @param descriptor
|
||||
* @param node
|
||||
*/
|
||||
protected void visitMimeMapping(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
public void visitMimeMapping(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
{
|
||||
String extension = node.getString("extension", false, true);
|
||||
if (extension != null && extension.startsWith("."))
|
||||
|
@ -1061,7 +1061,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
* @param descriptor
|
||||
* @param node
|
||||
*/
|
||||
protected void visitWelcomeFileList(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
public void visitWelcomeFileList(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
{
|
||||
switch (context.getMetaData().getOrigin("welcome-file-list"))
|
||||
{
|
||||
|
@ -1110,7 +1110,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
* @param descriptor
|
||||
* @param node
|
||||
*/
|
||||
protected void visitLocaleEncodingList(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
public void visitLocaleEncodingList(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
{
|
||||
Iterator<XmlParser.Node> iter = node.iterator("locale-encoding-mapping");
|
||||
while (iter.hasNext())
|
||||
|
@ -1161,7 +1161,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
* @param descriptor
|
||||
* @param node
|
||||
*/
|
||||
protected void visitErrorPage(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
public void visitErrorPage(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
{
|
||||
String error = node.getString("error-code", false, true);
|
||||
int code=0;
|
||||
|
@ -1226,7 +1226,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
* @param context
|
||||
* @param node
|
||||
*/
|
||||
protected void addWelcomeFiles(WebAppContext context, XmlParser.Node node)
|
||||
public void addWelcomeFiles(WebAppContext context, XmlParser.Node node)
|
||||
{
|
||||
Iterator<XmlParser.Node> iter = node.iterator("welcome-file");
|
||||
while (iter.hasNext())
|
||||
|
@ -1246,7 +1246,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
* @param node
|
||||
* @param context
|
||||
*/
|
||||
protected ServletMapping addServletMapping (String servletName, XmlParser.Node node, WebAppContext context, Descriptor descriptor)
|
||||
public ServletMapping addServletMapping (String servletName, XmlParser.Node node, WebAppContext context, Descriptor descriptor)
|
||||
{
|
||||
ServletMapping mapping = new ServletMapping();
|
||||
mapping.setServletName(servletName);
|
||||
|
@ -1271,7 +1271,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
* @param node
|
||||
* @param context
|
||||
*/
|
||||
protected void addFilterMapping (String filterName, XmlParser.Node node, WebAppContext context, Descriptor descriptor)
|
||||
public void addFilterMapping (String filterName, XmlParser.Node node, WebAppContext context, Descriptor descriptor)
|
||||
{
|
||||
FilterMapping mapping = new FilterMapping();
|
||||
mapping.setFilterName(filterName);
|
||||
|
@ -1317,7 +1317,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
* @param descriptor
|
||||
* @param node
|
||||
*/
|
||||
protected void visitTagLib(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
public void visitTagLib(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
{
|
||||
//Additive across web.xml and web-fragment.xml
|
||||
String uri = node.getString("taglib-uri", false, true);
|
||||
|
@ -1343,7 +1343,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
* @param descriptor
|
||||
* @param node
|
||||
*/
|
||||
protected void visitJspConfig(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
public void visitJspConfig(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
{
|
||||
//Additive across web.xml and web-fragment.xml
|
||||
JspConfig config = (JspConfig)context.getServletContext().getJspConfigDescriptor();
|
||||
|
@ -1432,7 +1432,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
* @param descriptor
|
||||
* @param node
|
||||
*/
|
||||
protected void visitSecurityConstraint(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
public void visitSecurityConstraint(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
{
|
||||
Constraint scBase = new Constraint();
|
||||
|
||||
|
@ -1547,7 +1547,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
* @param node
|
||||
* @throws Exception
|
||||
*/
|
||||
protected void visitLoginConfig(WebAppContext context, Descriptor descriptor, XmlParser.Node node) throws Exception
|
||||
public void visitLoginConfig(WebAppContext context, Descriptor descriptor, XmlParser.Node node) throws Exception
|
||||
{
|
||||
//ServletSpec 3.0 p74 says elements present 0/1 time if specified in web.xml take
|
||||
//precendece over any web-fragment. If not specified in web.xml, then if specified
|
||||
|
@ -1716,7 +1716,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
* @param descriptor
|
||||
* @param node
|
||||
*/
|
||||
protected void visitSecurityRole(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
public void visitSecurityRole(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
{
|
||||
//ServletSpec 3.0, p74 elements with multiplicity >1 are additive when merged
|
||||
XmlParser.Node roleNode = node.get("role-name");
|
||||
|
@ -1730,7 +1730,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
* @param descriptor
|
||||
* @param node
|
||||
*/
|
||||
protected void visitFilter(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
public void visitFilter(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
{
|
||||
String name = node.getString("filter-name", false, true);
|
||||
FilterHolder holder = _filterHolderMap.get(name);
|
||||
|
@ -1866,7 +1866,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
* @param descriptor
|
||||
* @param node
|
||||
*/
|
||||
protected void visitFilterMapping(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
public void visitFilterMapping(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
{
|
||||
//Servlet Spec 3.0, p74
|
||||
//filter-mappings are always additive, whether from web xml descriptors (web.xml/web-default.xml/web-override.xml) or web-fragments.
|
||||
|
@ -1910,7 +1910,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
* @param descriptor
|
||||
* @param node
|
||||
*/
|
||||
protected void visitListener(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
public void visitListener(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
{
|
||||
String className = node.getString("listener-class", false, true);
|
||||
EventListener listener = null;
|
||||
|
@ -1956,7 +1956,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
* @param descriptor
|
||||
* @param node
|
||||
*/
|
||||
protected void visitDistributable(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
public void visitDistributable(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
{
|
||||
// the element has no content, so its simple presence
|
||||
// indicates that the webapp is distributable...
|
||||
|
@ -1974,7 +1974,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
* @param descriptor
|
||||
* @param node
|
||||
*/
|
||||
protected void visitDenyUncoveredHttpMethods(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
public void visitDenyUncoveredHttpMethods(WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
{
|
||||
((ConstraintAware)context.getSecurityHandler()).setDenyUncoveredHttpMethods(true);
|
||||
}
|
||||
|
@ -1987,7 +1987,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
* @throws InstantiationException
|
||||
* @throws IllegalAccessException
|
||||
*/
|
||||
protected EventListener newListenerInstance(WebAppContext context,Class<? extends EventListener> clazz) throws Exception
|
||||
public EventListener newListenerInstance(WebAppContext context,Class<? extends EventListener> clazz) throws Exception
|
||||
{
|
||||
ListenerHolder h = context.getServletHandler().newListenerHolder(Source.DESCRIPTOR);
|
||||
EventListener l = context.getServletContext().createInstance(clazz);
|
||||
|
@ -2001,7 +2001,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
* @param p
|
||||
* @return the normalized pattern
|
||||
*/
|
||||
protected String normalizePattern(String p)
|
||||
public String normalizePattern(String p)
|
||||
{
|
||||
if (p != null && p.length() > 0 && !p.startsWith("/") && !p.startsWith("*")) return "/" + p;
|
||||
return p;
|
||||
|
|
|
@ -20,6 +20,9 @@ package org.eclipse.jetty.webapp;
|
|||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.lang.instrument.ClassFileTransformer;
|
||||
import java.lang.instrument.IllegalClassFormatException;
|
||||
import java.net.URL;
|
||||
import java.net.URLClassLoader;
|
||||
import java.security.CodeSource;
|
||||
|
@ -32,7 +35,9 @@ import java.util.List;
|
|||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
import java.util.StringTokenizer;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import org.eclipse.jetty.util.IO;
|
||||
import org.eclipse.jetty.util.StringUtil;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
@ -66,6 +71,7 @@ public class WebAppClassLoader extends URLClassLoader
|
|||
private final ClassLoader _parent;
|
||||
private final Set<String> _extensions=new HashSet<String>();
|
||||
private String _name=String.valueOf(hashCode());
|
||||
private final List<ClassFileTransformer> _transformers = new CopyOnWriteArrayList<>();
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
/** The Context in which the classloader operates.
|
||||
|
@ -295,6 +301,7 @@ public class WebAppClassLoader extends URLClassLoader
|
|||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
@Override
|
||||
public PermissionCollection getPermissions(CodeSource cs)
|
||||
{
|
||||
PermissionCollection permissions=_context.getPermissions();
|
||||
|
@ -303,6 +310,7 @@ public class WebAppClassLoader extends URLClassLoader
|
|||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
@Override
|
||||
public Enumeration<URL> getResources(String name) throws IOException
|
||||
{
|
||||
boolean system_class=_context.isSystemClass(name);
|
||||
|
@ -336,6 +344,7 @@ public class WebAppClassLoader extends URLClassLoader
|
|||
* should one be present. This is non-standard and it is recommended
|
||||
* to not rely on this behavior
|
||||
*/
|
||||
@Override
|
||||
public URL getResource(String name)
|
||||
{
|
||||
URL url= null;
|
||||
|
@ -439,19 +448,85 @@ public class WebAppClassLoader extends URLClassLoader
|
|||
if (c == null && _parent!=null && !tried_parent && !server_class )
|
||||
c= _parent.loadClass(name);
|
||||
|
||||
if (c == null)
|
||||
if (c == null && ex!=null)
|
||||
throw ex;
|
||||
|
||||
if (resolve)
|
||||
resolveClass(c);
|
||||
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("loaded " + c+ " from "+c.getClassLoader());
|
||||
LOG.debug("loaded {} from {}",c,c==null?null:c.getClassLoader());
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
public void addClassFileTransformer(ClassFileTransformer transformer)
|
||||
{
|
||||
_transformers.add(transformer);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
public boolean removeClassFileTransformer(ClassFileTransformer transformer)
|
||||
{
|
||||
return _transformers.remove(transformer);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
@Override
|
||||
protected Class<?> findClass(final String name) throws ClassNotFoundException
|
||||
{
|
||||
Class<?> clazz=null;
|
||||
|
||||
if (_transformers.isEmpty())
|
||||
clazz = super.findClass(name);
|
||||
else
|
||||
{
|
||||
String path = name.replace('.', '/').concat(".class");
|
||||
URL url = getResource(path);
|
||||
if (url==null)
|
||||
throw new ClassNotFoundException(name);
|
||||
|
||||
InputStream content=null;
|
||||
try
|
||||
{
|
||||
content = url.openStream();
|
||||
byte[] bytes =IO.readBytes(content);
|
||||
|
||||
for (ClassFileTransformer transformer : _transformers)
|
||||
bytes=transformer.transform(this,name,null,null,bytes);
|
||||
|
||||
clazz=defineClass(name,bytes,0,bytes.length);
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
throw new ClassNotFoundException(name,e);
|
||||
}
|
||||
catch (IllegalClassFormatException e)
|
||||
{
|
||||
throw new ClassNotFoundException(name,e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (content!=null)
|
||||
{
|
||||
try
|
||||
{
|
||||
content.close();
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
throw new ClassNotFoundException(name,e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return clazz;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "WebAppClassLoader=" + _name+"@"+Long.toHexString(hashCode());
|
||||
|
|
|
@ -1210,24 +1210,6 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL
|
|||
catch (IOException e){LOG.warn(Log.EXCEPTION,e);}
|
||||
}
|
||||
|
||||
if (dir!=null && !dir.exists())
|
||||
{
|
||||
dir.mkdir();
|
||||
dir.deleteOnExit();
|
||||
}
|
||||
|
||||
if (dir!=null && ( !dir.exists() || !dir.isDirectory() || !dir.canWrite()))
|
||||
throw new IllegalArgumentException("Bad temp directory: "+dir);
|
||||
|
||||
try
|
||||
{
|
||||
if (dir!=null)
|
||||
dir=dir.getCanonicalFile();
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
LOG.warn(e);
|
||||
}
|
||||
_tmpDir=dir;
|
||||
setAttribute(TEMPDIR,_tmpDir);
|
||||
}
|
||||
|
|
|
@ -360,7 +360,7 @@ public class WebInfConfiguration extends AbstractConfiguration
|
|||
context.setTempDirectory(tmpDir);
|
||||
}
|
||||
|
||||
private void configureTempDirectory (File dir, WebAppContext context)
|
||||
public void configureTempDirectory (File dir, WebAppContext context)
|
||||
{
|
||||
if (dir == null)
|
||||
throw new IllegalArgumentException("Null temp dir");
|
||||
|
|
|
@ -19,15 +19,21 @@
|
|||
package org.eclipse.jetty.webapp;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.lang.instrument.ClassFileTransformer;
|
||||
import java.lang.instrument.IllegalClassFormatException;
|
||||
import java.net.URL;
|
||||
import java.security.ProtectionDomain;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Enumeration;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.jetty.util.resource.Resource;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -86,6 +92,54 @@ public class WebAppClassLoaderTest
|
|||
assertTrue(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClassFileTranslations() throws Exception
|
||||
{
|
||||
final List<Object> results=new ArrayList<Object>();
|
||||
|
||||
_loader.addClassFileTransformer(new ClassFileTransformer()
|
||||
{
|
||||
public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer)
|
||||
throws IllegalClassFormatException
|
||||
{
|
||||
results.add(loader);
|
||||
byte[] b = new byte[classfileBuffer.length];
|
||||
for (int i=0;i<classfileBuffer.length;i++)
|
||||
b[i]=(byte)(classfileBuffer[i]^0xff);
|
||||
return b;
|
||||
}
|
||||
});
|
||||
_loader.addClassFileTransformer(new ClassFileTransformer()
|
||||
{
|
||||
public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer)
|
||||
throws IllegalClassFormatException
|
||||
{
|
||||
results.add(className);
|
||||
byte[] b = new byte[classfileBuffer.length];
|
||||
for (int i=0;i<classfileBuffer.length;i++)
|
||||
b[i]=(byte)(classfileBuffer[i]^0xff);
|
||||
return b;
|
||||
}
|
||||
});
|
||||
|
||||
_context.setParentLoaderPriority(false);
|
||||
assertTrue(canLoadClass("org.acme.webapp.ClassInJarA"));
|
||||
assertTrue(canLoadClass("org.acme.webapp.ClassInJarB"));
|
||||
assertTrue(canLoadClass("org.acme.other.ClassInClassesC"));
|
||||
assertTrue(canLoadClass("java.lang.String"));
|
||||
assertTrue(cantLoadClass("org.eclipse.jetty.webapp.Configuration"));
|
||||
|
||||
Iterator<Object> iter = results.iterator();
|
||||
assertEquals(_loader,iter.next());
|
||||
assertEquals("org.acme.webapp.ClassInJarA",iter.next());
|
||||
assertEquals(_loader,iter.next());
|
||||
assertEquals("org.acme.webapp.ClassInJarB",iter.next());
|
||||
assertEquals(_loader,iter.next());
|
||||
assertEquals("org.acme.other.ClassInClassesC",iter.next());
|
||||
assertFalse(iter.hasNext());
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testExposedClass() throws Exception
|
||||
|
|
|
@ -20,8 +20,6 @@ package org.eclipse.jetty.websocket.jsr356;
|
|||
|
||||
import static org.hamcrest.Matchers.*;
|
||||
|
||||
import org.junit.Ignore;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
|
@ -59,7 +57,6 @@ import org.junit.Before;
|
|||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
|
||||
@Ignore
|
||||
public class DecoderReaderTest
|
||||
{
|
||||
public static class Quotes
|
||||
|
@ -262,8 +259,8 @@ public class DecoderReaderTest
|
|||
client.connectToServer(quoter,server.getWsUri());
|
||||
qserver.awaitConnect();
|
||||
qserver.writeQuotes("quotes-ben.txt");
|
||||
qserver.close();
|
||||
quoter.messageQueue.awaitEventCount(1,1000,TimeUnit.MILLISECONDS);
|
||||
qserver.close();
|
||||
quoter.awaitClose();
|
||||
Quotes quotes = quoter.messageQueue.poll();
|
||||
Assert.assertThat("Quotes Author",quotes.author,is("Benjamin Franklin"));
|
||||
|
@ -280,8 +277,8 @@ public class DecoderReaderTest
|
|||
qserver.awaitConnect();
|
||||
qserver.writeQuotes("quotes-ben.txt");
|
||||
qserver.writeQuotes("quotes-twain.txt");
|
||||
qserver.close();
|
||||
quoter.messageQueue.awaitEventCount(2,1000,TimeUnit.MILLISECONDS);
|
||||
qserver.close();
|
||||
quoter.awaitClose();
|
||||
Quotes quotes = quoter.messageQueue.poll();
|
||||
Assert.assertThat("Quotes Author",quotes.author,is("Benjamin Franklin"));
|
||||
|
|
|
@ -144,7 +144,6 @@ public class ConfiguratorTest
|
|||
@Override
|
||||
public String getNegotiatedSubprotocol(List<String> supported, List<String> requested)
|
||||
{
|
||||
LOG.warn(new Throwable());
|
||||
String seen = QuoteUtil.join(requested,",");
|
||||
seenProtocols.compareAndSet(null,seen);
|
||||
return super.getNegotiatedSubprotocol(supported,requested);
|
||||
|
|
|
@ -27,11 +27,10 @@ import org.eclipse.jetty.toolchain.test.TestTracker;
|
|||
import org.eclipse.jetty.websocket.api.Session;
|
||||
import org.eclipse.jetty.websocket.api.StatusCode;
|
||||
import org.eclipse.jetty.websocket.common.test.BlockheadServer;
|
||||
import org.eclipse.jetty.websocket.common.test.LeakTrackingBufferPool;
|
||||
import org.eclipse.jetty.websocket.common.test.BlockheadServer.ServerConnection;
|
||||
import org.eclipse.jetty.websocket.common.test.LeakTrackingBufferPool;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -104,7 +103,6 @@ public class BadNetworkTest
|
|||
wsocket.assertCloseCode(StatusCode.NO_CLOSE);
|
||||
}
|
||||
|
||||
@Ignore("Idle timeout not working yet")
|
||||
@Test
|
||||
public void testAbruptServerClose() throws Exception
|
||||
{
|
||||
|
|
|
@ -18,10 +18,7 @@
|
|||
|
||||
package org.eclipse.jetty.websocket.client;
|
||||
|
||||
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
|
||||
import static org.hamcrest.Matchers.instanceOf;
|
||||
import static org.hamcrest.Matchers.is;
|
||||
import static org.hamcrest.Matchers.notNullValue;
|
||||
import static org.hamcrest.Matchers.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.ConnectException;
|
||||
|
@ -40,12 +37,11 @@ import org.eclipse.jetty.websocket.api.Session;
|
|||
import org.eclipse.jetty.websocket.api.UpgradeException;
|
||||
import org.eclipse.jetty.websocket.common.AcceptHash;
|
||||
import org.eclipse.jetty.websocket.common.test.BlockheadServer;
|
||||
import org.eclipse.jetty.websocket.common.test.LeakTrackingBufferPool;
|
||||
import org.eclipse.jetty.websocket.common.test.BlockheadServer.ServerConnection;
|
||||
import org.eclipse.jetty.websocket.common.test.LeakTrackingBufferPool;
|
||||
import org.junit.After;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -311,7 +307,6 @@ public class ClientConnectTest
|
|||
}
|
||||
|
||||
@Test
|
||||
@Ignore("Opened bug 399525")
|
||||
public void testConnectionNotAccepted() throws Exception
|
||||
{
|
||||
JettyTrackingSocket wsocket = new JettyTrackingSocket();
|
||||
|
@ -329,7 +324,6 @@ public class ClientConnectTest
|
|||
}
|
||||
catch (ExecutionException e)
|
||||
{
|
||||
// FIXME: Connect Timeout Error?
|
||||
assertExpectedError(e,wsocket,UpgradeException.class);
|
||||
// Possible Passing Path (active session wait timeout)
|
||||
wsocket.assertNotOpened();
|
||||
|
|
|
@ -7,7 +7,7 @@ org.eclipse.jetty.LEVEL=WARN
|
|||
# org.eclipse.jetty.io.FillInterest.LEVEL=DEBUG
|
||||
# org.eclipse.jetty.io.AbstractConnection.LEVEL=DEBUG
|
||||
# org.eclipse.jetty.websocket.LEVEL=WARN
|
||||
org.eclipse.jetty.websocket.LEVEL=DEBUG
|
||||
# org.eclipse.jetty.websocket.LEVEL=DEBUG
|
||||
# org.eclipse.jetty.websocket.client.LEVEL=DEBUG
|
||||
# org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.LEVEL=DEBUG
|
||||
# org.eclipse.jetty.websocket.common.io.IOState.LEVEL=DEBUG
|
||||
|
|
|
@ -1,78 +0,0 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2014 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.websocket.common.extensions.compress;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.zip.Deflater;
|
||||
|
||||
import org.eclipse.jetty.util.StringUtil;
|
||||
import org.eclipse.jetty.websocket.common.util.Hex;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
public class DeflateTest
|
||||
{
|
||||
private int bufSize = 8 * 1024;
|
||||
|
||||
public String deflate(String inputHex, Deflater deflater, int flushMode)
|
||||
{
|
||||
byte uncompressed[] = Hex.asByteArray(inputHex);
|
||||
deflater.reset();
|
||||
deflater.setInput(uncompressed,0,uncompressed.length);
|
||||
if (flushMode != Deflater.SYNC_FLUSH)
|
||||
deflater.finish();
|
||||
|
||||
ByteBuffer out = ByteBuffer.allocate(bufSize);
|
||||
byte buf[] = new byte[64];
|
||||
|
||||
int len = deflater.deflate(buf,0,buf.length,flushMode);
|
||||
out.put(buf,0,len);
|
||||
|
||||
out.flip();
|
||||
return Hex.asHex(out);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore("noisy")
|
||||
public void deflateAllTypes()
|
||||
{
|
||||
int levels[] = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
|
||||
boolean nowraps[] = new boolean[] { true, false };
|
||||
int strategies[] = new int[] { Deflater.DEFAULT_STRATEGY, Deflater.FILTERED, Deflater.HUFFMAN_ONLY };
|
||||
int flushmodes[] = new int[] { Deflater.NO_FLUSH, Deflater.SYNC_FLUSH, Deflater.FULL_FLUSH };
|
||||
|
||||
String inputHex = Hex.asHex(StringUtil.getUtf8Bytes("time:"));
|
||||
for (int level : levels)
|
||||
{
|
||||
for (boolean nowrap : nowraps)
|
||||
{
|
||||
Deflater deflater = new Deflater(level,nowrap);
|
||||
for (int strategy : strategies)
|
||||
{
|
||||
deflater.setStrategy(strategy);
|
||||
for (int flushmode : flushmodes)
|
||||
{
|
||||
String result = deflate(inputHex,deflater,flushmode);
|
||||
System.out.printf("%d | %b | %d | %d | \"%s\"%n",level,nowrap,strategy,flushmode,result);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -31,10 +31,8 @@ import org.eclipse.jetty.websocket.server.helper.EchoServlet;
|
|||
import org.junit.AfterClass;
|
||||
import org.junit.Assert;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
@Ignore("Bug 395444")
|
||||
public class FragmentExtensionTest
|
||||
{
|
||||
private static SimpleServletServer server;
|
||||
|
|
|
@ -31,10 +31,8 @@ import org.eclipse.jetty.websocket.server.helper.EchoServlet;
|
|||
import org.junit.AfterClass;
|
||||
import org.junit.Assert;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
@Ignore("Bug 395444")
|
||||
public class IdentityExtensionTest
|
||||
{
|
||||
private static SimpleServletServer server;
|
||||
|
|
12
pom.xml
12
pom.xml
|
@ -14,7 +14,7 @@
|
|||
<jetty.url>http://www.eclipse.org/jetty</jetty.url>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<build-support-version>1.1</build-support-version>
|
||||
<slf4j-version>1.6.1</slf4j-version>
|
||||
<slf4j-version>1.6.6</slf4j-version>
|
||||
<jetty-test-policy-version>1.2</jetty-test-policy-version>
|
||||
<npn.api.version>1.1.0.v20120525</npn.api.version>
|
||||
<alpn.api.version>1.0.0</alpn.api.version>
|
||||
|
@ -261,12 +261,18 @@
|
|||
<configuration>
|
||||
<argLine>-showversion -Xmx1g -Xms1g -XX:+PrintGCDetails</argLine>
|
||||
<failIfNoTests>false</failIfNoTests>
|
||||
<!--systemProperties>
|
||||
<systemProperties>
|
||||
<!--
|
||||
<property>
|
||||
<name>org.eclipse.jetty.io.AbstractBuffer.boundsChecking</name>
|
||||
<value>true</value>
|
||||
</property>
|
||||
</systemProperties-->
|
||||
-->
|
||||
<property>
|
||||
<name>java.io.tmpdir</name>
|
||||
<value>${project.build.directory}</value>
|
||||
</property>
|
||||
</systemProperties>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty.tests</groupId>
|
||||
<artifactId>test-sessions-parent</artifactId>
|
||||
<version>9.1.1-SNAPSHOT</version>
|
||||
<version>9.2.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>test-mongodb-sessions</artifactId>
|
||||
<name>Jetty Tests :: Sessions :: Mongo</name>
|
||||
|
|
Loading…
Reference in New Issue