protected Interceptor create(final Component component, final InterceptorFactoryContext context) {
if (component instanceof EJBComponent == false) {
throw new IllegalStateException("Unexpected component type: " + component.getClass() + " expected: " + EJBComponent.class);
}
final EJBComponent ejbComponent = (EJBComponent) component;
final SimpleSecurityManager securityManager = ejbComponent.getSecurityManager();
final EJBSecurityMetaData securityMetaData = ejbComponent.getSecurityMetaData();
final String securityDomain = securityMetaData.getSecurityDomain();
if (securityDomain == null) {
throw new IllegalStateException("EJB " + ejbComponent.getComponentName() + " is enabled for security but doesn't have a security domain set");
}