if (enterpriseBean != null && enterpriseBean.getSecurityDomain() != null)
{
String securityDomain = enterpriseBean.getSecurityDomain();
SecurityDomainImpl annotation = new SecurityDomainImpl(securityDomain);
if (dd.getUnauthenticatedPrincipal() != null)
annotation.setUnauthenticatedPrincipal(dd
.getUnauthenticatedPrincipal());
addClassAnnotation(container, annotation.annotationType(), annotation);
} else if (dd.getSecurityDomain() != null)
{
String securityDomain = dd.getSecurityDomain();
SecurityDomainImpl annotation = new SecurityDomainImpl(securityDomain);
if (dd.getUnauthenticatedPrincipal() != null)
annotation.setUnauthenticatedPrincipal(dd
.getUnauthenticatedPrincipal());
addClassAnnotation(container, annotation.annotationType(), annotation);
} else if (dd.getUnauthenticatedPrincipal() != null)
{
SecurityDomain annotation = ejbClass.getAnnotation(SecurityDomain.class);
SecurityDomainImpl override;
if (annotation != null)
{
override = new SecurityDomainImpl(annotation.value());
override.setUnauthenticatedPrincipal(dd
.getUnauthenticatedPrincipal());
}
else
{
override = new SecurityDomainImpl();
override.setUnauthenticatedPrincipal(dd.getUnauthenticatedPrincipal());
}
addClassAnnotation(container, override.annotationType(), override);
}
}