/** * Assert that the current product is compatible with the version of ehcache available on the classpath */ public void assertRequiredCoreVersionPresent() { boolean ignoreVersionCheck = Boolean.getBoolean("terracotta.ehcache.versioncheck.skip"); String requiredCoreVersion = getRequiredCoreVersion(); if (ignoreVersionCheck || requiredCoreVersion == null) { // no requirement return; } ProductInfo coreProductInfo = new ProductInfo(); String coreVersion = coreProductInfo.getVersion(); if (!coreVersion.equals(requiredCoreVersion)) { String msg = getName() + " version [" + getVersion() + "] only works with ehcache-core version [" + requiredCoreVersion + "] (found version [" + coreVersion + "] on the classpath). " + " Please make sure both versions are compatible!"; throw new CacheException(msg); } }
/** * returns long version of the build string */ @Override public String toString() { String versionString = String.format("%s version %s was built on %s, at revision %s, with jdk %s", getName(), getVersion(), getBuildTime(), getBuildRevision(), getBuildJdk()); if (!UNKNOWN.equals(getPatchLevel())) { versionString = versionString + ". Patch level " + getPatchLevel(); } return versionString; } }
/** * Construct a default product info */ public ProductInfo() { parseProductInfo(EHCACHE_VERSION_RESOURCE); }
private void logEhcacheBuildInfo() { final ProductInfo ehcacheCoreProductInfo = new ProductInfo(); // ToolkitLogger logger = ((ToolkitInternal) toolkitInstanceFactory.getToolkit()) // .getLogger(TerracottaClusteredInstanceFactory.class.getName()); LOGGER.info(ehcacheCoreProductInfo.toString()); }
/** * returns long version of the build string */ @Override public String toString() { String versionString = String.format("%s version %s was built on %s, at revision %s, with jdk %s by %s@%s", getName(), getVersion(), getBuildTime(), getBuildRevision(), getBuildJdk(), getBuiltBy(), getBuildHostname()); if (!UNKNOWN.equals(getPatchLevel())) { versionString = versionString + ". Patch level " + getPatchLevel(); } return versionString; } }
ProductInfo productInfo = new ProductInfo(); String productName = productInfo.getName().toLowerCase(); StringBuilder sb = new StringBuilder(); sb.append("kitID="); sb.append(urlEncode(getProperty("os.arch"))); sb.append("&tc-version="); sb.append(productInfo.getVersion()); sb.append("&tc-product="); sb.append(urlEncode(productInfo.getName() + " " + productInfo.getVersion())); sb.append("&source="); sb.append(urlEncode(productInfo.getName())); sb.append("&uptime-secs="); sb.append(getUptimeInSeconds()); sb.append("&patch="); sb.append(urlEncode(productInfo.getPatchLevel())); return sb.toString();
public DefaultCacheResolverFactory(CacheManager cacheManager) { this.cacheManager = cacheManager; final ProductInfo productInfo = new ProductInfo(); final String version = productInfo.getVersion(); this.badSelfPopulatingCache = version.equals("2.3.0") || version.equals("2.3.1"); }
return new ProductInfo(in);
JSONObject response = products.getProducts(); JSONObject result = response.getJSONArray("results").get(0); ProductInfo pi = new ProductInfo(); pi.deserialize(result, type, context );
private void prepareParams() { ProductInfo productInfo = new ProductInfo(); String productName = productInfo.getName().toLowerCase(); String kitId = "ehcache.default"; if (productName.contains("ehcache")) { kitId = "ehcache.default"; } else if (productName.contains("bigmemory")) { kitId = "bigmemory.default"; } else { throw new AssertionError("Unknown product name: " + productName); } putUrlSafe("kitID", kitId); putUrlSafe("id", Integer.toString(getClientId())); putUrlSafe("os-name", getProperty("os.name")); putUrlSafe("jvm-name", getProperty("java.vm.name")); putUrlSafe("jvm-version", getProperty("java.version")); putUrlSafe("platform", getProperty("os.arch")); putUrlSafe("tc-version", productInfo.getVersion()); putUrlSafe("tc-product", productInfo.getName() + " " + productInfo.getVersion()); putUrlSafe("source", productInfo.getName()); putUrlSafe("uptime-secs", Long.toString(getUptimeInSeconds())); putUrlSafe("patch", productInfo.getPatchLevel()); }
String currentVersion = new ProductInfo().getVersion(); String propVal = updateProps.getProperty("general.notice"); if (notBlank(propVal)) {
function Product() { var self = this; self.productInfo1 = new ProductInfo(); self.productInfo2 = new ProductInfo(); }
private void logEhcacheBuildInfo() { final TCLogger logger = ManagerUtil.getLogger(TerracottaClusteredInstanceFactory.class.getName()); ProductInfo ehcacheCoreProductInfo = new ProductInfo(); logger.info(ehcacheCoreProductInfo.toString()); }
/** * returns long version of the build string */ @Override public String toString() { String versionString = String.format("%s version %s was built on %s, at revision %s, with jdk %s", getName(), getVersion(), getBuildTime(), getBuildRevision(), getBuildJdk()); if (!UNKNOWN.equals(getPatchLevel())) { versionString = versionString + ". Patch level " + getPatchLevel(); } return versionString; } }
/** * Assert that the current product is compatible with the version of ehcache available on the classpath */ public void assertRequiredCoreVersionPresent() { boolean ignoreVersionCheck = Boolean.getBoolean("terracotta.ehcache.versioncheck.skip"); String requiredCoreVersion = getRequiredCoreVersion(); if (ignoreVersionCheck || requiredCoreVersion == null) { // no requirement return; } ProductInfo coreProductInfo = new ProductInfo(); String coreVersion = coreProductInfo.getVersion(); if (!coreVersion.equals(requiredCoreVersion)) { String msg = getName() + " version [" + getVersion() + "] only works with ehcache-core version [" + requiredCoreVersion + "] (found version [" + coreVersion + "] on the classpath). " + " Please make sure both versions are compatible!"; throw new CacheException(msg); } }
String currentVersion = new ProductInfo().getVersion(); String propVal = updateProps.getProperty("general.notice"); if (notBlank(propVal)) {
public ProductInfo deserialize(JSONObject results, Type type, JsonDeserializationContext context) throws JsonParseException { JSONArray resultsArray = results.getJSONArray("results"); JSONObject objekt = resultsArray.getJSONObject(0); String name = objekt.get("name").toString(); String category = objekt.get("category").toString(); String price = objekt.get("price").toString(); return new ProductInfo(name, category, price); }
/** * Construct product info object from a resource name * * @param resource */ public ProductInfo(String resource) { parseProductInfo(resource); }
/** * returns long version of the build string */ @Override public String toString() { String versionString = String.format("%s version %s was built on %s, at revision %s, with jdk %s", getName(), getVersion(), getBuildTime(), getBuildRevision(), getBuildJdk()); if (!UNKNOWN.equals(getPatchLevel())) { versionString = versionString + ". Patch level " + getPatchLevel(); } return versionString; } }