private TimeoutBehaviorConfiguration timeout(final Config config) { TimeoutBehaviorConfiguration timeout = new TimeoutBehaviorConfiguration(); String sep = ";"; timeout.setProperties(toPropertiesLine(config.withoutPath("type"), sep)); timeout.setPropertySeparator(sep); timeout.setType(config.getString("type")); return timeout; }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } else if (obj == null || getClass() != obj.getClass()) { return false; } NonstopConfiguration other = (NonstopConfiguration) obj; if (bulkOpsTimeoutMultiplyFactor != other.bulkOpsTimeoutMultiplyFactor || configFrozen != other.configFrozen || enabled != other.enabled || immediateTimeout != other.immediateTimeout || searchTimeoutMillis != other.searchTimeoutMillis || timeoutMillis != other.timeoutMillis) { return false; } if (timeoutBehavior == null) { if (other.timeoutBehavior != null) { return false; } } else if (!timeoutBehavior.equals(other.timeoutBehavior)) { return false; } return true; }
private boolean isDefault(TimeoutBehaviorConfiguration timeoutBehavior) { boolean rv = true; if (!NonstopConfiguration.DEFAULT_TIMEOUT_BEHAVIOR.getType().equals(timeoutBehavior.getType())) { rv = false; } if (!NonstopConfiguration.DEFAULT_TIMEOUT_BEHAVIOR.getProperties().equals(timeoutBehavior.getProperties())) { rv = false; } if (!NonstopConfiguration.DEFAULT_TIMEOUT_BEHAVIOR.getPropertySeparator().equals(timeoutBehavior.getPropertySeparator())) { rv = false; } return rv; } }
private static void setupHibernateTimeoutBehavior(NonstopConfiguration nonstopConfig) { nonstopConfig.getTimeoutBehavior().setType( TimeoutBehaviorType.EXCEPTION.getTypeName() ); } }
/** * Set the properties * * @param value * @return this instance */ public TimeoutBehaviorConfiguration properties(String value) { this.setProperties(value); return this; }
/** * Set the property separator * * @param value * @return this instance */ public TimeoutBehaviorConfiguration propertySeparator(String value) { this.setPropertySeparator(value); return this; }
/** * {@inheritDoc} */ @Override public NonstopConfiguration clone() throws CloneNotSupportedException { try { NonstopConfiguration clone = (NonstopConfiguration) super.clone(); clone.addTimeoutBehavior((TimeoutBehaviorConfiguration) timeoutBehavior.clone()); return clone; } catch (CloneNotSupportedException e) { throw new CacheException(e); } } }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + bulkOpsTimeoutMultiplyFactor; result = prime * result + (configFrozen ? 1231 : 1237); result = prime * result + (enabled ? 1231 : 1237); result = prime * result + (immediateTimeout ? 1231 : 1237); result = prime * result + ((timeoutBehavior == null) ? 0 : timeoutBehavior.hashCode()); result = prime * result + (int) (timeoutMillis ^ (timeoutMillis >>> 32)); result = prime * result + (int) (searchTimeoutMillis ^ (searchTimeoutMillis >>> 32)); return result; }
/** * Set the type of timeout behavior * * @param type * @return this instance */ public TimeoutBehaviorConfiguration type(String type) { this.setType(type); return this; }
/** * Set the properties * * @param value * @return this instance */ public TimeoutBehaviorConfiguration properties(String value) { this.setProperties(value); return this; }
/** * Set the property separator * * @param value * @return this instance */ public TimeoutBehaviorConfiguration propertySeparator(String value) { this.setPropertySeparator(value); return this; }
/** * {@inheritDoc} */ @Override public NonstopConfiguration clone() throws CloneNotSupportedException { try { NonstopConfiguration clone = (NonstopConfiguration) super.clone(); clone.addTimeoutBehavior((TimeoutBehaviorConfiguration) timeoutBehavior.clone()); return clone; } catch (CloneNotSupportedException e) { throw new CacheException(e); } } }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + bulkOpsTimeoutMultiplyFactor; result = prime * result + (configFrozen ? 1231 : 1237); result = prime * result + (enabled ? 1231 : 1237); result = prime * result + (immediateTimeout ? 1231 : 1237); result = prime * result + ((timeoutBehavior == null) ? 0 : timeoutBehavior.hashCode()); result = prime * result + (int) (timeoutMillis ^ (timeoutMillis >>> 32)); return result; }
private void init() { if (timeoutBehaviorConfiguration == null) { return; } addAttribute(new SimpleNodeAttribute("type", timeoutBehaviorConfiguration.getType()).optional(true).defaultValue( TimeoutBehaviorConfiguration.DEFAULT_VALUE)); addAttribute(new SimpleNodeAttribute("properties", timeoutBehaviorConfiguration.getProperties()).optional(true).defaultValue( TimeoutBehaviorConfiguration.DEFAULT_PROPERTIES)); addAttribute(new SimpleNodeAttribute("propertySeparator", timeoutBehaviorConfiguration.getPropertySeparator()).optional(true) .defaultValue(TimeoutBehaviorConfiguration.DEFAULT_PROPERTY_SEPARATOR)); } }
private TimeoutBehaviorConfiguration timeout(final Config config) { TimeoutBehaviorConfiguration timeout = new TimeoutBehaviorConfiguration(); String sep = ";"; timeout.setProperties(toPropertiesLine(config.withoutPath("type"), sep)); timeout.setPropertySeparator(sep); timeout.setType(config.getString("type")); return timeout; }
private static void setupHibernateTimeoutBehavior(NonstopConfiguration nonstopConfig) { nonstopConfig.getTimeoutBehavior().setType(TimeoutBehaviorType.EXCEPTION.getTypeName()); }
/** * Set the properties * * @param value * @return this instance */ public TimeoutBehaviorConfiguration properties(String value) { this.setProperties(value); return this; }
/** * Set the property separator * * @param value * @return this instance */ public TimeoutBehaviorConfiguration propertySeparator(String value) { this.setPropertySeparator(value); return this; }
/** * {@inheritDoc} */ @Override public NonstopConfiguration clone() throws CloneNotSupportedException { try { NonstopConfiguration clone = (NonstopConfiguration) super.clone(); clone.addTimeoutBehavior((TimeoutBehaviorConfiguration) timeoutBehavior.clone()); return clone; } catch (CloneNotSupportedException e) { throw new CacheException(e); } }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + bulkOpsTimeoutMultiplyFactor; result = prime * result + (configFrozen ? 1231 : 1237); result = prime * result + (enabled ? 1231 : 1237); result = prime * result + (immediateTimeout ? 1231 : 1237); result = prime * result + ((timeoutBehavior == null) ? 0 : timeoutBehavior.hashCode()); result = prime * result + (int) (timeoutMillis ^ (timeoutMillis >>> 32)); result = prime * result + (int) (searchTimeoutMillis ^ (searchTimeoutMillis >>> 32)); return result; }