* does not exist.
* @throws RepositoryException if an error occurs.
*/
ItemState resolve() throws ItemNotFoundException, RepositoryException {
// check if already resolved
ItemState state = internalGetItemState();
// not yet resolved. retrieve and keep soft reference to state
if (state == null) {
try {
state = doResolve();
// set the item state unless 'setItemState' has already been
// called by the ItemStateFactory (recall internalGetItemState)
if (internalGetItemState() == null) {
setItemState(state);
}
} catch (ItemNotFoundException e) {
remove();
throw e;
}
} else if (state.getStatus() == Status.INVALIDATED) {
// completely reload this entry, but don't reload recursively
reload(false);
}
return state;
}