Refine search
/** * Stops the managed lifecycle beans in the reverse order they were added. */ @Override protected void doStop() throws Exception { _doStarted = false; super.doStop(); List<Bean> reverse = new ArrayList<>(_beans); Collections.reverse(reverse); MultiException mex = new MultiException(); for (Bean b : reverse) { if (b._managed==Managed.MANAGED && b._bean instanceof LifeCycle) { LifeCycle l = (LifeCycle)b._bean; try { stop(l); } catch (Throwable th) { mex.add(th); } } } mex.ifExceptionThrow(); }
@Override public void destroy() { // Prepare for configuration MultiException mx=new MultiException(); if (_configurations!=null) { for (int i=_configurations.size();i-->0;) { try { _configurations.get(i).destroy(this); } catch(Exception e) { mx.add(e); } } } _configurations.clear(); super.destroy(); mx.ifExceptionThrowRuntime(); }
private MultiException addMultiException(MultiException exception, Exception e) { if(exception == null){ exception = new MultiException(); } exception.add(e); return exception; }
_handlers[i].handle(target,baseRequest, request, response); mex=new MultiException(); mex.add(e); if (mex.size()==1) throw new ServletException(mex.getThrowable(0)); else throw new ServletException(mex);
MultiException mex = new MultiException(); for (int i=0;handlers!=null && i<handlers.length;i++) if (handlers[i].getServer()!=server) handlers[i].setServer(server); if (old_handlers[i].isStarted()) old_handlers[i].stop(); mex.add(e); mex.ifExceptionThrowRuntime();
HttpGenerator.setServerVersion(__version); MultiException mex=new MultiException(); mex.add(e); if (_connectors!=null && mex.size()==0) catch(Throwable e) mex.add(e); dumpStdErr(); mex.ifExceptionThrow();
@Override protected void doStop() throws Exception { MultiException mex=new MultiException(); try { super.doStop(); } catch(Throwable e){mex.add(e);} if (_handlers!=null) { for (int i=_handlers.length;i-->0;) try{_handlers[i].stop();}catch(Throwable e){mex.add(e);} } mex.ifExceptionThrow(); }
@Override protected void doStart() throws Exception final MultiException mex=new MultiException(); if (_handlers!=null) try{_handlers[i].start();} catch(Throwable e){mex.add(e);} mex.ifExceptionThrow();
/** * Delete any tmp storage for parts, and clear out the parts list. * * @throws MultiException */ public void deleteParts () throws MultiException { Collection<Part> parts = getParsedParts(); MultiException err = new MultiException(); for (Part p:parts) { try { ((MultiPartInputStreamParser.MultiPart)p).cleanUp(); } catch(Exception e) { err.add(e); } } _parts.clear(); err.ifExceptionThrowMulti(); }
/** Throw a multiexception. * If this multi exception is empty then no action is taken. If it * contains a any exceptions then this * multi exception is thrown. * @throws MultiException the multiexception if there are nested exception */ public void ifExceptionThrowMulti() throws MultiException { if(nested == null) return; if (nested.size()>0) { throw new MultiException(nested); } }
exception.ifExceptionThrow();
/** * Get closest cause, which is defined here as the first exception in a MultiException. * * @param t MultiException * @return First in the MultiException */ @Override public Throwable getProximateCause(Throwable t) { if (t instanceof MultiException) { MultiException m = (MultiException) t; if (m.size() > 0) return m.getThrowable(0); } return t; }
@Override public void run() { try { p.call(); } catch (Exception e) { me.add(e); } finally { task_limit.release(); latch.countDown(); } } });
_handlers[i].handle(target,baseRequest, request, response); mex=new MultiException(); mex.add(e); if (mex.size()==1) throw new ServletException(mex.getThrowable(0)); else throw new ServletException(mex);
MultiException mex = new MultiException(); for (int i=0;handlers!=null && i<handlers.length;i++) if (handlers[i].getServer()!=server) handlers[i].setServer(server); if (old_handlers[i].isStarted()) old_handlers[i].stop(); mex.add(e); mex.ifExceptionThrowRuntime();
HttpGenerator.setServerVersion(__version); MultiException mex=new MultiException(); mex.add(e); if (_connectors!=null && mex.size()==0) catch(Throwable e) mex.add(e); dumpStdErr(); mex.ifExceptionThrow();
@Override protected void doStop() throws Exception { MultiException mex=new MultiException(); try { super.doStop(); } catch(Throwable e){mex.add(e);} if (_handlers!=null) { for (int i=_handlers.length;i-->0;) try{_handlers[i].stop();}catch(Throwable e){mex.add(e);} } mex.ifExceptionThrow(); }
@Override protected void doStart() throws Exception final MultiException mex=new MultiException(); if (_handlers!=null) try{_handlers[i].start();} catch(Throwable e){mex.add(e);} mex.ifExceptionThrow();
/** * Delete any tmp storage for parts, and clear out the parts list. * * @throws MultiException */ public void deleteParts () throws MultiException { Collection<Part> parts = getParsedParts(); MultiException err = new MultiException(); for (Part p:parts) { try { ((MultiPartInputStream.MultiPart)p).cleanUp(); } catch(Exception e) { err.add(e); } } _parts.clear(); err.ifExceptionThrowMulti(); }