void release() { if (_ownServant) { if (_tx != null) { if (!_readOnly && !_removed) { if (_store.keepStats()) { EvictorI.updateStats(_rec.stats, IceInternal.Time.currentMonotonicTimeMillis()); } _store.update(_current.id, _rec, _tx); if (_trace >= 3) { _communicator .getLogger() .trace( "Freeze.Evictor", "updated \"" + _communicator.identityToString(_current.id) + "\" with facet \"" + _store.facet() + "\" within transaction"); } } if (!_readOnly || _removed) { _invalidateList.add(new ToInvalidate(_current.id, _store)); } } _stack.pop(); } }
@Override public Ice.ObjectPrx addFacet(Ice.Object servant, Ice.Identity ident, String facet) { checkIdentity(ident); checkServant(servant); if (facet == null) { facet = ""; } _deactivateController.lock(); try { ObjectStore store = findStore(facet, _createDb); if (store == null) { NotFoundException ex = new NotFoundException(); ex.message = _errorPrefix + "addFacet: could not open database for facet '" + facet + "'"; throw ex; } long currentTime = 0; ObjectRecord rec; if (store.keepStats()) { currentTime = IceInternal.Time.currentMonotonicTimeMillis(); rec = new ObjectRecord(servant, new Statistics(currentTime, 0, 0)); } else { rec = new ObjectRecord(servant, null); } TransactionI tx = beforeQuery(); if (store.keepStats()) { updateStats(rec.stats, currentTime); } if (!store.insert(ident, rec, tx)) { Ice.AlreadyRegisteredException ex = new Ice.AlreadyRegisteredException(); ex.kindOfObject = "servant"; ex.id = _communicator.identityToString(ident); if (facet.length() > 0) { ex.id += " -f " + IceUtilInternal.StringUtil.escapeString(facet, ""); } throw ex; } if (_trace >= 1) { String objString = "object \"" + _communicator.identityToString(ident) + "\""; if (!facet.equals("")) { objString += " with facet \"" + facet + "\""; } _communicator .getLogger() .trace("Freeze.Evictor", "added " + objString + " to Db \"" + _filename + "\""); } Ice.ObjectPrx obj = _adapter.createProxy(ident); if (facet.length() > 0) { obj = obj.ice_facet(facet); } return obj; } finally { _deactivateController.unlock(); } }