SecondLevelCacheUtilpublic class SecondLevelCacheUtil extends Object Utilities related to the Hibernate 2nd Level Cache |
Fields Summary |
---|
public static final String | HIBERNATE_CACHE_REGION_PREFIX |
Constructors Summary |
---|
private SecondLevelCacheUtil()
|
Methods Summary |
---|
public static java.lang.String | createCacheRegionPrefix(java.lang.String earName, java.lang.String jarName, java.lang.String unitName)
StringBuilder sb = new StringBuilder();
if (earName != null)
{
sb.append(earName);
if (!earName.endsWith(".ear"))
sb.append("_ear");
sb.append(",");
}
if (jarName != null)
{
sb.append(jarName);
if (!jarName.endsWith(".jar"))
sb.append("_jar");
sb.append(",");
}
sb.append(unitName);
String raw = sb.toString();
// Replace any '.' otherwise the JBoss Cache integration may replace
// it with a '/' and it will become a level in the FQN
String escaped = raw.replace('.", '_");
return escaped;
| public static java.lang.String | createRegionFqn(java.lang.String regionName, java.lang.String regionPrefix)
String escaped = null;
int idx = -1;
if (regionPrefix != null)
{
idx = regionName.indexOf(regionPrefix);
}
if (idx > -1)
{
int regionEnd = idx + regionPrefix.length();
String prefix = regionName.substring(0, regionEnd);
String suffix = regionName.substring(regionEnd);
suffix = suffix.replace('.", '/");
escaped = prefix + suffix;
}
else
{
escaped = regionName.replace('.", '/");
}
return escaped;
| public static boolean | isSharedClassLoaderRegion(java.lang.String regionName)
return (StandardQueryCache.class.getName().equals(regionName)
|| UpdateTimestampsCache.class.getName().equals(regionName));
|
|