// Check Cache If Needed
String cacheKey = "user_" + user;
try {
if (useCache) {
User cachedObject = Cache.get(cacheKey, User.class);
if (cachedObject != null) {
return cachedObject;
}
}
} catch (Throwable t) {
// We don't want application failing because cache lookup didn't
// work
Logger.error(ExceptionUtil.getStackTrace(t));
}
// Cache Not Found - Hit Remote Service
User results = asObject(User.class, "user", userCheckPattern, user);
// Set Cache
try {
Cache.set(cacheKey, results, cacheExpiration);
} catch (Throwable t) {