@Override public boolean isImmediateTimeoutEnabled() { return ehcacheNonStopConfig.isImmediateTimeout(); }
private boolean isImmediateNonStopTimeout() { if (cacheConfiguration.getTerracottaConfiguration() == null) { return false; } NonstopConfiguration nonstopConfig = cacheConfiguration.getTerracottaConfiguration().getNonstopConfiguration(); return nonstopConfig != null && nonstopConfig.isImmediateTimeout(); } }
private void throwNonStopExceptionWhenClusterNotInit() throws NonStopException { // THIS IS HAND MADE CODE -- DO NOT GENERATED if (delegate == null && ehcacheNonStopConfiguration != null && ehcacheNonStopConfiguration.isEnabled()) { if (ehcacheNonStopConfiguration.isImmediateTimeout()) { if (exceptionDuringInitialization != null) { throw new NonStopToolkitInstantiationException( exceptionDuringInitialization); } throw new NonStopException("Cluster not up OR still in the process of connecting "); } else { long timeout = ehcacheNonStopConfiguration.getTimeoutMillis(); waitForInit(timeout); } } }
private void checkForClusterOffline(final long start, final long timeoutMills) throws TimeoutException { while (clusterOffline.get()) { if (nonstopConfiguration.isImmediateTimeout()) { throw new TimeoutException("Cluster is currently offline"); } final long remaining = timeoutMills - TimeUnit.MILLISECONDS.convert(System.nanoTime() - start, TimeUnit.NANOSECONDS); if (remaining <= 0) { break; } synchronized (clusterOffline) { try { clusterOffline.wait(remaining); } catch (InterruptedException e) { // rethrow as CacheException throw new CacheException(e); } } } if (clusterOffline.get()) { // still cluster offline throw new TimeoutException("Cluster is currently offline"); } }
private void init() { if (nonstopConfiguration == null) { return; } if (nonstopConfiguration.getTimeoutBehavior() != null && !isDefault(nonstopConfiguration.getTimeoutBehavior())) { addChildElement(new TimeoutBehaviorConfigurationElement(this, nonstopConfiguration.getTimeoutBehavior())); } addAttribute(new SimpleNodeAttribute("enabled", nonstopConfiguration.isEnabled()).optional(true).defaultValue( NonstopConfiguration.DEFAULT_ENABLED)); addAttribute(new SimpleNodeAttribute("immediateTimeout", nonstopConfiguration.isImmediateTimeout()).optional(true).defaultValue( NonstopConfiguration.DEFAULT_IMMEDIATE_TIMEOUT)); addAttribute(new SimpleNodeAttribute("timeoutMillis", nonstopConfiguration.getTimeoutMillis()).optional(true).defaultValue( NonstopConfiguration.DEFAULT_TIMEOUT_MILLIS)); addAttribute(new SimpleNodeAttribute("searchTimeoutMillis", nonstopConfiguration.getSearchTimeoutMillis()).optional(true).defaultValue( NonstopConfiguration.DEFAULT_SEARCH_TIMEOUT_MILLIS)); }
private void init() { if (nonstopConfiguration == null) { return; } if (nonstopConfiguration.getTimeoutBehavior() != null && !isDefault(nonstopConfiguration.getTimeoutBehavior())) { addChildElement(new TimeoutBehaviorConfigurationElement(this, nonstopConfiguration.getTimeoutBehavior())); } addAttribute(new SimpleNodeAttribute("enabled", nonstopConfiguration.isEnabled()).optional(true).defaultValue( NonstopConfiguration.DEFAULT_ENABLED)); addAttribute(new SimpleNodeAttribute("immediateTimeout", nonstopConfiguration.isImmediateTimeout()).optional(true).defaultValue( NonstopConfiguration.DEFAULT_IMMEDIATE_TIMEOUT)); addAttribute(new SimpleNodeAttribute("timeoutMillis", nonstopConfiguration.getTimeoutMillis()).optional(true).defaultValue( NonstopConfiguration.DEFAULT_TIMEOUT_MILLIS)); }
private void init() { if (nonstopConfiguration == null) { return; } if (nonstopConfiguration.getTimeoutBehavior() != null && !isDefault(nonstopConfiguration.getTimeoutBehavior())) { addChildElement(new TimeoutBehaviorConfigurationElement(this, nonstopConfiguration.getTimeoutBehavior())); } addAttribute(new SimpleNodeAttribute("enabled", nonstopConfiguration.isEnabled()).optional(true).defaultValue( NonstopConfiguration.DEFAULT_ENABLED)); addAttribute(new SimpleNodeAttribute("immediateTimeout", nonstopConfiguration.isImmediateTimeout()).optional(true).defaultValue( NonstopConfiguration.DEFAULT_IMMEDIATE_TIMEOUT)); addAttribute(new SimpleNodeAttribute("timeoutMillis", nonstopConfiguration.getTimeoutMillis()).optional(true).defaultValue( NonstopConfiguration.DEFAULT_TIMEOUT_MILLIS)); addAttribute(new SimpleNodeAttribute("searchTimeoutMillis", nonstopConfiguration.getSearchTimeoutMillis()).optional(true).defaultValue( NonstopConfiguration.DEFAULT_SEARCH_TIMEOUT_MILLIS)); }
private void init() { if (nonstopConfiguration == null) { return; } if (nonstopConfiguration.getTimeoutBehavior() != null && !isDefault(nonstopConfiguration.getTimeoutBehavior())) { addChildElement(new TimeoutBehaviorConfigurationElement(this, nonstopConfiguration.getTimeoutBehavior())); } addAttribute(new SimpleNodeAttribute("enabled", nonstopConfiguration.isEnabled()).optional(true).defaultValue( NonstopConfiguration.DEFAULT_ENABLED)); addAttribute(new SimpleNodeAttribute("immediateTimeout", nonstopConfiguration.isImmediateTimeout()).optional(true).defaultValue( NonstopConfiguration.DEFAULT_IMMEDIATE_TIMEOUT)); addAttribute(new SimpleNodeAttribute("timeoutMillis", nonstopConfiguration.getTimeoutMillis()).optional(true).defaultValue( NonstopConfiguration.DEFAULT_TIMEOUT_MILLIS)); addAttribute(new SimpleNodeAttribute("searchTimeoutMillis", nonstopConfiguration.getSearchTimeoutMillis()).optional(true).defaultValue( NonstopConfiguration.DEFAULT_SEARCH_TIMEOUT_MILLIS)); }