Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Bartel2012-11-04 22:58:53 -0500
committerJan Bartel2012-11-04 22:58:53 -0500
commit69cf9285c61e6210ecfd018c177ca4d7ec6143dd (patch)
tree88082ef1971685b0faea32d01b308ef0b34146f9 /jetty-security/src
parent0c84eefdcc0388d227777c63e26a4dbe436cbb8c (diff)
downloadorg.eclipse.jetty.project-69cf9285c61e6210ecfd018c177ca4d7ec6143dd.tar.gz
org.eclipse.jetty.project-69cf9285c61e6210ecfd018c177ca4d7ec6143dd.tar.xz
org.eclipse.jetty.project-69cf9285c61e6210ecfd018c177ca4d7ec6143dd.zip
JETTY-1549 jetty-maven-plugin fails to reload the LoginService properly
Diffstat (limited to 'jetty-security/src')
-rw-r--r--jetty-security/src/main/java/org/eclipse/jetty/security/SecurityHandler.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/jetty-security/src/main/java/org/eclipse/jetty/security/SecurityHandler.java b/jetty-security/src/main/java/org/eclipse/jetty/security/SecurityHandler.java
index 6be460e0b8..c0fdaccf31 100644
--- a/jetty-security/src/main/java/org/eclipse/jetty/security/SecurityHandler.java
+++ b/jetty-security/src/main/java/org/eclipse/jetty/security/SecurityHandler.java
@@ -74,6 +74,8 @@ public abstract class SecurityHandler extends HandlerWrapper implements Authenti
private LoginService _loginService;
private IdentityService _identityService;
private boolean _renewSession=true;
+ private boolean _discoveredIdentityService = false;
+ private boolean _discoveredLoginService = false;
/* ------------------------------------------------------------ */
protected SecurityHandler()
@@ -338,7 +340,10 @@ public abstract class SecurityHandler extends HandlerWrapper implements Authenti
// many different ways these can be constructed and injected.
if (_loginService==null)
+ {
setLoginService(findLoginService());
+ _discoveredLoginService = true;
+ }
if (_identityService==null)
{
@@ -350,6 +355,7 @@ public abstract class SecurityHandler extends HandlerWrapper implements Authenti
if (_identityService==null && _realmName!=null)
setIdentityService(new DefaultIdentityService());
+ _discoveredIdentityService = true;
}
if (_loginService!=null)
@@ -375,6 +381,26 @@ public abstract class SecurityHandler extends HandlerWrapper implements Authenti
super.doStart();
}
+ @Override
+ protected void doStop() throws Exception
+ {
+ //if we discovered the services (rather than had them explicitly configured), remove them.
+ if (_discoveredIdentityService)
+ {
+ removeBean(_identityService);
+ _identityService = null;
+
+ }
+
+ if (_discoveredLoginService)
+ {
+ removeBean(_loginService);
+ _loginService = null;
+ }
+
+ super.doStop();
+ }
+
/* ------------------------------------------------------------ */
protected boolean checkSecurity(Request request)
{

Back to the top