List of usage examples for javax.security.auth.login Configuration getClass
@HotSpotIntrinsicCandidate public final native Class<?> getClass();
From source file:org.apache.ranger.audit.destination.SolrAuditDestination.java
private void resetInitializerInSOLR() { javax.security.auth.login.Configuration solrConfig = javax.security.auth.login.Configuration .getConfiguration();/*from ww w. j a v a 2s . c om*/ String solrConfigClassName = solrConfig.getClass().getName(); String solrJassConfigEnd = "SolrJaasConfiguration"; if (solrConfigClassName.endsWith(solrJassConfigEnd)) { try { Field f = solrConfig.getClass().getDeclaredField("initiateAppNames"); if (f != null) { f.setAccessible(true); HashSet<String> val = new HashSet<String>(); f.set(solrConfig, val); if (LOG.isDebugEnabled()) { LOG.debug("resetInitializerInSOLR: successfully reset the initiateAppNames"); } } else { if (LOG.isDebugEnabled()) { LOG.debug("resetInitializerInSOLR: not applying on class [" + solrConfigClassName + "] as it does not have initiateAppNames variable name."); } } } catch (Throwable t) { logError("resetInitializerInSOLR: Unable to reset SOLRCONFIG.initiateAppNames to be empty", t); } } else { if (LOG.isDebugEnabled()) { LOG.debug("resetInitializerInSOLR: not applying on class [" + solrConfigClassName + "] as it does not endwith [" + solrJassConfigEnd + "]"); } } }