@Override
 public <T extends EventListener> void addListener(T t) {
   if (SecurityUtil.isPackageProtectionEnabled()) {
     doPrivileged("addListener", new Object[] {t.getClass().getName()});
   } else {
     context.addListener(t);
   }
 }
 @Override
 public void addListener(Class<? extends EventListener> listenerClass) {
   if (SecurityUtil.isPackageProtectionEnabled()) {
     doPrivileged("addListener", new Object[] {listenerClass.getName()});
   } else {
     context.addListener(listenerClass);
   }
 }
 @Override
 public void addListener(String className) {
   if (SecurityUtil.isPackageProtectionEnabled()) {
     doPrivileged("addListener", new Object[] {className});
   } else {
     context.addListener(className);
   }
 }
Esempio n. 4
0
 @Override
 public void addListener(final String className) {
   try {
     Class<? extends EventListener> clazz =
         (Class<? extends EventListener>) deploymentInfo.getClassLoader().loadClass(className);
     addListener(clazz);
   } catch (ClassNotFoundException e) {
     throw new IllegalArgumentException(e);
   }
 }