Implement o.s.beans.factory.DisposableBean.
This commit is contained in:
@@ -24,6 +24,7 @@ import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
import org.apache.geode.security.AuthenticationFailedException;
|
||||
import org.apache.geode.security.ResourcePermission;
|
||||
import org.springframework.beans.factory.DisposableBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.gemfire.support.LazyWiringDeclarableSupport;
|
||||
import org.springframework.util.Assert;
|
||||
@@ -69,7 +70,7 @@ import org.springframework.util.Assert;
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
public class SecurityManagerProxy extends LazyWiringDeclarableSupport
|
||||
implements org.apache.geode.security.SecurityManager {
|
||||
implements org.apache.geode.security.SecurityManager, DisposableBean {
|
||||
|
||||
private static final AtomicReference<SecurityManagerProxy> INSTANCE = new AtomicReference<>();
|
||||
|
||||
@@ -87,7 +88,6 @@ public class SecurityManagerProxy extends LazyWiringDeclarableSupport
|
||||
.orElseThrow(() -> newIllegalStateException("SecurityManagerProxy was not configured"));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Constructs a new instance of {@link SecurityManagerProxy}, which will delegate all Apache Geode
|
||||
* security operations to a Spring managed {@link org.apache.geode.security.SecurityManager} bean.
|
||||
@@ -154,4 +154,10 @@ public class SecurityManagerProxy extends LazyWiringDeclarableSupport
|
||||
public void close() {
|
||||
getSecurityManager().close();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() throws Exception {
|
||||
super.destroy();
|
||||
INSTANCE.set(null);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user