Implement o.s.beans.factory.DisposableBean.

This commit is contained in:
John Blum
2018-05-31 12:57:24 -07:00
parent 1f9b97f4ee
commit 5b7d274723

View File

@@ -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);
}
}