/** * Checks whether this context contains the given Servlet instance */ public boolean hasServlet(Servlet servlet) { for (Map.Entry<String, Container> e : children.entrySet()) { if (servlet == ((StandardWrapper)e.getValue()).getServlet()) { return true; } } return false; }
/** * {@inheritDoc} */ @Override public void servletSecurityAnnotationScan() throws ServletException { if (getServlet() == null) { Class<?> clazz = null; try { clazz = ((Context) getParent()).getLoader().getClassLoader().loadClass( getServletClass()); processServletSecurityAnnotation(clazz); } catch (ClassNotFoundException e) { // Safe to ignore. No class means no annotations to process } } else { if (servletSecurityAnnotationScanRequired) { processServletSecurityAnnotation(getServlet().getClass()); } } }
Class<? extends Servlet> clazz = wrapper.getServletClass(); if (clazz == null) { if (wrapper.getServlet() != null) { clazz = wrapper.getServlet().getClass(); } else { try {
/** * Execute a periodic task, such as reloading, etc. This method will be * invoked inside the classloading context of this container. Unexpected * throwables will be caught and logged. */ public void backgroundProcess() { super.backgroundProcess(); if (!started) return; if (getServlet() != null && (getServlet() instanceof PeriodicEventListener)) { ((PeriodicEventListener) getServlet()).periodicEvent(); } }
/** * {@inheritDoc} * @throws ClassNotFoundException */ @Override public void servletSecurityAnnotationScan() throws ServletException { if (getServlet() == null) { Class<?> clazz = null; try { clazz = getParent().getLoader().getClassLoader().loadClass( getServletClass()); processServletSecurityAnnotation(clazz); } catch (ClassNotFoundException e) { // Safe to ignore. No class means no annotations to process } } else { if (servletSecurityAnnotationScanRequired) { processServletSecurityAnnotation(getServlet().getClass()); } } }
/** * Execute a periodic task, such as reloading, etc. This method will be * invoked inside the classloading context of this container. Unexpected * throwables will be caught and logged. */ public void backgroundProcess() { super.backgroundProcess(); if (!started) return; if (getServlet() != null && (getServlet() instanceof PeriodicEventListener)) { ((PeriodicEventListener) getServlet()).periodicEvent(); } }
/** * {@inheritDoc} */ @Override public void servletSecurityAnnotationScan() throws ServletException { if (getServlet() == null) { Class<?> clazz = null; try { clazz = getParent().getLoader().getClassLoader().loadClass( getServletClass()); processServletSecurityAnnotation(clazz); } catch (ClassNotFoundException e) { // Safe to ignore. No class means no annotations to process } } else { if (servletSecurityAnnotationScanRequired) { processServletSecurityAnnotation(getServlet().getClass()); } } }
/** * Execute a periodic task, such as reloading, etc. This method will be * invoked inside the classloading context of this container. Unexpected * throwables will be caught and logged. */ @Override public void backgroundProcess() { super.backgroundProcess(); if (!getState().isAvailable()) return; if (getServlet() != null && (getServlet() instanceof PeriodicEventListener)) { ((PeriodicEventListener) getServlet()).periodicEvent(); } }
/** * Execute a periodic task, such as reloading, etc. This method will be * invoked inside the classloading context of this container. Unexpected * throwables will be caught and logged. */ @Override public void backgroundProcess() { super.backgroundProcess(); if (!getState().isAvailable()) return; if (getServlet() != null && (getServlet() instanceof PeriodicEventListener)) { ((PeriodicEventListener) getServlet()).periodicEvent(); } }
/** * Execute a periodic task, such as reloading, etc. This method will be * invoked inside the classloading context of this container. Unexpected * throwables will be caught and logged. */ @Override public void backgroundProcess() { super.backgroundProcess(); if (!getState().isAvailable()) return; if (getServlet() != null && (getServlet() instanceof PeriodicEventListener)) { ((PeriodicEventListener) getServlet()).periodicEvent(); } }
/** * Execute a periodic task, such as reloading, etc. This method will be * invoked inside the classloading context of this container. Unexpected * throwables will be caught and logged. */ @Override public void backgroundProcess() { super.backgroundProcess(); if (!getState().isAvailable()) return; if (getServlet() != null && (getServlet() instanceof PeriodicEventListener)) { ((PeriodicEventListener) getServlet()).periodicEvent(); } }
/** * Execute a periodic task, such as reloading, etc. This method will be * invoked inside the classloading context of this container. Unexpected * throwables will be caught and logged. */ @Override public void backgroundProcess() { super.backgroundProcess(); if (!getState().isAvailable()) return; if (getServlet() != null && (getServlet() instanceof PeriodicEventListener)) { ((PeriodicEventListener) getServlet()).periodicEvent(); } }
/** * Execute a periodic task, such as reloading, etc. This method will be * invoked inside the classloading context of this container. Unexpected * throwables will be caught and logged. */ @Override public void backgroundProcess() { super.backgroundProcess(); if (!getState().isAvailable()) return; if (getServlet() != null && (getServlet() instanceof PeriodicEventListener)) { ((PeriodicEventListener) getServlet()).periodicEvent(); } }
/** * Execute a periodic task, such as reloading, etc. This method will be * invoked inside the classloading context of this container. Unexpected * throwables will be caught and logged. */ @Override public void backgroundProcess() { super.backgroundProcess(); if (!getState().isAvailable()) return; if (getServlet() instanceof PeriodicEventListener) { ((PeriodicEventListener) getServlet()).periodicEvent(); } }
/** * Enables or disables directory listings on this <tt>Context</tt>. */ public void setDirectoryListing(boolean directoryListing) { this.directoryListing = directoryListing; Wrapper wrapper = (Wrapper) findChild( org.apache.catalina.core.Constants.DEFAULT_SERVLET_NAME); if (wrapper !=null) { Servlet servlet = ((StandardWrapper)wrapper).getServlet(); if (servlet instanceof DefaultServlet) { ((DefaultServlet)servlet).setListings(directoryListing); } } }
/** * Execute a periodic task, such as reloading, etc. This method will be * invoked inside the classloading context of this container. Unexpected * throwables will be caught and logged. */ @Override public void backgroundProcess() { super.backgroundProcess(); if (!getState().isAvailable()) return; if (getServlet() instanceof PeriodicEventListener) { ((PeriodicEventListener) getServlet()).periodicEvent(); } }
for (Map.Entry<String, Container> e : children.entrySet()) { if (servletName.equals(e.getKey()) || servlet == ((StandardWrapper)e.getValue()).getServlet()) { return null;