/** * Provides implementation of Add method of the ICacheStorage interface. Add the key value pair to * the store. * * * @param key key * @param item object * @return returns the result of operation. */ @Override public StoreAddResult Add(Object key, Object item, boolean allowExtentedSize) { try { if (ServerMonitor.getMonitorActivity()) { ServerMonitor.LogClientActivity("Store.Add", ""); } if (_itemDict.containsKey(key)) { return StoreAddResult.KeyExists; } StoreStatus status = HasSpace((ISizable) item, allowExtentedSize); if (_reportCacheNearEviction) { CheckForStoreNearEviction(); } if (status == StoreStatus.HasNotEnoughSpace) { return StoreAddResult.NotEnoughSpace; } _itemDict.put(key, item); super.Added((ISizable) ((item instanceof ISizable) ? item : null)); if (status == StoreStatus.NearEviction) { return StoreAddResult.SuccessNearEviction; } } catch (OutOfMemoryError e) { return StoreAddResult.NotEnoughSpace; } catch (RuntimeException e) { throw e; } return StoreAddResult.Success; }