List of usage examples for javax.servlet ServletContext getServlet
@Deprecated public Servlet getServlet(String name) throws ServletException;
From source file:com.liferay.arquillian.DeployerServlet.java
private Servlet waitForServlet(ServletContext servletContext, String servletName, long timeout) { long elapsedTime = 0; Servlet found = null;/*from ww w . ja v a 2 s . c om*/ final long step = 10; while ((found == null) && (elapsedTime < timeout)) { try { Thread.sleep(step); } catch (InterruptedException e) { break; } try { found = servletContext.getServlet(servletName); } catch (ServletException e) { } elapsedTime += step; } return found; }