protected void prependHandler (Handler handler, HandlerCollection handlers) { if (handler == null || handlers == null) return; Handler[] existing = handlers.getChildHandlers(); Handler[] children = new Handler[existing.length + 1]; children[0] = handler; System.arraycopy(existing, 0, children, 1, existing.length); handlers.setHandlers(children); }
@Override public void destroy() { if (!isStopped()) throw new IllegalStateException("!STOPPED"); Handler[] children=getChildHandlers(); setHandlers(null); for (Handler child: children) child.destroy(); super.destroy(); } }
@Override public void destroy() { if (!isStopped()) throw new IllegalStateException("!STOPPED"); Handler[] children=getChildHandlers(); setHandlers(null); for (Handler child: children) child.destroy(); super.destroy(); } }
@Override public void destroy() { if (!isStopped()) throw new IllegalStateException("!STOPPED"); Handler[] children=getChildHandlers(); setHandlers(null); for (Handler child: children) child.destroy(); super.destroy(); } }
@Override public void destroy() { if (!isStopped()) throw new IllegalStateException("!STOPPED"); Handler[] children=getChildHandlers(); setHandlers(null); for (Handler child: children) child.destroy(); super.destroy(); } }
@Override public void destroy() { if (!isStopped()) throw new IllegalStateException("!STOPPED"); Handler[] children=getChildHandlers(); setHandlers(null); for (Handler child: children) child.destroy(); super.destroy(); } }
@Override public void destroy() { if (!isStopped()) throw new IllegalStateException("!STOPPED"); Handler[] children=getChildHandlers(); setHandlers(null); for (Handler child: children) child.destroy(); super.destroy(); } }
@Override public void destroy() { if (!isStopped()) throw new IllegalStateException("!STOPPED"); Handler[] children=getChildHandlers(); setHandlers(null); for (Handler child: children) child.destroy(); super.destroy(); } }
@Override public void destroy() { if (!isStopped()) throw new IllegalStateException("!STOPPED"); Handler[] children=getChildHandlers(); setHandlers(null); for (Handler child: children) child.destroy(); super.destroy(); }
@Override public void destroy() { if (!isStopped()) throw new IllegalStateException("!STOPPED"); Handler[] children=getChildHandlers(); setHandlers(null); for (Handler child: children) child.destroy(); super.destroy(); }
@Override public void destroy() { if (!isStopped()) throw new IllegalStateException("!STOPPED"); Handler[] children=getChildHandlers(); setHandlers(null); for (Handler child: children) child.destroy(); super.destroy(); }
/** * Returns the context path that this microservice is using. * <p> * The value is determined by looking at the <code>Server/Handlers[ServletContextHandler]/contextPath</code> value * in the Jetty configuration. * * @return The context path that this microservice is using. */ public String getContextPath() { for (Handler h : getServer().getHandlers()) { if (h instanceof HandlerCollection) { for (Handler h2 : ((HandlerCollection)h).getChildHandlers()) if (h2 instanceof ServletContextHandler) return ((ServletContextHandler)h2).getContextPath(); } if (h instanceof ServletContextHandler) return ((ServletContextHandler)h).getContextPath(); } throw new RuntimeException("Could not locate ServletContextHandler in Jetty server."); }
/** * Returns the context path that this microservice is using. * <p> * The value is determined by looking at the <code>Server/Handlers[ServletContextHandler]/contextPath</code> value * in the Jetty configuration. * * @return The context path that this microservice is using. */ public String getContextPath() { for (Handler h : getServer().getHandlers()) { if (h instanceof HandlerCollection) for (Handler h2 : ((HandlerCollection)h).getChildHandlers()) if (h2 instanceof ServletContextHandler) return ((ServletContextHandler)h2).getContextPath(); if (h instanceof ServletContextHandler) return ((ServletContextHandler)h).getContextPath(); } throw new RuntimeException("Could not locate ServletContextHandler in Jetty server."); }