/** * {@inheritDoc} */ @Override public void shutdown(boolean awaitShutdown) { ExecutorServiceUtils.shutdownExecutor(diagnosisServiceExecutor, SHUTDOWN_TIMEOUT, TimeUnit.SECONDS); }
/** * {@inheritDoc} */ @Override public int compareTo(ParameterContentData other) { return ObjectUtils.compare(name, other.name); }
/** * <p> * Decides if the Java version matches. * </p> * * @param versionPrefix * the prefix for the java version * @return true if matches, or false if not or can't determine */ private static boolean getJavaVersionMatches(String versionPrefix) { return isJavaVersionMatch(JAVA_VERSION_TRIMMED, versionPrefix); }
/** * Validates the content of the email addresses input field checking whether the e-mails have a * correct syntax. * * @return Returns a integer-string pair indicating the line number and e-mail address that is * not correct. If all e-mail addresses have a correct syntax, then this method returns * <code>null</code>. */ private Pair<Integer, String> checkEmailText() { int i = 0; for (String address : getEmailAddresses()) { if (!address.isEmpty() && !EMailUtils.isValidEmailAddress(address)) { return new Pair<Integer, String>(i + 1, address); } i++; } return null; }
/** * {@inheritDoc} */ @Override public BusinessTransactionData getBusinessTransactionForId(int appId, int businessTxId) { return businessTransactions.get(new Pair<Integer, Integer>(appId, businessTxId)); } }
/** * Initializes {@link #configDirFile}. */ protected void init() { try { configDirFile = ResourcesPathResolver.getResourceFile(CONFIG_DIR); } catch (IOException exception) { throw new BeanInitializationException("Property manager can not locate configuration directory.", exception); } }
/** * Returns if any storage in collection of storages does contain given label. * * @param label * Label to search for. * @param labelsInStorages * Storages to check. * @return True if label exists in one of given storages. */ private boolean isLabelExistsInStorage(AbstractStorageLabel<?> label, Set<AbstractStorageLabel<?>> labelsInStorages) { for (AbstractStorageLabel<?> labelInStorage : labelsInStorages) { if (ObjectUtils.equals(label, labelInStorage)) { return true; } } return false; }
/** * {@inheritDoc} */ @Override protected boolean prove(String value) { if (value.isEmpty()) { return true; } return EMailUtils.isValidEmailAddress(value); }
/** * {@inheritDoc} * <p> * Comparing by from date. */ @Override public int compareTo(TimeFrame other) { return from.compareTo(other.getFrom()); }
/** * Returns the JVM provider. * * @return Returns the JVM provider. */ private static JvmProvider getJvmProvider() { if (getJavaVendorMatches("Sun")) { return JvmProvider.SUN; } else if (getJavaVendorMatches("Oracle Corporation")) { return JvmProvider.ORACLE; } else if (getJavaVendorMatches("IBM")) { return JvmProvider.IBM; } else if (getJavaVendorMatches("Azul")) { return JvmProvider.AZUL; } else { return JvmProvider.OTHER; } }
@Override public V put(K key, V value) { V forReturn = super.put(key, value); if (super.size() > capacity) { removeEldest(); } return forReturn; }
/** * removes the eldest element from the FifoMap. */ private void removeEldest() { Iterator<K> iterator = this.keySet().iterator(); if (iterator.hasNext()) { iterator.next(); iterator.remove(); } } }
/** * {@inheritDoc} */ @Override public void write(Kryo kryo, Output output, Object object) { delegateSerializer.write(kryo, output, hibernateUtil.getUnproxiedObject(object)); }
/** * {@inheritDoc} */ @Override public BusinessTransactionData getBusinessTransactionForId(int appId, int businessTxId) { return businessTransactions.get(new Pair<Integer, Integer>(appId, businessTxId)); }
/** * Shutting down the used executor service. */ @PreDestroy protected void shutDownExecutorService() { ExecutorServiceUtils.shutdownExecutor(scheduledExecutorService, 5L, TimeUnit.SECONDS); }
/** * {@inheritDoc} */ @Override public IWizardPage getPreviousPage(IWizardPage page) { if (ObjectUtils.equals(page, importStorageInfoPage)) { importStorageInfoPage.reset(); } return super.getPreviousPage(page); }
/** * The comparison is based on the elements' timestamps. * <p> * {@inheritDoc} * */ @Override public int compareTo(InvocationTreeElement o) { return ObjectUtils.compare(getTimeStamp(), o.getTimeStamp()); }
/** * {@inheritDoc} */ @Override public BusinessTransactionData getBusinessTransactionForId(int appId, int businessTxId) { Pair<Integer, Integer> keyPair = new Pair<Integer, Integer>(appId, businessTxId); if (!businessTransactionsMap.containsKey(keyPair)) { refreshBusinessContext(); } BusinessTransactionData businessTxData = businessTransactionsMap.get(keyPair); return businessTxData; }
/** * {@inheritDoc} */ @Override public int compare(ExceptionSensorData o1, ExceptionSensorData o2) { switch (this) { case FQN: return ObjectUtils.compare(o1.getThrowableType(), o2.getThrowableType()); case ERROR_MESSAGE: return ObjectUtils.compare(o1.getErrorMessage(), o2.getErrorMessage()); default: return 0; } }