final boolean notLoggedIn = !subject.isAuthenticated();
final Class<? extends Page> page = notLoggedIn ? loginPage : unauthorizedPage;
if (annotationStrategy != null)
{
final ShiroSecurityConstraint fail = annotationStrategy.checkInvalidInstantiation(component.getClass());
if (fail != null)
if (notLoggedIn)
addLoginMessagesAndGetPage(fail, component, page);
else
addUnauthorizedMessagesAndGetPage(fail, component, page);