@Override public <T extends EventListener> T createListener(Class<T> clazz) throws ServletException { try { T l = super.createListener(clazz); for (int i=_decorators.size()-1; i>=0; i--) { Decorator decorator = _decorators.get(i); l=decorator.decorateListenerInstance(l); } return l; } catch(ServletException e) { throw e; } catch(Exception e) { throw new ServletException(e); } }
@Override public <T extends EventListener> T createListener(Class<T> clazz) throws ServletException { try { T l = super.createListener(clazz); for (int i=_decorators.size()-1; i>=0; i--) { Decorator decorator = _decorators.get(i); l=decorator.decorateListenerInstance(l); } return l; } catch(ServletException e) { throw e; } catch(Exception e) { throw new ServletException(e); } }
@Override public <T extends EventListener> T createListener(Class<T> clazz) throws ServletException { try { T l = super.createListener(clazz); for (int i=_decorators.size()-1; i>=0; i--) { Decorator decorator = _decorators.get(i); l=decorator.decorateListenerInstance(l); } return l; } catch(ServletException e) { throw e; } catch(Exception e) { throw new ServletException(e); } }
@Override public <T extends EventListener> T createListener(Class<T> clazz) throws ServletException { try { T l = super.createListener(clazz); for (int i=_decorators.size()-1; i>=0; i--) { Decorator decorator = _decorators.get(i); l=decorator.decorateListenerInstance(l); } return l; } catch(ServletException e) { throw e; } catch(Exception e) { throw new ServletException(e); } }
/** * @param context * @param clazz * @return the new event listener * @throws ServletException * @throws InstantiationException * @throws IllegalAccessException */ protected EventListener newListenerInstance(WebAppContext context,Class<? extends EventListener> clazz) throws ServletException, InstantiationException, IllegalAccessException { try { return context.getServletContext().createListener(clazz); } catch (ServletException se) { Throwable cause = se.getRootCause(); if (cause instanceof InstantiationException) throw (InstantiationException)cause; if (cause instanceof IllegalAccessException) throw (IllegalAccessException)cause; throw se; } }
/** * @param context * @param clazz * @return the new event listener * @throws ServletException * @throws InstantiationException * @throws IllegalAccessException */ protected EventListener newListenerInstance(WebAppContext context,Class<? extends EventListener> clazz) throws ServletException, InstantiationException, IllegalAccessException { try { return context.getServletContext().createListener(clazz); } catch (ServletException se) { Throwable cause = se.getRootCause(); if (cause instanceof InstantiationException) throw (InstantiationException)cause; if (cause instanceof IllegalAccessException) throw (IllegalAccessException)cause; throw se; } }
/** * @param context * @param clazz * @return the new event listener * @throws ServletException * @throws InstantiationException * @throws IllegalAccessException */ protected EventListener newListenerInstance(WebAppContext context,Class<? extends EventListener> clazz) throws ServletException, InstantiationException, IllegalAccessException { try { return context.getServletContext().createListener(clazz); } catch (ServletException se) { Throwable cause = se.getRootCause(); if (cause instanceof InstantiationException) throw (InstantiationException)cause; if (cause instanceof IllegalAccessException) throw (IllegalAccessException)cause; throw se; } }
@Override public void addListener(Class<? extends EventListener> listenerClass) { if (!_enabled) throw new UnsupportedOperationException(); try { EventListener e = createListener(listenerClass); ContextHandler.this.addEventListener(e); ContextHandler.this.addProgrammaticListener(e); } catch (ServletException e) { throw new IllegalArgumentException(e); } }
@Override public void addListener(Class<? extends EventListener> listenerClass) { if (!_enabled) throw new UnsupportedOperationException(); try { EventListener e = createListener(listenerClass); addListener(e); } catch (ServletException e) { throw new IllegalArgumentException(e); } }
@Override public void addListener(Class<? extends EventListener> listenerClass) { if (!_enabled) throw new UnsupportedOperationException(); try { EventListener e = createListener(listenerClass); ContextHandler.this.addEventListener(e); ContextHandler.this.restrictEventListener(e); } catch (ServletException e) { throw new IllegalArgumentException(e); } }
@Override public void addListener(Class<? extends EventListener> listenerClass) { if (!_enabled) throw new UnsupportedOperationException(); try { EventListener e = createListener(listenerClass); ContextHandler.this.addEventListener(e); ContextHandler.this.restrictEventListener(e); } catch (ServletException e) { throw new IllegalArgumentException(e); } }
@Override public void addListener(Class<? extends EventListener> listenerClass) { if (!_enabled) throw new UnsupportedOperationException(); try { EventListener e = createListener(listenerClass); addListener(e); } catch (ServletException e) { throw new IllegalArgumentException(e); } }
@Override public <T extends AsyncListener> T createListener(Class<T> clazz) throws ServletException { ContextHandler contextHandler = state().getContextHandler(); if (contextHandler != null) return contextHandler.getServletContext().createListener(clazz); try { return clazz.getDeclaredConstructor().newInstance(); } catch (Exception e) { throw new ServletException(e); } }
@Override public <T extends AsyncListener> T createListener(Class<T> clazz) throws ServletException { ContextHandler contextHandler = state().getContextHandler(); if (contextHandler != null) return contextHandler.getServletContext().createListener(clazz); try { return clazz.newInstance(); } catch (Exception e) { throw new ServletException(e); } }
@Override public void addListener(Class<? extends EventListener> listenerClass) { if (!_enabled) throw new UnsupportedOperationException(); try { EventListener e = createListener(listenerClass); addListener(e); } catch (ServletException e) { throw new IllegalArgumentException(e); } }
@Override public void addListener(Class<? extends EventListener> listenerClass) { if (!_enabled) throw new UnsupportedOperationException(); try { EventListener e = createListener(listenerClass); ContextHandler.this.addEventListener(e); ContextHandler.this.restrictEventListener(e); } catch (ServletException e) { throw new IllegalArgumentException(e); } }
@Override public void addListener(Class<? extends EventListener> listenerClass) { if (!_enabled) throw new UnsupportedOperationException(); try { EventListener e = createListener(listenerClass); ContextHandler.this.addEventListener(e); ContextHandler.this.restrictEventListener(e); } catch (ServletException e) { throw new IllegalArgumentException(e); } }
@Override public void addListener(Class<? extends EventListener> listenerClass) { if (!_enabled) throw new UnsupportedOperationException(); try { EventListener e = createListener(listenerClass); ContextHandler.this.addEventListener(e); ContextHandler.this.restrictEventListener(e); } catch (ServletException e) { throw new IllegalArgumentException(e); } }
@Override public void addListener(Class<? extends EventListener> listenerClass) { if (!_enabled) throw new UnsupportedOperationException(); try { EventListener e = createListener(listenerClass); ContextHandler.this.addEventListener(e); ContextHandler.this.addProgrammaticListener(e); } catch (ServletException e) { throw new IllegalArgumentException(e); } }
@Override public <T extends AsyncListener> T createListener(Class<T> clazz) throws ServletException { ContextHandler contextHandler = state().getContextHandler(); if (contextHandler != null) return contextHandler.getServletContext().createListener(clazz); try { return clazz.newInstance(); } catch (Exception e) { throw new ServletException(e); } }