/** Adds the listener with the given class name to this ServletContext. */ @Override public void addListener(String className) { if (SecurityUtil.isPackageProtectionEnabled()) { doPrivileged("addListener", new Object[] {className}); } else { context.addListener(className); } }
/** Adds a listener of the given class type to this ServletContext. */ @Override public void addListener(Class<? extends EventListener> listenerClass) { if (SecurityUtil.isPackageProtectionEnabled()) { doPrivileged( "addListener", new Class[] {Class.class}, new Object[] {listenerClass.getName()}); } else { context.addListener(listenerClass); } }
/** Adds the given listener to this ServletContext. */ @Override public <T extends EventListener> void addListener(T t) { if (SecurityUtil.isPackageProtectionEnabled()) { doPrivileged( "addListener", new Class[] {EventListener.class}, new Object[] {t.getClass().getName()}); } else { context.addListener(t); } }