List of usage examples for java.lang InterruptedException getMessage
public String getMessage()
From source file:gridool.db.partitioning.phihash.monetdb.MonetDBCsvLoadTask.java
@Override protected void postShuffle(int numShuffled) { super.postShuffle(numShuffled); assert (csvFileName != null); String connectUrl = jobConf.getConnectUrl(); String tableName = jobConf.getTableName(); String createTableDDL = jobConf.getCreateTableDDL(); String copyIntoQuery = GridDbUtils.generateCopyIntoQuery(tableName, jobConf); String alterTableDDL = jobConf.getAlterTableDDL(); MonetDBCsvLoadOperation ops = new MonetDBCsvLoadOperation(connectUrl, tableName, csvFileName, createTableDDL, copyIntoQuery, alterTableDDL); ops.setAuth(jobConf.getUserName(), jobConf.getPassword()); final Pair<MonetDBCsvLoadOperation, Map<GridNode, MutableLong>> pair = new Pair<MonetDBCsvLoadOperation, Map<GridNode, MutableLong>>( ops, assignMap);/*w ww .jav a2 s .com*/ final StopWatch sw = new StopWatch(); final GridJobFuture<Long> future = kernel.execute(MonetDBInvokeCsvLoadJob.class, pair); final Long numInserted; try { numInserted = future.get(); } catch (InterruptedException ie) { LOG.error(ie.getMessage(), ie); throw new IllegalStateException(ie); } catch (ExecutionException ee) { LOG.error(ee.getMessage(), ee); throw new IllegalStateException(ee); } assert (numInserted != null); if (LOG.isInfoEnabled()) { LOG.info("Processed/Inserted " + numShuffled + '/' + numInserted.longValue() + " records into '" + tableName + "' table in " + sw.toString()); } }
From source file:gumga.framework.presentation.push.GumgaNotificationsServlet.java
@RequestMapping("/notifications/source") protected void notifications(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/event-stream"); response.setCharacterEncoding("UTF-8"); PrintWriter writer = response.getWriter(); QueryObject qo = new QueryObject(); qo.setAq("destinationLogin='" + GumgaThreadScope.login.get() + "' and viewedIn is null "); qo.setAq("viewedIn is null "); qo.setPageSize(1000);/*from w w w . j a v a 2s .co m*/ for (int i = 0; i < cycles; i++) { SearchResult<GumgaMessage> pesquisa = messageService.pesquisa(qo); String message = "data: {" + " \"newMessagesCount\":" + pesquisa.getCount() + ",\"newMessages\":" + pesquisa.getValues() + "}"; writer.write(message + "\n\n"); writer.flush(); try { Thread.sleep(intervalTime); } catch (InterruptedException e) { log(e.getMessage()); } } writer.close(); }
From source file:edu.cornell.med.icb.R.RConfigurationServer.java
public RConfigurationItem borrowConfigurationItem() throws RemoteException { final RConfigurationItem item; try {/* w w w . jav a2s.co m*/ item = configurations.takeFirst(); if (LOG.isDebugEnabled()) { LOG.debug("Giving out: " + item.getHost() + ":" + item.getPort()); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new RemoteException(e.getMessage()); } return item; }
From source file:ch.sbb.releasetrain.webui.backingbeans.ActionBackingBean.java
public void newOne() { config = new ReleaseConfig(); configAccessor.writeConfig(selectedActionNew, config); try {/*from ww w .j av a2 s .co m*/ Thread.sleep(200); } catch (InterruptedException e) { log.error(e.getMessage(), e); } setSelectedAction(selectedActionNew); selectedActionNew = ""; }
From source file:com.ushahidi.swiftriver.core.dropqueue.DropFilterPublisher.java
public void run() { LOG.debug("Rules publisher started"); try {/*from w ww. ja va 2 s.co m*/ while (true) { publishDrop(dropFilterQueue.take()); } } catch (InterruptedException e) { LOG.error(e.getMessage()); } }
From source file:com.interacciones.mxcashmarketdata.driver.queue.QueueWriteFile.java
public void ReadQueue(ConcurrentLinkedQueue<String> msgQueue) { LOGGER.debug("Reading from queue... Sizing " + msgQueue.size()); while (true) { Iterator<String> it = msgQueue.iterator(); while (it.hasNext()) { String msg = (String) it.next(); //messageProcessing.receive(msg.toString()); msgQueue.poll();/* w ww. j av a 2 s . c o m*/ } try { Thread.sleep(100); } catch (InterruptedException e) { e.printStackTrace(); LOGGER.error("Error: " + e.getMessage()); } } }
From source file:com.interacciones.mxcashmarketdata.mama.queue.QueueReader.java
public void ReadQueue(ConcurrentLinkedQueue<Parser> msgQueue) { LOGGER.debug("Reading from queue... Sizing " + msgQueue.size()); while (true) { Iterator<Parser> it = msgQueue.iterator(); while (it.hasNext()) { Parser msg = (Parser) it.next(); LOGGER.debug("Message Type: " + msg.TypeMessage()); LOGGER.debug("Symbol (Emisora):" + msg.Emisora()); sendMessage.sendMessage(msg); msgQueue.poll();/*from w w w .j av a2 s .co m*/ } try { Thread.sleep(100); } catch (InterruptedException e) { e.printStackTrace(); LOGGER.error("Error: " + e.getMessage()); } } }
From source file:net.meddeb.pqmessenger.MsgDaemon.java
@Override public void stop() throws Exception { stopped = true;/* w w w . ja v a 2s . com*/ try { mainThread.join(1000); if (connected) { msgEngine.stopConnection(); connected = false; } logger.info("------------------------"); logger.info(LoggingMsg.getLog("pqMsgStop")); logger.info("------------------------"); } catch (InterruptedException e) { System.err.println(e.getMessage()); throw e; } }
From source file:com.carmatech.maven.model.ParallelMerger.java
@Override public PropertiesConfiguration merge(final List<File> sourceFiles) throws IOException { try {/* w w w. j a va2 s . c om*/ return mergePropertiesFrom(sourceFiles); } catch (InterruptedException e) { logger.warn("Parallel merger was interrupted: " + e.getMessage() + ". Falling back to simple merger...", e); return new SimpleMerger().merge(sourceFiles); } catch (ExecutionException e) { logger.warn( "Parallel merger failed to complete: " + e.getMessage() + ". Falling back to simple merger...", e); return new SimpleMerger().merge(sourceFiles); } }
From source file:org.activiti.spring.test.autodeployment.SpringAutoDeployTest.java
private boolean waitUntilFileIsWritten(String filePath, int expectedBytes) throws URISyntaxException { while (IoUtil.getFile(filePath).length() != (long) expectedBytes) { try {//from w w w .j a v a2 s . c om wait(100L); } catch (InterruptedException e) { fail(e.getMessage()); } } return true; }