public static void merge(JBossServletMetaData dest, JBossServletMetaData override, ServletMetaData original) { ServletMetaDataMerger.merge(dest, override, original); if (override != null && override.getRunAsPrincipal() != null) dest.setRunAsPrincipal(override.getRunAsPrincipal()); if (override != null && override.getServletSecurity() != null) dest.setServletSecurity(override.getServletSecurity()); if(override != null && override.getExecutorName() != null) { dest.setExecutorName(override.getExecutorName()); } } }
@Deprecated public void resolveRunAs() { // Update run-as indentity for a run-as-principal if (servlets != null) { for (JBossServletMetaData servlet : servlets) { String servletName = servlet.getServletName(); String principalName = servlet.getRunAsPrincipal(); // Get the web.xml run-as primary role String webXmlRunAs = null; if (servlet.getRunAs() != null) { webXmlRunAs = servlet.getRunAs().getRoleName(); } if (principalName != null) { // Update the run-as indentity to use the principal name if (webXmlRunAs == null) { // Needs to be merged from Annotations webXmlRunAs = "PLACEHOLDER_FOR_ANNOTATION"; // throw new IllegalStateException("run-as-principal: " // + principalName + // " found in jboss-web.xml but there was no run-as in web.xml"); } // See if there are any additional roles for this principal Set<String> extraRoles = securityRoles.getSecurityRoleNamesByPrincipal(principalName); RunAsIdentityMetaData runAsId = new RunAsIdentityMetaData(webXmlRunAs, principalName, extraRoles); runAsIdentity.put(servletName, runAsId); } else if (webXmlRunAs != null) { RunAsIdentityMetaData runAsId = new RunAsIdentityMetaData(webXmlRunAs, null); runAsIdentity.put(servletName, runAsId); } } } }
String principalName = servlet.getRunAsPrincipal();
String principalName = servlet.getRunAsPrincipal();
String principalName = servlet.getRunAsPrincipal();