Commit f2b12194 authored by Daniel Henninger's avatar Daniel Henninger Committed by dhenninger

[JM-1292] Fixed NPE because security auditor wasn't initializing properly.


git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/branches@10043 b35dd754-fafc-0310-a699-88a17e54d16e
parent 69208a83
...@@ -35,8 +35,8 @@ import java.util.Date; ...@@ -35,8 +35,8 @@ import java.util.Date;
public class LockOutManager { public class LockOutManager {
// Wrap this guy up so we can mock out the LockOutManager class. // Wrap this guy up so we can mock out the LockOutManager class.
private static final class LockOutManagerContainer { private static class LockOutManagerContainer {
private static final LockOutManager instance = new LockOutManager(); private static LockOutManager instance = new LockOutManager();
} }
/** /**
...@@ -48,7 +48,7 @@ public class LockOutManager { ...@@ -48,7 +48,7 @@ public class LockOutManager {
* @return the current LockOutProvider. * @return the current LockOutProvider.
*/ */
public static LockOutProvider getLockOutProvider() { public static LockOutProvider getLockOutProvider() {
return provider; return LockOutManagerContainer.instance.provider;
} }
/** /**
...@@ -62,7 +62,7 @@ public class LockOutManager { ...@@ -62,7 +62,7 @@ public class LockOutManager {
/* Cache of locked out accounts */ /* Cache of locked out accounts */
private Cache<String,LockOutFlag> lockOutCache; private Cache<String,LockOutFlag> lockOutCache;
private static LockOutProvider provider = null; private LockOutProvider provider;
/** /**
* Constructs a LockOutManager, setting up it's cache, propery listener, and setting up the provider. * Constructs a LockOutManager, setting up it's cache, propery listener, and setting up the provider.
...@@ -101,7 +101,7 @@ public class LockOutManager { ...@@ -101,7 +101,7 @@ public class LockOutManager {
* Initializes the server's lock out provider, based on configuration and defaults to * Initializes the server's lock out provider, based on configuration and defaults to
* DefaultLockOutProvider if the specified provider is not valid or not specified. * DefaultLockOutProvider if the specified provider is not valid or not specified.
*/ */
private static void initProvider() { private void initProvider() {
String className = JiveGlobals.getXMLProperty("provider.lockout.className", String className = JiveGlobals.getXMLProperty("provider.lockout.className",
"org.jivesoftware.openfire.lockout.DefaultLockOutProvider"); "org.jivesoftware.openfire.lockout.DefaultLockOutProvider");
// Check if we need to reset the provider class // Check if we need to reset the provider class
......
...@@ -34,8 +34,8 @@ import java.util.Date; ...@@ -34,8 +34,8 @@ import java.util.Date;
public class SecurityAuditManager { public class SecurityAuditManager {
// Wrap this guy up so we can mock out the SecurityAuditManager class. // Wrap this guy up so we can mock out the SecurityAuditManager class.
private static final class SecurityAuditManagerContainer { private static class SecurityAuditManagerContainer {
private static final SecurityAuditManager instance = new SecurityAuditManager(); private static SecurityAuditManager instance = new SecurityAuditManager();
} }
/** /**
...@@ -47,7 +47,7 @@ public class SecurityAuditManager { ...@@ -47,7 +47,7 @@ public class SecurityAuditManager {
* @return the current SecurityAuditProvider. * @return the current SecurityAuditProvider.
*/ */
public static SecurityAuditProvider getSecurityAuditProvider() { public static SecurityAuditProvider getSecurityAuditProvider() {
return provider; return SecurityAuditManagerContainer.instance.provider;
} }
/** /**
...@@ -59,7 +59,7 @@ public class SecurityAuditManager { ...@@ -59,7 +59,7 @@ public class SecurityAuditManager {
return SecurityAuditManagerContainer.instance; return SecurityAuditManagerContainer.instance;
} }
private static SecurityAuditProvider provider = null; private SecurityAuditProvider provider;
/** /**
* Constructs a SecurityAuditManager, setting up the provider, and a listener. * Constructs a SecurityAuditManager, setting up the provider, and a listener.
...@@ -95,7 +95,7 @@ public class SecurityAuditManager { ...@@ -95,7 +95,7 @@ public class SecurityAuditManager {
* Initializes the server's security audit provider, based on configuration and defaults to * Initializes the server's security audit provider, based on configuration and defaults to
* DefaultSecurityAuditProvider if the specified provider is not valid or not specified. * DefaultSecurityAuditProvider if the specified provider is not valid or not specified.
*/ */
private static void initProvider() { private void initProvider() {
String className = JiveGlobals.getXMLProperty("provider.securityAudit.className", String className = JiveGlobals.getXMLProperty("provider.securityAudit.className",
"org.jivesoftware.openfire.security.DefaultSecurityAuditProvider"); "org.jivesoftware.openfire.security.DefaultSecurityAuditProvider");
// Check if we need to reset the provider class // Check if we need to reset the provider class
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment