use of com.thoughtworks.go.domain.PersistentObject in project gocd by gocd.
the class GoCache method logUnsavedPersistentObjectInteraction.
private void logUnsavedPersistentObjectInteraction(Object value, String message) {
if (value instanceof PersistentObject) {
for (Class<? extends PersistentObject> nullObjectClass : nullObjectClasses) {
if (value.getClass().equals(nullObjectClass)) {
return;
}
}
PersistentObject persistentObject = (PersistentObject) value;
if (!persistentObject.hasId()) {
String msg = String.format(message, persistentObject);
IllegalStateException exception = new IllegalStateException();
LOGGER.error(msg, exception);
throw bomb(msg, exception);
}
}
}
use of com.thoughtworks.go.domain.PersistentObject in project gocd by gocd.
the class GoCache method getWithoutTransactionCheck.
private Object getWithoutTransactionCheck(String key) {
Element element = ehCache.get(key);
if (element == null) {
return null;
}
Object value = element.getObjectValue();
logUnsavedPersistentObjectInteraction(value, "PersistentObject {} without an id served out of cache.");
return value;
}
Aggregations