PropertyKey propKey = null;
if (!graphMgt.containsPropertyKey(prop.getProperty())) {
Class<?> clazz = prop.getClazz();
- if (!ArrayList.class.getName().equals(clazz.getName()) && !HashMap.class.getName().equals(clazz.getName())) {
+ if (!clazz.isAssignableFrom(ArrayList.class) && !clazz.isAssignableFrom(HashMap.class)) {
propKey = graphMgt.makePropertyKey(prop.getProperty()).dataType(prop.getClazz()).make();
}
} else {
}
} catch (InterruptedException e) {
log.error("Error occurred: {}", e.getMessage());
+ Thread.currentThread().interrupt();
}
}
return false;
}
catch (InterruptedException e) {
log.debug("Failed during sleep after sending the message.", e);
+ Thread.currentThread().interrupt();
}
log.debug("After sending notification data to topic {}. result is {}", topicName, result);
}
catch (InterruptedException e) {
log.debug("Failed during sleep after sending the message.", e);
+ Thread.currentThread().interrupt();
}
log.debug("After sending notification data to topic {}. result is {}", topicName, result);
response = new CambriaErrorResponse(CambriaOperationStatus.OK, 200);
}
}
- catch (IOException | InterruptedException e) {
+ catch (InterruptedException e) {
+ log.debug("InterruptedException while closing cambria publisher", e);
+ Thread.currentThread().interrupt();
+ response = new CambriaErrorResponse(CambriaOperationStatus.INTERNAL_SERVER_ERROR, 500);
+ writeErrorToLog(response, methodName, SEND_NOTIFICATION);
+ }
+ catch (IOException e) {
log.debug("Failed to close cambria publisher", e);
response = new CambriaErrorResponse(CambriaOperationStatus.INTERNAL_SERVER_ERROR, 500);
writeErrorToLog(response, methodName, SEND_NOTIFICATION);
PropertyKey propKey = null;
if (!graphMgt.containsPropertyKey(prop.getProperty())) {
Class<?> clazz = prop.getClazz();
- if (!ArrayList.class.getName().equals(clazz.getName()) && !HashMap.class.getName().equals(clazz.getName())) {
+ if (!clazz.isAssignableFrom(ArrayList.class) && !clazz.isAssignableFrom(HashMap.class)) {
propKey = graphMgt.makePropertyKey(prop.getProperty()).dataType(prop.getClazz()).make();
}
} else {
Integer syncWorkerExacutionIntrval = applicationL2CacheConfig.getQueue().getSyncIntervalInSecondes();
log.debug("starting Sync worker:{} with executions interval:{} ", workerName, syncWorkerExacutionIntrval);
SyncWorker syncWorker = new SyncWorker(workerName, this);
- this.syncExecutor.scheduleAtFixedRate(syncWorker, 5 * 60, syncWorkerExacutionIntrval, TimeUnit.SECONDS);
+ this.syncExecutor.scheduleAtFixedRate(syncWorker, 5 * 60L, syncWorkerExacutionIntrval, TimeUnit.SECONDS);
this.workerExecutor = Executors.newFixedThreadPool(numberOfWorkers, threadFactory);
CacheWorker cacheWorker;
for (int i = 0; i < numberOfWorkers; i++) {
log.debug("all Cache workers finished");
} catch (InterruptedException e) {
log.error("failed while waiting for Cache worker", e);
+ Thread.currentThread().interrupt();
}
try {
if (!workerExecutor.awaitTermination(1, TimeUnit.MINUTES)) {
log.debug("sync worker finished");
} catch (InterruptedException e) {
log.error("failed while waiting for sync worker", e);
+ Thread.currentThread().interrupt();
}
}
try {
T calcValue = future.get(timeoutInMs, TimeUnit.MILLISECONDS);
result = Either.left(calcValue);
- } catch (InterruptedException | ExecutionException | TimeoutException e) {
+ } catch (InterruptedException e) {
+ LOGGER.debug("InterruptedException in runMethodWithTimeOut", e);
+ Thread.currentThread().interrupt();
+ result = Either.right(false);
+ } catch (ExecutionException | TimeoutException e) {
LOGGER.debug("method run was canceled because it has passed its time limit of {} MS", timeoutInMs, e);
result = Either.right(false);
} finally {
log.debug("all workers finished");
} catch (InterruptedException e) {
log.error("failed while waiting for", e);
+ Thread.currentThread().interrupt();
}
return outputQueue;
}
}
public class Poller extends Thread {
+ @Override
public void run() {
try {
while (!stopRunning) {
}
catch (InterruptedException e) {
LOGGER.error("Interrupted Exception during Notification poller launch.", e);
+ Thread.currentThread().interrupt();
}
}
executor = Executors.newFixedThreadPool(DEFAULT_THREAD_NUMBER);
executeAllTasks(executor, tasks);
} catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
throw new CommandExecutionRuntimeException(COMMAND_ADD_CONTRIBUTOR_FAILED, e);
} finally {
if (executor != null) {
LOG.warn("Unfamiliar command please use: \n>aes <encrypt/decrypt> 'message to encrypt/decrypt' ");
}
}catch(Exception e){
- LOG.debug( "cannot perform {}:" );
+ LOG.warn("Exception while message encryption or decryption");
throw e;
}
LOG.debug( "output: {}", res!=null && res.isLeft() ? res.left().value() : "ERROR" );