/** * Verifies that, if timeout options was set, the executor is available and input value for timeout can be interpreted as Long. * Returns the timeout value if all is alright, null if this option was not requested. */ private Long initTimeoutOption(Object timeoutOptionValue) { if (timeoutOptionValue != null) { // throw exception if we don't have scheduled executor available if (timerExecutor == null) { throw EventLogger.LOG.noScheduledExecutorServicesProvided(); } // now verify that the input value makes sense try { String inputValue = timeoutOptionValue.toString(); return Long.parseLong(inputValue); } catch (NumberFormatException nfe) { throw EventLogger.LOG.invalidInputValueForTimeout(nfe); } } else { return null; } }
/** * Verifies that, if timeout options was set, the executor is available and input value for timeout can be interpreted as Long. * Returns the timeout value if all is alright, null if this option was not requested. */ private Long initTimeoutOption(Object timeoutOptionValue) { if (timeoutOptionValue != null) { // throw exception if we don't have scheduled executor available if (timerExecutor == null) { throw EventLogger.LOG.noScheduledExecutorServicesProvided(); } // now verify that the input value makes sense try { String inputValue = timeoutOptionValue.toString(); return Long.parseLong(inputValue); } catch (NumberFormatException nfe) { throw EventLogger.LOG.invalidInputValueForTimeout(nfe); } } else { return null; } }
/** * Verifies that, if timeout options was set, the executor is available and input value for timeout can be interpreted as Long. * Returns the timeout value if all is alright, null if this option was not requested. */ private Long initTimeoutOption(Object timeoutOptionValue) { if (timeoutOptionValue != null) { // throw exception if we don't have scheduled executor available if (timerExecutor == null) { throw EventLogger.LOG.noScheduledExecutorServicesProvided(); } // now verify that the input value makes sense try { String inputValue = timeoutOptionValue.toString(); return Long.parseLong(inputValue); } catch (NumberFormatException nfe) { throw EventLogger.LOG.invalidInputValueForTimeout(nfe); } } else { return null; } }
/** * Verifies that, if timeout options was set, the executor is available and input value for timeout can be interpreted as Long. * Returns the timeout value if all is alright, null if this option was not requested. */ private Long initTimeoutOption(Object timeoutOptionValue) { if (timeoutOptionValue != null) { // throw exception if we don't have scheduled executor available if (timerExecutor == null) { throw EventLogger.LOG.noScheduledExecutorServicesProvided(); } // now verify that the input value makes sense try { String inputValue = timeoutOptionValue.toString(); return Long.parseLong(inputValue); } catch (NumberFormatException nfe) { throw EventLogger.LOG.invalidInputValueForTimeout(nfe); } } else { return null; } }
/** * Verifies that, if timeout options was set, the executor is available and input value for timeout can be interpreted as Long. * Returns the timeout value if all is alright, null if this option was not requested. */ private Long initTimeoutOption(Object timeoutOptionValue) { if (timeoutOptionValue != null) { // throw exception if we don't have scheduled executor available if (timerExecutor == null) { throw EventLogger.LOG.noScheduledExecutorServicesProvided(); } // now verify that the input value makes sense try { String inputValue = timeoutOptionValue.toString(); return Long.parseLong(inputValue); } catch (NumberFormatException nfe) { throw EventLogger.LOG.invalidInputValueForTimeout(nfe); } } else { return null; } }