All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.maxifier.mxcache.storage.LongObjectStorage Maven / Gradle / Ivy

Go to download

Constains all classes necessary for launching a MxCache-instrumentated application

There is a newer version: 2.6.9
Show newest version
/*
 * Copyright (c) 2008-2014 Maxifier Ltd. All Rights Reserved.
 */
package com.maxifier.mxcache.storage;

/**
 * THIS IS GENERATED CLASS! DON'T EDIT IT MANUALLY!
 *
 * GENERATED FROM P2OStorage.template
 *
 * 

* This is a basic implementation of cache storage. It is very similar to a usual map. * It supports two main operations: load and save for corresponding key and value types. *

*

* There are no storages with primitive value types due to the following: *

*
    *
  • using object as value allows to store special marker-values (UNDEFINED, exceptions, etc.) without an overhead; *
  • *
  • it simplifies the code: you don't need to have a separate 'isCalculated(key)' method.
  • *
* * @author Andrey Yakoushin ([email protected]) * @author Alexander Kochurov ([email protected]) */ public interface LongObjectStorage extends Storage { /** *

This method should extract value for given key from internal representation.

*

It is guaranteed that it would be called with corresponding lock held.

* @param key key * @return {@link Storage#UNDEFINED} if no value for key exists, value itself if it's set for given key. */ Object load(long key); /** *

Saves a value to cache.

*

It is guaranteed that it would be called with corresponding lock held.

* @param key cache key * @param value cache value */ void save(long key, Object value); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy