Package net.sf.cache4j

Examples of net.sf.cache4j.CacheConfig


     * ������������� ����� �� ����� ����������� ������������ �����.
     * � ���������� ��� ������ ������� null.
     */
    public static boolean test_IDLE() throws Exception {
        SynchronizedCache cache = new SynchronizedCache();
        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;

        SynchronizedCache cache = new SynchronizedCache();
        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;

        SynchronizedCache cache = new SynchronizedCache();
        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

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

        Object o1 = "o1";
        Object o2 = "o2";
        Object o3 = "o3";
View Full Code Here

     * ��������� �������� ���������� LFU. ��� ������������ ���� ������ ���������
     * ������ ������� ������������� ���������� ���������� ���.
     */
    public static boolean test_EVICTION_ALGORITHM_LFU() throws Exception {
        SynchronizedCache cache = new SynchronizedCache();
        CacheConfig cacheConfig = new CacheConfigImpl("cacheId", null, 0, 0, 0, 2, null, "lfu", "strong");
        cache.setCacheConfig(cacheConfig);

        Object o1 = "o1";
        Object o2 = "o2";
        Object o3 = "o3";
View Full Code Here

     * ��������� �������� ���������� FIFO. ��� ������������ ���� ������ ���������
     * ������ � ���������� �������� ��������.
     */
    public static boolean test_EVICTION_ALGORITHM_FIFO() throws Exception {
        SynchronizedCache cache = new SynchronizedCache();
        CacheConfig cacheConfig = new CacheConfigImpl("cacheId", null, 0, 0, 0, 2, null, "fifo", "strong");
        cache.setCacheConfig(cacheConfig);

        Object o1 = "o1";
        Object o2 = "o2";
        Object o3 = "o3";
View Full Code Here

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

        int i = 0;
        try {
            for (; i <10; i++) {
View Full Code Here

     * ��������� ��� ����� � �������� soft. ��� ��������� �������� ����������
     * �������� ���������� OutOfMemoryError �� ������ ��������.
     */
    public static boolean test_REFERENCE_SOFT() throws Exception {
        SynchronizedCache cache = new SynchronizedCache();
        CacheConfig cacheConfig = new CacheConfigImpl("cacheId", null, 0, 0, 0, 0, null, "lru", "soft");
        cache.setCacheConfig(cacheConfig);

        int i = 0;
        try {
            for (; i <10; i++) {
View Full Code Here

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

        int tcount = 10;
        int count = 10000;
        for (int i = 0; i <tcount; i++) {
View Full Code Here

    /**
     * �������� ������ � ������ ��� �� ����.
     */
    public static boolean test_PUT_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";
        cache.put(key, value);
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.