public void warn(final String message) { log_.warn(message); }
public void warn(final String message, final Throwable throwable) { log_.warn(message, throwable); } }
public Analyzer newAnalyzer() { try { return (Analyzer)analyzerClass_.newInstance(); } catch (Throwable t) { log_.warn("Can't create instance: " + analyzerClass_); throw new RuntimeException(t); } }
public void destroy() { for (int i = 0; i < processors_.length; i++) { try { destroy(processors_[i]); } catch (Throwable t) { log_.warn("Can't destroy " + getShortName(processorClass_.getName()) + ": " + processors_[i], t); } } }
public Object compile(InputStream in, String encoding, String type) { if (in == null) { return null; } try { Reader reader = new InputStreamReader(in, (encoding != null ? encoding : ENCODING_DEFAULT)); in = null; return parser_.parse(reader); } catch (IOException ex) { log_.warn("Can't compile rst text", ex); throw new IORuntimeException(ex); } finally { if (in != null) { try { in.close(); } catch (IOException ignore) { } } } }
@Override protected void doStop() { identity_ = null; ds_ = null; if (elementByProductIdMap_ != null) { Set<String> driverClassSet = new HashSet<String>(); for (Iterator<DatabaseSystemElement> itr = elementByProductIdMap_ .values().iterator(); itr.hasNext();) { DatabaseSystemElement metaData = itr.next(); String driverClass = metaData.getDriverClass(); driverClassSet.add(driverClass); } for (Enumeration enm = DriverManager.getDrivers(); enm .hasMoreElements();) { Driver driver = (Driver)enm.nextElement(); if (driverClassSet.contains(driver.getClass().getName())) { try { DriverManager.deregisterDriver(driver); } catch (SQLException ex) { log_.warn("Can't deregister JDBC driver: " + driver.getClass(), ex); } } } } beantables_ = null; beantableMap_ = null; elementByProductIdMap_ = null; }
public synchronized void removeFromIndex(int[] pageIds) { IndexReader reader = null; try { reader = IndexReader.open(indexDirPath_); for (int i = 0; i < pageIds.length; i++) { try { removeFromIndex(reader, pageIds[i]); } catch (IOException ex) { if (log_.isWarnEnabled()) { log_.warn("Can't remove from index: " + pageIds[i], ex); } } } } catch (IOException ex) { throw new IORuntimeException(ex); } finally { if (reader != null) { try { reader.close(); } catch (IOException ex) { if (log_.isWarnEnabled()) { log_.warn("Can't close index reader", ex); } } } } }
void prepareForPops() { PropertyAbility prop = pageAlfr_.getRootPage(heimId_).getAbility( PropertyAbility.class); List<Pop> popList = new ArrayList<Pop>(); String[] popIds = PropertyUtils.toLines(prop.getProperty(getPopsKey())); for (int j = 0; j < popIds.length; j++) { String popId; int instanceId = Pop.INSTANCEID_DEFAULT; int delim = popIds[j].indexOf(Pop.INSTANCE_DELIMITERCHAR); if (delim < 0) { popId = popIds[j]; } else { popId = popIds[j].substring(0, delim); try { instanceId = Integer.parseInt(popIds[j] .substring(delim + 1)); } catch (NumberFormatException ignore) { } } Pop pop = plugin_.getPop(heimId_, popId, instanceId); if (pop == null) { plugin_.getLog().warn( "Pop not found: id=" + popId + ", paneId=" + id_); continue; } popList.add(pop); } pops_ = popList.toArray(new Pop[0]); }
public synchronized void removeFromIndex(Page[] pages) { IndexReader reader = null; try { reader = IndexReader.open(indexDirPath_); for (int i = 0; i < pages.length; i++) { try { removeFromIndex(reader, pages[i].getId()); } catch (IOException ex) { if (log_.isWarnEnabled()) { log_.warn("Can't remove from index: " + pages[i], ex); } } } } catch (IOException ex) { throw new IORuntimeException(ex); } finally { if (reader != null) { try { reader.close(); } catch (IOException ex) { if (log_.isWarnEnabled()) { log_.warn("Can't close index reader", ex); } } } } }
public synchronized void clearIndex() { if (log_.isDebugEnabled()) { log_.debug("clear index"); } File indexDir = new File(indexDirPath_); if (!indexDir.exists()) { indexDir.mkdirs(); if (log_.isInfoEnabled()) { log_.info("CREATE INDEX DIR: " + indexDirPath_); } } IndexWriter writer = null; try { writer = newIndexWriter(true); } catch (IOException ex) { throw new IORuntimeException(ex); } finally { if (writer != null) { try { writer.close(); } catch (IOException ex) { if (log_.isWarnEnabled()) { log_.warn("Can't close index writer", ex); } } } } }
@ForPreparingMode public final void stop() { if (!started_) { return; } failedPluginIdsToStart_ = new String[0]; extensionPointMap_ = null; extensionElementMap_ = null; pluginDependencies_ = null; Plugin[] plugins = getPlugins(); for (int i = plugins.length - 1; i >= 0; i--) { try { plugins[i].stop(); } catch (Throwable t) { log_.warn("Can't stop plugin: pluginId=" + plugins[i].getId(), t); } } enabledPlugins_ = null; enabledPluginMap_ = null; descriptors_ = null; descriptorMap_ = null; kvasir_ = null; started_ = false; }
public Object do_execute() { if ("POST".equalsIgnoreCase(getYmirRequest().getMethod())) { try { updateContent(); setNotes(new Notes().add(new Note( "app.note.editContent.succeed"))); Map<String, String[]> paramMap = new HashMap<String, String[]>(); paramMap.put("variant", new String[] { variant_ }); return getRedirection("/edit-content.do" + getPathname(), paramMap); } catch (IOException ex) { log_.warn("Can't read body file: " + body_, ex); setNotes(new Notes().add(new Note("app.error.generic", ex .toString()))); } } return render(); }
plugin.stop(); } catch (Throwable t) { log_.warn("Can't stop plugin: id=" + plugin.getId(), t);
Pop newPop0(int heimId, int instanceId) { Pop pop = (Pop)getComponent(); if (pop == null) { log_.warn("Can't find POP component. Use generic POP: heimId=" + heimId + ", instanceId=" + instanceId + ", popId=" + getFullId()); GenericPop genericPop = (GenericPop)popPlugin_ .getComponentContainer().getComponent(COMPONENTNAME_GENERICPOP); genericPop.setElement(this); pop = genericPop; } pop.setHeimId(heimId); pop.setInstanceId(instanceId); KvasirUtils.start(pop); return pop; }
public SearchResult[] search(SearchQuery query) throws ParseException { if (log_.isDebugEnabled()) { log_.debug("QUERY STRING: " + query.getQueryString()); } Searcher searcher = null; try { searcher = new IndexSearcher(indexDirPath_); QueryStringParser parser = getQueryStringParser(); Query qry = (Query)parser.parse(query.getQueryString(), query .getOption()); return getSearchResults(query, searcher.search(qry)); } catch (IOException ex) { throw new IORuntimeException(ex); } finally { if (searcher != null) { try { searcher.close(); } catch (IOException ex) { if (log_.isWarnEnabled()) { log_.warn("Can't close searcher", ex); } } } } }
mold.setBodyInputStream(body_.getInputStream()); } catch (IOException ex) { log_.warn("Can't read body file: " + body_, ex);
destResource.getName()); } catch (Throwable t) { log_.warn("Can't recover: file=" + prevResource + ", content=" + destResource.getName());