From 075e6a7363375cb5fe22351ae3d01b47459fe2d7 Mon Sep 17 00:00:00 2001 From: Jan Bartel Date: Fri, 14 Feb 2014 16:03:29 +1100 Subject: [PATCH] 428157 Methods of anonymous inner classes can't be called via xml --- .../session/AbstractSessionManager.java | 208 +++++++++--------- 1 file changed, 107 insertions(+), 101 deletions(-) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionManager.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionManager.java index ce32d6f3f80..f76df6864bf 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionManager.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionManager.java @@ -880,107 +880,7 @@ public abstract class AbstractSessionManager extends AbstractLifeCycle implement /* ------------------------------------------------------------ */ private SessionCookieConfig _cookieConfig = - new SessionCookieConfig() - { - @Override - public String getComment() - { - return _sessionComment; - } - - @Override - public String getDomain() - { - return _sessionDomain; - } - - @Override - public int getMaxAge() - { - return _maxCookieAge; - } - - @Override - public String getName() - { - return _sessionCookie; - } - - @Override - public String getPath() - { - return _sessionPath; - } - - @Override - public boolean isHttpOnly() - { - return _httpOnly; - } - - @Override - public boolean isSecure() - { - return _secureCookies; - } - - @Override - public void setComment(String comment) - { - if (_context != null && _context.getContextHandler().isAvailable()) - throw new IllegalStateException("CookieConfig cannot be set after ServletContext is started"); - _sessionComment = comment; - } - - @Override - public void setDomain(String domain) - { - if (_context != null && _context.getContextHandler().isAvailable()) - throw new IllegalStateException("CookieConfig cannot be set after ServletContext is started"); - _sessionDomain=domain; - } - - @Override - public void setHttpOnly(boolean httpOnly) - { - if (_context != null && _context.getContextHandler().isAvailable()) - throw new IllegalStateException("CookieConfig cannot be set after ServletContext is started"); - _httpOnly=httpOnly; - } - - @Override - public void setMaxAge(int maxAge) - { - if (_context != null && _context.getContextHandler().isAvailable()) - throw new IllegalStateException("CookieConfig cannot be set after ServletContext is started"); - _maxCookieAge=maxAge; - } - - @Override - public void setName(String name) - { - if (_context != null && _context.getContextHandler().isAvailable()) - throw new IllegalStateException("CookieConfig cannot be set after ServletContext is started"); - _sessionCookie=name; - } - - @Override - public void setPath(String path) - { - if (_context != null && _context.getContextHandler().isAvailable()) - throw new IllegalStateException("CookieConfig cannot be set after ServletContext is started"); - _sessionPath=path; - } - - @Override - public void setSecure(boolean secure) - { - if (_context != null && _context.getContextHandler().isAvailable()) - throw new IllegalStateException("CookieConfig cannot be set after ServletContext is started"); - _secureCookies=secure; - } - - }; + new CookieConfig(); /* ------------------------------------------------------------ */ @@ -1055,6 +955,112 @@ public abstract class AbstractSessionManager extends AbstractLifeCycle implement } + /** + * CookieConfig + * + * Implementation of the javax.servlet.SessionCookieConfig. + */ + public final class CookieConfig implements SessionCookieConfig + { + @Override + public String getComment() + { + return _sessionComment; + } + + @Override + public String getDomain() + { + return _sessionDomain; + } + + @Override + public int getMaxAge() + { + return _maxCookieAge; + } + + @Override + public String getName() + { + return _sessionCookie; + } + + @Override + public String getPath() + { + return _sessionPath; + } + + @Override + public boolean isHttpOnly() + { + return _httpOnly; + } + + @Override + public boolean isSecure() + { + return _secureCookies; + } + + @Override + public void setComment(String comment) + { + if (_context != null && _context.getContextHandler().isAvailable()) + throw new IllegalStateException("CookieConfig cannot be set after ServletContext is started"); + _sessionComment = comment; + } + + @Override + public void setDomain(String domain) + { + if (_context != null && _context.getContextHandler().isAvailable()) + throw new IllegalStateException("CookieConfig cannot be set after ServletContext is started"); + _sessionDomain=domain; + } + + @Override + public void setHttpOnly(boolean httpOnly) + { + if (_context != null && _context.getContextHandler().isAvailable()) + throw new IllegalStateException("CookieConfig cannot be set after ServletContext is started"); + _httpOnly=httpOnly; + } + + @Override + public void setMaxAge(int maxAge) + { + if (_context != null && _context.getContextHandler().isAvailable()) + throw new IllegalStateException("CookieConfig cannot be set after ServletContext is started"); + _maxCookieAge=maxAge; + } + + @Override + public void setName(String name) + { + if (_context != null && _context.getContextHandler().isAvailable()) + throw new IllegalStateException("CookieConfig cannot be set after ServletContext is started"); + _sessionCookie=name; + } + + @Override + public void setPath(String path) + { + if (_context != null && _context.getContextHandler().isAvailable()) + throw new IllegalStateException("CookieConfig cannot be set after ServletContext is started"); + _sessionPath=path; + } + + @Override + public void setSecure(boolean secure) + { + if (_context != null && _context.getContextHandler().isAvailable()) + throw new IllegalStateException("CookieConfig cannot be set after ServletContext is started"); + _secureCookies=secure; + } + } + /* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */