super(SecurityDomain.class);
}
protected List<? extends MetaDataVisitorNode> internalApplyAnnotation(ClassInfo info, MetaData retrieval, SecurityDomain annotation, KernelControllerContext context) throws Throwable
{
Dependency dependency = annotation.annotationType().getAnnotation(Dependency.class);
if (dependency == null)
throw new IllegalArgumentException("Null @Dependency.");
DependencyInfo dependencies = context.getDependencyInfo();
SecurityDomainDependencyFactory factory = null;
// try to find existing security domain dependency factory
// or what ever kind of lookup
KernelController controller = context.getKernel().getController();
ControllerContext smCC = controller.getInstalledContext(annotation.securityManagerName());
if (smCC != null)
{
Object target = smCC.getTarget();
if (target != null && target instanceof SecurityDomainDependencyFactory)
factory = SecurityDomainDependencyFactory.class.cast(target);
}
if (factory == null)
factory = (SecurityDomainDependencyFactory)dependency.factory().newInstance();
DependencyItem item = factory.createDependencyItem(annotation, dependency);
dependencies.addIDependOn(item);
return null;