Package net.sf.cache4j

Examples of net.sf.cache4j.CacheConfig


    /**
     * �������� ������. �������� null. ��������� ������ ���� null.
     */
    public static boolean test_PUT_OBJ_PUT_NULL_GET() throws Exception {
        BlockingCache cache = new BlockingCache();
        CacheConfig cacheConfig = new CacheConfigImpl("cacheId", null, 0, 0, 0, 0, null, "lru", "strong");
        cache.setCacheConfig(cacheConfig);

        Object key = "key";
        Object value = "value";

View Full Code Here


    /**
     * �������� ������. ������� ������. ��������� ������ ���� null.
     */
    public static boolean test_PUT_REMOVE_GET() throws Exception {
        BlockingCache cache = new BlockingCache();
        CacheConfig cacheConfig = new CacheConfigImpl("cacheId", null, 0, 0, 0, 0, null, "lru", "strong");
        cache.setCacheConfig(cacheConfig);

        Object key = "key";
        Object value = "value";

View Full Code Here

    /**
     * �������� ������. ������� ���. ��������� ������ ���� null.
     */
    public static boolean test_PUT_CLEAR_GET() throws Exception {
        BlockingCache cache = new BlockingCache();
        CacheConfig cacheConfig = new CacheConfigImpl("cacheId", null, 0, 0, 0, 0, null, "lru", "strong");
        cache.setCacheConfig(cacheConfig);

        Object key = "key";
        Object value = "value";

View Full Code Here

     * ��� ����������. ����������� ������ ���� ������������ ���������� ��������.
     */
    public static boolean test_MAXSIZE() throws Exception {
        BlockingCache cache = new BlockingCache();
        int maxSize = 100;
        CacheConfig cacheConfig = new CacheConfigImpl("cacheId", null, 0, 0, 0, maxSize, null, "lru", "strong");
        cache.setCacheConfig(cacheConfig);

        for (int i = 0, maxi = maxSize*2; i <maxi; i++) {
            cache.put(new Long(i), new Long(i));
        }
View Full Code Here

     * ������������.
     */
    public static boolean test_MAXMEMORYSIZE() throws Exception {
        BlockingCache cache = new BlockingCache();
        int maxMemorySize = 1000;
        CacheConfig cacheConfig = new CacheConfigImpl("cacheId", null, 0, 0, maxMemorySize, 0, null, "lru", "strong");
        cache.setCacheConfig(cacheConfig);

        for (int i = 0; i <1000; i++) {
            cache.put(new Long(i), new Long(i));
        }
View Full Code Here

     */
    public static boolean test_MAXSIZE_AND_MAXMEMORYSIZE() throws Exception {
        BlockingCache cache = new BlockingCache();
        int maxMemorySize = 1000;
        int maxSize = 1000;
        CacheConfig cacheConfig = new CacheConfigImpl("cacheId", null, 0, 0, maxMemorySize, maxSize, null, "lru", "strong");
        cache.setCacheConfig(cacheConfig);

        for (int i = 0; i <maxSize*2; i++) {
            cache.put(new Long(i), new Long(i));
        }
View Full Code Here

     * ������������� ����� �� ����� ����������� ������������ �����.
     * � ���������� ��� ������ ������� null.
     */
    public static boolean test_TTL() throws Exception {
        BlockingCache cache = new BlockingCache();
        CacheConfig cacheConfig = new CacheConfigImpl("cacheId", null, 1, 0, 0, 0, null, "lru", "strong");
        cache.setCacheConfig(cacheConfig);

        Object key = "key";
        Object value = "value";

View Full Code Here

     * ������������� ����� �� ����� ����������� ������������ �����.
     * � ���������� ��� ������ ������� null.
     */
    public static boolean test_IDLE() throws Exception {
        BlockingCache cache = new BlockingCache();
        CacheConfig cacheConfig = new CacheConfigImpl("cacheId", null, 0, 1, 0, 0, null, "lru", "strong");
        cache.setCacheConfig(cacheConfig);

        Object key = "key";
        Object value = "value";

View Full Code Here

        long ttl = 100;
        long cleanInterval = ttl*2;
        long sleep = ttl*3;

        BlockingCache cache = new BlockingCache();
        CacheConfig cacheConfig = new CacheConfigImpl("cacheId", null, ttl, 0, 0, 0, null, "lru", "strong");
        cache.setCacheConfig(cacheConfig);

        for (int i = 0; i <1000; i++) {
            cache.put(new Long(i), new Long(i));
        }
View Full Code Here

        long idle = 100;
        long cleanInterval = idle*2;
        long sleep = idle*3;

        BlockingCache cache = new BlockingCache();
        CacheConfig cacheConfig = new CacheConfigImpl("cacheId", null, 0, idle, 0, 0, null, "lru", "strong");
        cache.setCacheConfig(cacheConfig);

        for (int i = 0; i <1000; i++) {
            cache.put(new Long(i), new Long(i));
        }
View Full Code Here

TOP

Related Classes of net.sf.cache4j.CacheConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.