if (status == STATUS_INVALIDATED || status == STATUS_DESTROYED) {
// this instance is already 'invalid', get outta here
return;
}
ItemState transientState = getOrCreateTransientItemState();
if (transientState.getStatus() == ItemState.STATUS_NEW) {
// this is a 'new' item, simply dispose the transient state
// (it is no longer used); this will indirectly (through
// stateDiscarded listener method) invalidate this instance permanently
stateMgr.disposeTransientItemState(transientState);
} else {
// this is an 'existing' item (i.e. it is backed by persistent
// state), mark it as 'removed'
transientState.setStatus(ItemState.STATUS_EXISTING_REMOVED);
// transfer the transient state to the attic
stateMgr.moveTransientItemStateToAttic(transientState);
// set state of this instance to 'invalid'
data.setStatus(STATUS_INVALIDATED);