securityConstraint.addWebResourceCollection(webResourceColl);
for (String urlPattern : urlPatterns) {
webResourceColl.addUrlPattern(urlPattern);
}
AuthorizationConstraintImpl ac = null;
if (rolesAllowed != null && rolesAllowed.length > 0) {
if (emptyRoleSemantic == EmptyRoleSemantic.DENY) {
throw new IllegalArgumentException(localStrings.getLocalString(
"enterprise.deployment.annotation.handlers.denyWithRolesAllowed",
"One cannot specify DENY with an non-empty array of rolesAllowed in @ServletSecurity / ServletSecurityElement"));
}
ac = new AuthorizationConstraintImpl();
for (String roleName : rolesAllowed) {
Role role = new Role(roleName);
webBundleDesc.addRole(role);
ac.addSecurityRole(roleName);
}
} else if (emptyRoleSemantic == EmptyRoleSemantic.PERMIT) {
// ac is null
} else { // DENY
ac = new AuthorizationConstraintImpl();
}
securityConstraint.setAuthorizationConstraint(ac);
UserDataConstraint udc = new UserDataConstraintImpl();
udc.setTransportGuarantee(