Merged branch 'jetty-9.4.x' into 'master'.
This commit is contained in:
commit
7f94aacdcd
|
@ -19,7 +19,6 @@
|
|||
package org.eclipse.jetty.continuation;
|
||||
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.Servlet;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.ServletResponseWrapper;
|
||||
|
@ -138,8 +137,10 @@ import javax.servlet.ServletResponseWrapper;
|
|||
*
|
||||
* @see ContinuationSupport
|
||||
* @see ContinuationListener
|
||||
*
|
||||
*
|
||||
* @deprecated use Servlet 3.0 {@link javax.servlet.AsyncContext} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public interface Continuation
|
||||
{
|
||||
public final static String ATTRIBUTE = "org.eclipse.jetty.continuation";
|
||||
|
|
|
@ -48,7 +48,9 @@ import javax.servlet.ServletResponse;
|
|||
* {@link Continuation#complete()} is called.</p>
|
||||
* <p>Faux continuations are not threadless continuations (they are "faux" - fake - for this reason)
|
||||
* and as such they will scale less than proper continuations.</p>
|
||||
* @deprecated use Servlet 3.0 {@link javax.servlet.AsyncContext} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public class ContinuationFilter implements Filter
|
||||
{
|
||||
static boolean _initialized;
|
||||
|
@ -60,6 +62,7 @@ public class ContinuationFilter implements Filter
|
|||
|
||||
public void init(FilterConfig filterConfig) throws ServletException
|
||||
{
|
||||
filterConfig.getServletContext().log("WARNING: " + this.getClass().getName() + " is now DEPRECATED, use Servlet 3.0 AsyncContext instead.");
|
||||
boolean jetty_7_or_greater="org.eclipse.jetty.servlet".equals(filterConfig.getClass().getPackage().getName());
|
||||
_context = filterConfig.getServletContext();
|
||||
|
||||
|
|
|
@ -27,7 +27,9 @@ import javax.servlet.ServletRequestListener;
|
|||
* <p>
|
||||
* A ContinuationListener may be registered with a call to
|
||||
* {@link Continuation#addContinuationListener(ContinuationListener)}.
|
||||
* @deprecated use Servlet 3.0 {@link javax.servlet.AsyncContext} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public interface ContinuationListener extends EventListener
|
||||
{
|
||||
/* ------------------------------------------------------------ */
|
||||
|
|
|
@ -29,7 +29,9 @@ import javax.servlet.ServletResponse;
|
|||
*
|
||||
* Factory class for accessing Continuation instances, which with either be
|
||||
* a servlet 3.0 or a faux continuation.
|
||||
* @deprecated use Servlet 3.0 {@link javax.servlet.AsyncContext} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public class ContinuationSupport
|
||||
{
|
||||
static final boolean __servlet3;
|
||||
|
|
|
@ -41,7 +41,9 @@ package org.eclipse.jetty.continuation;
|
|||
* to be uncaught (or rethrown) by a Filter/Servlet. A ContinuationThrowable
|
||||
* does not represent and error condition.
|
||||
* </p>
|
||||
* @deprecated use Servlet 3.0 {@link javax.servlet.AsyncContext} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public class ContinuationThrowable extends Error
|
||||
{
|
||||
public ContinuationThrowable()
|
||||
|
|
|
@ -33,7 +33,9 @@ import org.eclipse.jetty.continuation.ContinuationFilter.FilteredContinuation;
|
|||
* A blocking implementation of Continuation.
|
||||
* This implementation of Continuation is used by the {@link ContinuationFilter}
|
||||
* when there are is no native or asynchronous continuation type available.
|
||||
* @deprecated use Servlet 3.0 {@link javax.servlet.AsyncContext} instead
|
||||
*/
|
||||
@Deprecated
|
||||
class FauxContinuation implements FilteredContinuation
|
||||
{
|
||||
// common exception used for all continuations.
|
||||
|
|
|
@ -36,7 +36,9 @@ import javax.servlet.ServletResponseWrapper;
|
|||
* This implementation of Continuation is used by {@link ContinuationSupport}
|
||||
* when it detects that the application has been deployed in a Servlet 3
|
||||
* server.
|
||||
* @deprecated use Servlet 3.0 {@link javax.servlet.AsyncContext} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public class Servlet3Continuation implements Continuation, AsyncListener
|
||||
{
|
||||
// Exception reused for all continuations
|
||||
|
|
|
@ -17,7 +17,8 @@
|
|||
//
|
||||
|
||||
/**
|
||||
* Jetty Continuation : Generic Async Servlet Method
|
||||
* Jetty Continuation : <em>DEPRECATED: use Servlet 3.0 {@link javax.servlet.AsyncContext} instead</em>
|
||||
*/
|
||||
@Deprecated
|
||||
package org.eclipse.jetty.continuation;
|
||||
|
||||
|
|
|
@ -226,10 +226,10 @@ As `LoginModules` are free to use their own implementation of the JAAS Principal
|
|||
|
||||
===== Sample LoginModules
|
||||
|
||||
* link:{JXURL}/org/eclipse/jetty/jaas/spi/JDBCLoginModule.html[`org.eclipse.jetty.jaas.spi.JDBCLoginModule`]
|
||||
* link:{JXURL}/org/eclipse/jetty/jaas/spi/PropertyFileLoginModule.html[`org.eclipse.jetty.jaas.spi.PropertyFileLoginModule`]
|
||||
* link:{JXURL}/org/eclipse/jetty/jaas/spi/DataSourceLoginModule.html[`org.eclipse.jetty.jaas.spi.DataSourceLoginModule`]
|
||||
* link:{JXURL}/org/eclipse/jetty/jaas/spi/LdapLoginModule.html[`org.eclipse.jetty.jaas.ldap.LdapLoginModule`]
|
||||
* link:{JDURL}/org/eclipse/jetty/jaas/spi/JDBCLoginModule.html[`org.eclipse.jetty.jaas.spi.JDBCLoginModule`]
|
||||
* link:{JDURL}/org/eclipse/jetty/jaas/spi/PropertyFileLoginModule.html[`org.eclipse.jetty.jaas.spi.PropertyFileLoginModule`]
|
||||
* link:{JDURL}/org/eclipse/jetty/jaas/spi/DataSourceLoginModule.html[`org.eclipse.jetty.jaas.spi.DataSourceLoginModule`]
|
||||
* link:{JDURL}/org/eclipse/jetty/jaas/spi/LdapLoginModule.html[`org.eclipse.jetty.jaas.ldap.LdapLoginModule`]
|
||||
|
||||
____
|
||||
[NOTE]
|
||||
|
|
|
@ -33,6 +33,8 @@ import org.eclipse.jetty.server.session.UnreadableSessionDataException;
|
|||
import org.eclipse.jetty.server.session.UnwriteableSessionDataException;
|
||||
import org.eclipse.jetty.util.ClassLoadingObjectInputStream;
|
||||
import org.eclipse.jetty.util.StringUtil;
|
||||
import org.eclipse.jetty.util.annotation.ManagedAttribute;
|
||||
import org.eclipse.jetty.util.annotation.ManagedObject;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
|
@ -55,6 +57,7 @@ import com.google.cloud.datastore.StructuredQuery.PropertyFilter;
|
|||
*
|
||||
*
|
||||
*/
|
||||
@ManagedObject
|
||||
public class GCloudSessionDataStore extends AbstractSessionDataStore
|
||||
{
|
||||
private final static Logger LOG = Log.getLogger("org.eclipse.jetty.server.session");
|
||||
|
@ -410,11 +413,13 @@ public class GCloudSessionDataStore extends AbstractSessionDataStore
|
|||
_namespace = namespace;
|
||||
}
|
||||
|
||||
@ManagedAttribute(value="gclound namespace", readonly=true)
|
||||
public String getNamespace ()
|
||||
{
|
||||
return _namespace;
|
||||
}
|
||||
|
||||
@ManagedAttribute(value="unit in ms of exponential backoff")
|
||||
public int getBackoffMs ()
|
||||
{
|
||||
return _backoff;
|
||||
|
@ -426,7 +431,7 @@ public class GCloudSessionDataStore extends AbstractSessionDataStore
|
|||
_maxRetries = retries;
|
||||
}
|
||||
|
||||
|
||||
@ManagedAttribute(value="max number of retries for failed writes")
|
||||
public int getMaxRetries ()
|
||||
{
|
||||
return _maxRetries;
|
||||
|
@ -480,6 +485,7 @@ public class GCloudSessionDataStore extends AbstractSessionDataStore
|
|||
_dsProvided = true;
|
||||
}
|
||||
|
||||
@ManagedAttribute(value="max number of results to return from gcloud searches")
|
||||
public int getMaxResults()
|
||||
{
|
||||
return _maxResults;
|
||||
|
@ -978,6 +984,7 @@ public class GCloudSessionDataStore extends AbstractSessionDataStore
|
|||
/**
|
||||
* @see org.eclipse.jetty.server.session.SessionDataStore#isPassivating()
|
||||
*/
|
||||
@ManagedAttribute(value="does gcloud serialize session data", readonly=true)
|
||||
@Override
|
||||
public boolean isPassivating()
|
||||
{
|
||||
|
|
|
@ -27,6 +27,8 @@ import java.util.concurrent.atomic.AtomicReference;
|
|||
import org.eclipse.jetty.server.SessionIdManager;
|
||||
import org.eclipse.jetty.server.session.AbstractSessionDataStore;
|
||||
import org.eclipse.jetty.server.session.SessionData;
|
||||
import org.eclipse.jetty.util.annotation.ManagedAttribute;
|
||||
import org.eclipse.jetty.util.annotation.ManagedObject;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
import org.infinispan.commons.api.BasicCache;
|
||||
|
@ -36,6 +38,7 @@ import org.infinispan.commons.api.BasicCache;
|
|||
*
|
||||
*
|
||||
*/
|
||||
@ManagedObject
|
||||
public class InfinispanSessionDataStore extends AbstractSessionDataStore
|
||||
{
|
||||
private final static Logger LOG = Log.getLogger("org.eclipse.jetty.server.session");
|
||||
|
@ -231,6 +234,7 @@ public class InfinispanSessionDataStore extends AbstractSessionDataStore
|
|||
/**
|
||||
* @see org.eclipse.jetty.server.session.SessionDataStore#isPassivating()
|
||||
*/
|
||||
@ManagedAttribute(value="does store serialize sessions", readonly=true)
|
||||
@Override
|
||||
public boolean isPassivating()
|
||||
{
|
||||
|
@ -307,6 +311,8 @@ public class InfinispanSessionDataStore extends AbstractSessionDataStore
|
|||
_infinispanIdleTimeoutSec = sec;
|
||||
}
|
||||
|
||||
|
||||
@ManagedAttribute(value="infinispan idle timeout sec", readonly=true)
|
||||
public int getInfinispanIdleTimeoutSec ()
|
||||
{
|
||||
return _infinispanIdleTimeoutSec;
|
||||
|
|
|
@ -25,6 +25,8 @@ import java.util.List;
|
|||
import org.eclipse.jetty.server.session.SessionContext;
|
||||
import org.eclipse.jetty.server.session.SessionData;
|
||||
import org.eclipse.jetty.server.session.SessionDataMap;
|
||||
import org.eclipse.jetty.util.annotation.ManagedAttribute;
|
||||
import org.eclipse.jetty.util.annotation.ManagedObject;
|
||||
import org.eclipse.jetty.util.component.AbstractLifeCycle;
|
||||
|
||||
import net.rubyeye.xmemcached.MemcachedClient;
|
||||
|
@ -37,6 +39,7 @@ import net.rubyeye.xmemcached.XMemcachedClientBuilder;
|
|||
*
|
||||
* Uses memcached as a cache for SessionData.
|
||||
*/
|
||||
@ManagedObject
|
||||
public class MemcachedSessionDataMap extends AbstractLifeCycle implements SessionDataMap
|
||||
{
|
||||
public static final String DEFAULT_HOST = "localhost";
|
||||
|
@ -91,8 +94,17 @@ public class MemcachedSessionDataMap extends AbstractLifeCycle implements Sessio
|
|||
_expirySec = sec;
|
||||
}
|
||||
|
||||
/**
|
||||
* Expiry time for memached entries.
|
||||
* @return memcached expiry time in sec
|
||||
*/
|
||||
@ManagedAttribute(value="memcached expiry time in sec", readonly=true)
|
||||
public int getExpirySec ()
|
||||
{
|
||||
return _expirySec;
|
||||
}
|
||||
|
||||
|
||||
@ManagedAttribute(value="enable memcached heartbeats", readonly=true)
|
||||
public boolean isHeartbeats()
|
||||
{
|
||||
return _heartbeats;
|
||||
|
|
|
@ -44,6 +44,8 @@ import java.util.concurrent.atomic.AtomicReference;
|
|||
import org.eclipse.jetty.nosql.NoSqlSessionDataStore;
|
||||
import org.eclipse.jetty.server.session.SessionData;
|
||||
import org.eclipse.jetty.util.ClassLoadingObjectInputStream;
|
||||
import org.eclipse.jetty.util.annotation.ManagedAttribute;
|
||||
import org.eclipse.jetty.util.annotation.ManagedObject;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
|
@ -96,6 +98,7 @@ import org.eclipse.jetty.util.log.Logger;
|
|||
*
|
||||
*
|
||||
*/
|
||||
@ManagedObject
|
||||
public class MongoSessionDataStore extends NoSqlSessionDataStore
|
||||
{
|
||||
|
||||
|
@ -171,7 +174,7 @@ public class MongoSessionDataStore extends NoSqlSessionDataStore
|
|||
_dbSessions = collection;
|
||||
}
|
||||
|
||||
|
||||
@ManagedAttribute(value="DBCollection", readonly=true)
|
||||
public DBCollection getDBCollection ()
|
||||
{
|
||||
return _dbSessions;
|
||||
|
@ -695,6 +698,7 @@ public class MongoSessionDataStore extends NoSqlSessionDataStore
|
|||
/**
|
||||
* @see org.eclipse.jetty.server.session.SessionDataStore#isPassivating()
|
||||
*/
|
||||
@ManagedAttribute(value="does store serialize sessions", readonly=true)
|
||||
@Override
|
||||
public boolean isPassivating()
|
||||
{
|
||||
|
|
|
@ -18,9 +18,6 @@
|
|||
|
||||
package org.eclipse.jetty.server;
|
||||
|
||||
import static javax.servlet.RequestDispatcher.ERROR_EXCEPTION;
|
||||
import static javax.servlet.RequestDispatcher.ERROR_STATUS_CODE;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.nio.ByteBuffer;
|
||||
|
@ -30,6 +27,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
|||
import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
import javax.servlet.DispatcherType;
|
||||
import javax.servlet.RequestDispatcher;
|
||||
|
||||
import org.eclipse.jetty.http.BadMessageException;
|
||||
import org.eclipse.jetty.http.HttpFields;
|
||||
|
@ -54,7 +52,6 @@ import org.eclipse.jetty.util.log.Log;
|
|||
import org.eclipse.jetty.util.log.Logger;
|
||||
import org.eclipse.jetty.util.thread.Scheduler;
|
||||
|
||||
|
||||
/**
|
||||
* HttpChannel represents a single endpoint for HTTP semantic processing.
|
||||
* The HttpChannel is both a HttpParser.RequestHandler, where it passively receives events from
|
||||
|
@ -345,21 +342,15 @@ public class HttpChannel implements Runnable, HttpOutput.Interceptor
|
|||
|
||||
case ERROR_DISPATCH:
|
||||
{
|
||||
if (_response.isCommitted())
|
||||
{
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("Could not perform Error Dispatch because the response is already committed, aborting");
|
||||
_transport.abort((Throwable)_request.getAttribute(ERROR_EXCEPTION));
|
||||
}
|
||||
else
|
||||
try
|
||||
{
|
||||
_response.reset();
|
||||
Integer icode = (Integer)_request.getAttribute(ERROR_STATUS_CODE);
|
||||
Integer icode = (Integer)_request.getAttribute(RequestDispatcher.ERROR_STATUS_CODE);
|
||||
int code = icode != null ? icode : HttpStatus.INTERNAL_SERVER_ERROR_500;
|
||||
_response.setStatus(code);
|
||||
_request.setAttribute(ERROR_STATUS_CODE,code);
|
||||
_request.setAttribute(RequestDispatcher.ERROR_STATUS_CODE,code);
|
||||
if (icode==null)
|
||||
_request.setAttribute(ERROR_STATUS_CODE,code);
|
||||
_request.setAttribute(RequestDispatcher.ERROR_STATUS_CODE,code);
|
||||
_request.setHandled(false);
|
||||
_response.getHttpOutput().reopen();
|
||||
|
||||
|
@ -373,6 +364,12 @@ public class HttpChannel implements Runnable, HttpOutput.Interceptor
|
|||
_request.setDispatcherType(null);
|
||||
}
|
||||
}
|
||||
catch (Throwable x)
|
||||
{
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("Could not perform ERROR dispatch, aborting", x);
|
||||
_transport.abort((Throwable)_request.getAttribute(RequestDispatcher.ERROR_EXCEPTION));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -514,36 +511,27 @@ public class HttpChannel implements Runnable, HttpOutput.Interceptor
|
|||
}
|
||||
|
||||
try
|
||||
{
|
||||
_state.onError(failure);
|
||||
}
|
||||
catch (Throwable e)
|
||||
{
|
||||
try
|
||||
{
|
||||
_state.onError(failure);
|
||||
failure.addSuppressed(e);
|
||||
LOG.warn("ERROR dispatch failed", failure);
|
||||
// Try to send a minimal response.
|
||||
Integer code=(Integer)_request.getAttribute(RequestDispatcher.ERROR_STATUS_CODE);
|
||||
_response.reset();
|
||||
_response.setStatus(code == null ? 500 : code);
|
||||
_response.flushBuffer();
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (Throwable x)
|
||||
{
|
||||
LOG.warn(e);
|
||||
// Error could not be handled, probably due to error thrown from error dispatch
|
||||
if (_response.isCommitted())
|
||||
{
|
||||
LOG.warn("ERROR Dispatch failed: ",failure);
|
||||
_transport.abort(failure);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Minimal response
|
||||
Integer code=(Integer)_request.getAttribute(ERROR_STATUS_CODE);
|
||||
_response.reset();
|
||||
_response.setStatus(code == null ? 500 : code);
|
||||
_response.flushBuffer();
|
||||
}
|
||||
failure.addSuppressed(x);
|
||||
_transport.abort(failure);
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
failure.addSuppressed(e);
|
||||
LOG.warn("ERROR Dispatch failed: ",failure);
|
||||
_transport.abort(failure);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isExpecting100Continue()
|
||||
|
|
|
@ -27,6 +27,8 @@ import java.util.Set;
|
|||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.eclipse.jetty.util.StringUtil;
|
||||
import org.eclipse.jetty.util.annotation.ManagedAttribute;
|
||||
import org.eclipse.jetty.util.annotation.ManagedObject;
|
||||
import org.eclipse.jetty.util.component.ContainerLifeCycle;
|
||||
import org.eclipse.jetty.util.component.DumpableCollection;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
|
@ -53,6 +55,7 @@ import org.eclipse.jetty.util.thread.Locker.Lock;
|
|||
* passivated before it is evicted from the cache.
|
||||
*
|
||||
*/
|
||||
@ManagedObject
|
||||
public abstract class AbstractSessionCache extends ContainerLifeCycle implements SessionCache
|
||||
{
|
||||
final static Logger LOG = Log.getLogger("org.eclipse.jetty.server.session");
|
||||
|
@ -257,6 +260,7 @@ public abstract class AbstractSessionCache extends ContainerLifeCycle implements
|
|||
/**
|
||||
* @see org.eclipse.jetty.server.session.SessionCache#getEvictionPolicy()
|
||||
*/
|
||||
@ManagedAttribute(value="session eviction policy", readonly=true)
|
||||
public int getEvictionPolicy()
|
||||
{
|
||||
return _evictionPolicy;
|
||||
|
@ -275,7 +279,7 @@ public abstract class AbstractSessionCache extends ContainerLifeCycle implements
|
|||
_evictionPolicy = evictionTimeout;
|
||||
}
|
||||
|
||||
|
||||
@ManagedAttribute(value="immediately save new sessions", readonly=true)
|
||||
@Override
|
||||
public boolean isSaveOnCreate()
|
||||
{
|
||||
|
@ -293,6 +297,7 @@ public abstract class AbstractSessionCache extends ContainerLifeCycle implements
|
|||
/**
|
||||
* @return true if sessions that can't be loaded are deleted from the store
|
||||
*/
|
||||
@ManagedAttribute(value="delete unreadable stored sessions", readonly=true)
|
||||
@Override
|
||||
public boolean isRemoveUnloadableSessions()
|
||||
{
|
||||
|
@ -779,6 +784,7 @@ public abstract class AbstractSessionCache extends ContainerLifeCycle implements
|
|||
*
|
||||
* @return true if an inactive session will be saved before being evicted
|
||||
*/
|
||||
@ManagedAttribute(value="save sessions before evicting from cache", readonly=true)
|
||||
@Override
|
||||
public boolean isSaveOnInactiveEviction ()
|
||||
{
|
||||
|
|
|
@ -23,6 +23,8 @@ package org.eclipse.jetty.server.session;
|
|||
import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.eclipse.jetty.util.annotation.ManagedAttribute;
|
||||
import org.eclipse.jetty.util.annotation.ManagedObject;
|
||||
import org.eclipse.jetty.util.component.AbstractLifeCycle;
|
||||
import org.eclipse.jetty.util.component.ContainerLifeCycle;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
|
@ -33,6 +35,7 @@ import org.eclipse.jetty.util.log.Logger;
|
|||
*
|
||||
*
|
||||
*/
|
||||
@ManagedObject
|
||||
public abstract class AbstractSessionDataStore extends ContainerLifeCycle implements SessionDataStore
|
||||
{
|
||||
final static Logger LOG = Log.getLogger("org.eclipse.jetty.server.session");
|
||||
|
@ -153,7 +156,9 @@ public abstract class AbstractSessionDataStore extends ContainerLifeCycle implem
|
|||
|
||||
super.doStart();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ManagedAttribute(value="interval in secs to prevent too eager session scavenging", readonly=true)
|
||||
public int getGracePeriodSec()
|
||||
{
|
||||
return _gracePeriodSec;
|
||||
|
@ -168,6 +173,7 @@ public abstract class AbstractSessionDataStore extends ContainerLifeCycle implem
|
|||
/**
|
||||
* @return the savePeriodSec
|
||||
*/
|
||||
@ManagedAttribute(value="min secs between saves", readonly=true)
|
||||
public int getSavePeriodSec()
|
||||
{
|
||||
return _savePeriodSec;
|
||||
|
|
|
@ -23,6 +23,9 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.eclipse.jetty.util.annotation.ManagedAttribute;
|
||||
import org.eclipse.jetty.util.annotation.ManagedObject;
|
||||
import org.eclipse.jetty.util.annotation.ManagedOperation;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
import org.eclipse.jetty.util.statistic.CounterStatistic;
|
||||
|
@ -32,6 +35,7 @@ import org.eclipse.jetty.util.statistic.CounterStatistic;
|
|||
*
|
||||
* A session store that keeps its sessions in memory in a hashmap
|
||||
*/
|
||||
@ManagedObject
|
||||
public class DefaultSessionCache extends AbstractSessionCache
|
||||
{
|
||||
private final static Logger LOG = Log.getLogger("org.eclipse.jetty.server.session");
|
||||
|
@ -58,6 +62,7 @@ public class DefaultSessionCache extends AbstractSessionCache
|
|||
/**
|
||||
* @return the number of sessions in the cache
|
||||
*/
|
||||
@ManagedAttribute(value="current sessions in cache", readonly=true)
|
||||
public long getSessionsCurrent ()
|
||||
{
|
||||
return _stats.getCurrent();
|
||||
|
@ -67,6 +72,7 @@ public class DefaultSessionCache extends AbstractSessionCache
|
|||
/**
|
||||
* @return the max number of sessions in the cache
|
||||
*/
|
||||
@ManagedAttribute(value="max sessions in cache", readonly=true)
|
||||
public long getSessionsMax()
|
||||
{
|
||||
return _stats.getMax();
|
||||
|
@ -76,6 +82,7 @@ public class DefaultSessionCache extends AbstractSessionCache
|
|||
/**
|
||||
* @return a running total of sessions in the cache
|
||||
*/
|
||||
@ManagedAttribute(value="total sessions in cache", readonly=true)
|
||||
public long getSessionsTotal()
|
||||
{
|
||||
return _stats.getTotal();
|
||||
|
@ -84,6 +91,7 @@ public class DefaultSessionCache extends AbstractSessionCache
|
|||
/**
|
||||
*
|
||||
*/
|
||||
@ManagedOperation(value="reset statistics", impact="ACTION")
|
||||
public void resetStats()
|
||||
{
|
||||
_stats.reset();
|
||||
|
|
|
@ -31,6 +31,8 @@ import org.eclipse.jetty.server.Server;
|
|||
import org.eclipse.jetty.server.SessionIdManager;
|
||||
import org.eclipse.jetty.server.handler.ContextHandler;
|
||||
import org.eclipse.jetty.util.StringUtil;
|
||||
import org.eclipse.jetty.util.annotation.ManagedAttribute;
|
||||
import org.eclipse.jetty.util.annotation.ManagedObject;
|
||||
import org.eclipse.jetty.util.component.ContainerLifeCycle;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
@ -49,6 +51,7 @@ import org.eclipse.jetty.util.log.Logger;
|
|||
*
|
||||
* @see HouseKeeper
|
||||
*/
|
||||
@ManagedObject
|
||||
public class DefaultSessionIdManager extends ContainerLifeCycle implements SessionIdManager
|
||||
{
|
||||
private final static Logger LOG = Log.getLogger("org.eclipse.jetty.server.session");
|
||||
|
@ -137,6 +140,7 @@ public class DefaultSessionIdManager extends ContainerLifeCycle implements Sessi
|
|||
* @return name or null
|
||||
*/
|
||||
@Override
|
||||
@ManagedAttribute(value="unique name for this node", readonly=true)
|
||||
public String getWorkerName()
|
||||
{
|
||||
return _workerName;
|
||||
|
|
|
@ -41,6 +41,8 @@ import java.util.concurrent.atomic.AtomicReference;
|
|||
|
||||
import org.eclipse.jetty.util.ClassLoadingObjectInputStream;
|
||||
import org.eclipse.jetty.util.StringUtil;
|
||||
import org.eclipse.jetty.util.annotation.ManagedAttribute;
|
||||
import org.eclipse.jetty.util.annotation.ManagedObject;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
|
@ -49,6 +51,7 @@ import org.eclipse.jetty.util.log.Logger;
|
|||
*
|
||||
* A file-based store of session data.
|
||||
*/
|
||||
@ManagedObject
|
||||
public class FileSessionDataStore extends AbstractSessionDataStore
|
||||
{
|
||||
private final static Logger LOG = Log.getLogger("org.eclipse.jetty.server.session");
|
||||
|
@ -70,6 +73,7 @@ public class FileSessionDataStore extends AbstractSessionDataStore
|
|||
super.doStop();
|
||||
}
|
||||
|
||||
@ManagedAttribute(value="dir where sessions are stored", readonly=true)
|
||||
public File getStoreDir()
|
||||
{
|
||||
return _storeDir;
|
||||
|
@ -307,6 +311,7 @@ public class FileSessionDataStore extends AbstractSessionDataStore
|
|||
* @see org.eclipse.jetty.server.session.SessionDataStore#isPassivating()
|
||||
*/
|
||||
@Override
|
||||
@ManagedAttribute(value="are sessions serialized by this store", readonly=true)
|
||||
public boolean isPassivating()
|
||||
{
|
||||
return true;
|
||||
|
|
|
@ -22,6 +22,8 @@ package org.eclipse.jetty.server.session;
|
|||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.eclipse.jetty.server.SessionIdManager;
|
||||
import org.eclipse.jetty.util.annotation.ManagedAttribute;
|
||||
import org.eclipse.jetty.util.annotation.ManagedObject;
|
||||
import org.eclipse.jetty.util.component.AbstractLifeCycle;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
@ -34,6 +36,7 @@ import org.eclipse.jetty.util.thread.Scheduler;
|
|||
* There is 1 session HouseKeeper per SessionIdManager instance.
|
||||
*
|
||||
*/
|
||||
@ManagedObject
|
||||
public class HouseKeeper extends AbstractLifeCycle
|
||||
{
|
||||
private final static Logger LOG = Log.getLogger("org.eclipse.jetty.server.session");
|
||||
|
@ -238,6 +241,7 @@ public class HouseKeeper extends AbstractLifeCycle
|
|||
*
|
||||
* @return the interval (in seconds)
|
||||
*/
|
||||
@ManagedAttribute(value="secs between scavenge cycles", readonly=true)
|
||||
public long getIntervalSec ()
|
||||
{
|
||||
return _intervalMs/1000;
|
||||
|
|
|
@ -38,6 +38,8 @@ import java.util.concurrent.atomic.AtomicInteger;
|
|||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
import org.eclipse.jetty.util.ClassLoadingObjectInputStream;
|
||||
import org.eclipse.jetty.util.annotation.ManagedAttribute;
|
||||
import org.eclipse.jetty.util.annotation.ManagedObject;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
|
@ -46,6 +48,7 @@ import org.eclipse.jetty.util.log.Logger;
|
|||
*
|
||||
* Session data stored in database
|
||||
*/
|
||||
@ManagedObject
|
||||
public class JDBCSessionDataStore extends AbstractSessionDataStore
|
||||
{
|
||||
final static Logger LOG = Log.getLogger("org.eclipse.jetty.server.session");
|
||||
|
@ -1020,6 +1023,7 @@ public class JDBCSessionDataStore extends AbstractSessionDataStore
|
|||
* @see org.eclipse.jetty.server.session.SessionDataStore#isPassivating()
|
||||
*/
|
||||
@Override
|
||||
@ManagedAttribute(value="does this store serialize sessions", readonly=true)
|
||||
public boolean isPassivating()
|
||||
{
|
||||
return true;
|
||||
|
|
|
@ -21,11 +21,15 @@ package org.eclipse.jetty.server.session;
|
|||
|
||||
import java.util.Set;
|
||||
|
||||
import org.eclipse.jetty.util.annotation.ManagedAttribute;
|
||||
import org.eclipse.jetty.util.annotation.ManagedObject;
|
||||
|
||||
/**
|
||||
* NullSessionDataStore
|
||||
*
|
||||
* Does not actually store anything, useful for testing.
|
||||
*/
|
||||
@ManagedObject
|
||||
public class NullSessionDataStore extends AbstractSessionDataStore
|
||||
{
|
||||
|
||||
|
@ -81,6 +85,7 @@ public class NullSessionDataStore extends AbstractSessionDataStore
|
|||
/**
|
||||
* @see org.eclipse.jetty.server.session.SessionDataStore#isPassivating()
|
||||
*/
|
||||
@ManagedAttribute(value="does this store serialize sessions", readonly=true)
|
||||
@Override
|
||||
public boolean isPassivating()
|
||||
{
|
||||
|
|
|
@ -57,6 +57,7 @@ import org.eclipse.jetty.server.handler.ScopedHandler;
|
|||
import org.eclipse.jetty.util.ConcurrentHashSet;
|
||||
import org.eclipse.jetty.util.StringUtil;
|
||||
import org.eclipse.jetty.util.annotation.ManagedAttribute;
|
||||
import org.eclipse.jetty.util.annotation.ManagedObject;
|
||||
import org.eclipse.jetty.util.annotation.ManagedOperation;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
@ -70,6 +71,7 @@ import org.eclipse.jetty.util.thread.Locker.Lock;
|
|||
/**
|
||||
* SessionHandler.
|
||||
*/
|
||||
@ManagedObject
|
||||
public class SessionHandler extends ScopedHandler
|
||||
{
|
||||
final static Logger LOG = Log.getLogger("org.eclipse.jetty.server.session");
|
||||
|
|
|
@ -44,7 +44,7 @@ public final class URLStreamHandlerUtil
|
|||
}
|
||||
catch(Throwable ignore)
|
||||
{
|
||||
ignore.printStackTrace(System.err);
|
||||
// ignore.printStackTrace(System.err);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,9 @@ import java.util.Map;
|
|||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
|
||||
@Ignore("Not suitable for testing on CI (as URL object is modified)")
|
||||
public class WebAppClassLoaderUrlStreamTest extends WebAppClassLoaderTest
|
||||
{
|
||||
public static class URLHandlers implements URLStreamHandlerFactory
|
||||
|
|
|
@ -17,11 +17,11 @@
|
|||
<p>To enable JAAS in a base jetty instance do:
|
||||
<pre>
|
||||
$ cd $JETTY_BASE
|
||||
$ java -jar $JETTY_HOME/start.jar --add-to-startd=jaas
|
||||
$ java -jar $JETTY_HOME/start.jar --add-to-start=jaas
|
||||
</pre>
|
||||
</p>
|
||||
<p>This will create a $JETTY_BASE/start.d/jaas.ini file to enable and parameterise JAAS. If the --add-to-start option instead, then the same initialisation will be appended to the
|
||||
$JETTY_BASE/start.ini file instead. The jetty demo-base already has JAAS enabled in the start.ini file. </p>
|
||||
<p>This will create a $JETTY_BASE/start.d/jaas.ini file to enable and parameterize JAAS. If no start.d directory exists, then the same initialisation will be appended to the
|
||||
$JETTY_BASE/start.ini file. The Jetty demo-base already has JAAS enabled in its start.ini file. </p>
|
||||
|
||||
<p>The full source of this demonstration is available <a
|
||||
href="https://github.com/eclipse/jetty.project/blob/master/tests/test-webapps/test-jaas-webapp">here</a>.</p>
|
||||
|
|
Loading…
Reference in New Issue