public void error(final String message) { log_.error(message); }
public void error(final String message, final Throwable throwable) { log_.error(message, throwable); }
public final void stop() { if (!started_) { return; } try { doStop(); } catch (Throwable t) { log_.error("Can't stop PageAbilityAlfr gracefully: " + getClass(), t); } pagePlugin_ = null; pageAlfr_ = null; started_ = false; }
public void doHandle(HttpServletRequest request, HttpServletResponse response, Exception ex, ExceptionHandlerChain chain) { if (response.isCommitted()) { // 既に何かが出力されてしまっているため、エラー画面へのフォワードはしないようにする。 log_.error("Exception has occured", ex); return; } if (log_.isDebugEnabled()) { log_.debug("Exception has occured", ex); } try { if (redirect_) { response.sendRedirect(response.encodeRedirectURL(ServletUtils .getURI(pathname_, request))); } else { request.getRequestDispatcher(pathname_).forward(request, response); } } catch (Throwable t) { log_.error("Exception has occured", ex); log_.error( "...and tried to handle this exception, but couldn't forward to: " + pathname_, t); } }
void stopObjectInLifecycle(Lifecycle lifecycle) { try { lifecycle.stop(); } catch (Throwable t) { log_.error("Can't stop object: plugin-id=" + getId() + ", object=" + lifecycle, t); } }
public final boolean start() { if (started_) { return true; } pageAlfr_ = pagePlugin_.getPageAlfr(); boolean started; try { started = doStart(); } catch (Throwable t) { log_.error("Can't start PageAbilityAlfr: " + getClass(), t); started = false; } started_ = started; return started; }
boolean startObjectInLifecycle(Lifecycle lifecycle) { boolean started = false; Throwable throwable = null; try { started = lifecycle.start(); } catch (Throwable t) { throwable = t; } if (!started) { log_.error("Can't start object: plugin-id=" + getId() + ", object=" + lifecycle, throwable); } return started; }
public void destroy() { kvasir_ = null; pagePlugin_ = null; element_ = null; pageAlfr_ = null; container_ = null; config_ = null; servletComponentName_ = null; servletName_ = null; resolverComponentName_ = null; processVirtualPath_ = false; urlPattern_ = null; Thread thread = Thread.currentThread(); ClassLoader cl = thread.getContextClassLoader(); for (Iterator<Bag> itr = servletMap_.values().iterator(); itr.hasNext();) { Bag pair = itr.next(); try { thread.setContextClassLoader(pair.getClassLoader()); pair.getServlet().destroy(); } catch (Throwable t) { log_.error("Can't destroy servlet: " + pair.getServlet(), t); } finally { thread.setContextClassLoader(cl); } } servletMap_.clear(); clMap_.clear(); }
public String renderBodyWithoutException(String body, String bodyType, PopContext context) { if (body != null) { try { return renderBody(new ByteArrayInputStream(body .getBytes("UTF-8")), "UTF-8", bodyType, context); } catch (Throwable t) { getPlugin().getLog().error("Can't generate body", t); return ""; } } else { return ""; } }
public long endSession() { for (int i = 0; i < sessionListeners_.length; i++) { try { sessionListeners_[i].notifyEndSession(); } catch (Throwable t) { log_.error("notification of finishing session failed", t); } } try { ComponentContainerFactory.getInstance().endSession(); } catch (Throwable t) { log_.error("ComponentContainerFactory#endSession() failed", t); } ClassLoader cl = contextClassLoader_.get(); if (cl != null) { Thread.currentThread().setContextClassLoader(cl); contextClassLoader_.set(null); } sessions_--; long beginTime = beginTime_.get(); beginTime_.set(null); if (log_.isDebugEnabled()) { log_.debug("KVASIR SESSION END: " + Thread.currentThread()); } return (System.currentTimeMillis() - beginTime); }
ComponentContainerFactory.getInstance().beginSession(); } catch (Throwable t) { log_.error("ComponentContainerFactory#beginSession() failed", t); plugin.refresh(); } catch (Throwable t) { log_.error("Plugin#refresh() failed: plugin-id=" + plugin.getId(), t); sessionListeners_[i].notifyBeginSession(); } catch (Throwable t) { log_.error("notification of beginning session failed", t);
if (pageIdColumnName == null) { log_ .error("Attribute 'page-id-column-name' is not specified: element=" + pageIdColumnName); return false;
public final void stop() { if (!started_) { return; } for (int i = objectsInLifecycle_.length - 1; i >= 0; i--) { stopObjectInLifecycle(objectsInLifecycle_[i]); } objectsInLifecycle_ = new Lifecycle[0]; try { doStop(); } catch (Throwable t) { log_.error("Can't stop plugin gracefully: id=" + getId(), t); } if (container_ != null) { try { container_.destroy(); } catch (Throwable t) { log_.error("Can't stop plugin container: id=" + getId(), t); } } container_ = null; settings_ = null; started_ = false; }
public void doHandle(HttpServletRequest request, HttpServletResponse response, Exception ex, PageRequest pageRequest, PageExceptionHandlerChain chain) { // ログイン処理を開始する。 log_.debug("LOGIN PROCESS:" + " (1) Request authentication information to client"); setAuthenticationHeader(response, "Kvasir"); HttpSession session = request.getSession(true); session.setAttribute(BasicAuthenticationPageFilter.ATTR_AUTH_TRYING, "trying"); if (errorPage_ != null) { try { request.getRequestDispatcher( PageUtils.getAbsolutePathname(errorPage_, pageRequest .getMy().getGardRootPage(), pageRequest.getMy() .getPage())).forward(request, response); } catch (ServletException ex2) { log_.error("Can't forward to error page: " + errorPage_, ex2); } catch (IOException ex2) { log_.error("Can't forward to error page: " + errorPage_, ex2); } } else { // デフォルトの500エラー画面にするとauthentication headerが // 消されるっぽいので、他のハンドラが処理してくれないと // Basic認証できないことになることに注意。 chain.doHandle(request, response, ex, pageRequest); } }
public void init(ServletConfig config) { pageAlfr_ = pagePlugin_.getPageAlfr(); prepareForPageProcessors(config); lifecycleListeners_ = plugin_.getExtensionComponents( PageProcessorLifecycleListener.class, true); for (int i = 0; i < lifecycleListeners_.length; i++) { try { lifecycleListeners_[i].notifyPageProcessorsStarted(); } catch (Throwable t) { log_ .error( "PageProcessorLifecycleListener has thrown exception when started: pageProcessorLifecycleListener=" + lifecycleListeners_[i], t); } } }
@ForPreparingMode public final boolean start() { if (started_) { return true; } try { prepareForDevelopingStatus(); descriptorMap_ = new TreeMap<String, PluginDescriptor>(); enabledPluginMap_ = new LinkedHashMap<Object, Plugin<?>>(); extensionPointMap_ = new HashMap<PluginLocalKey, ExtensionPoint>(); constructSettings(); stagePlugins(); Resource[] additionalPlugins = developedPluginHomeDirectory_ != null ? new Resource[] { developedPluginHomeDirectory_ } : new Resource[0]; scan(getPluginsDirectory(), additionalPlugins); constructPluginGraph(); startPlugins(); started_ = true; return true; } catch (RuntimeException ex) { log_.error("Can't start PluginAlfr", ex); return false; } }
public void init(FilterConfig config) { pageAlfr_ = pagePlugin_.getPageAlfr(); prepareForPageFilters(config); prepareForPageExceptionHandlers(); lifecycleListeners_ = plugin_.getExtensionComponents( PageFilterLifecycleListener.class, true); for (int i = 0; i < lifecycleListeners_.length; i++) { try { lifecycleListeners_[i].notifyPageFiltersStarted(); } catch (Throwable t) { log_ .error( "PageFilterLifecycleListener has thrown exception when started: pageFilterLifecycleListener=" + lifecycleListeners_[i], t); } } }
+ "' has been successfully started."); } else { log_.error("Can't start plugin: plugin-id=" + plugin.getId(), throwable); failedPluginIdsToStart_ = (String[])ArrayUtil.add(
String id = extensionPoint.getId(); if (id == null) { log_.error("id must be specified: " + extensionPoint + ": plugin=" + pluginId); continue;
log_.error("Can't start Plugin: id=" + getId(), t); started = false;