Package org.apache.openjpa.lib.util.concurrent

Examples of org.apache.openjpa.lib.util.concurrent.ConcurrentReferenceHashMap


            return false;

        Boolean isAssignable = null;
        Map assignableTo = (Map) _assignableTypes.get(from);
        if (assignableTo == null) { // "to" cache doesn't exist, so create it...
            assignableTo = new ConcurrentReferenceHashMap(ReferenceMap.WEAK,
                    ReferenceMap.HARD);
            _assignableTypes.put(from, assignableTo);
        } else { // "to" cache exists...
            isAssignable = (Boolean) assignableTo.get(to);
        }
View Full Code Here


            cacheMap = new ConcurrentHashMap(size, load) {
                public void overflowRemoved(Object key, Object value) {
                    cacheMapOverflowRemoved(key, value);
                }
            };
            softMap = new ConcurrentReferenceHashMap(ReferenceMap.HARD,
                ReferenceMap.SOFT, size, load) {
                public void overflowRemoved(Object key, Object value) {
                    softMapOverflowRemoved(key, value);
                }
View Full Code Here

    private static void setGetterMethod(Class<?> cls, String prop,
        Method method) {
        Map<String, Method> clsMap = getterMethodCache.get(cls);
        if (clsMap == null) {
            clsMap = new ConcurrentReferenceHashMap(ReferenceMap.HARD,
                ReferenceMap.WEAK);
            getterMethodCache.put(cls, clsMap);
        }
        clsMap.put(prop, method);
    }
View Full Code Here

    private static void setSetterMethod(Class<?> cls, String prop,
        Method method) {
        Map<String, Method> clsMap = setterMethodCache.get(cls);
        if (clsMap == null) {
            clsMap = new ConcurrentReferenceHashMap(ReferenceMap.HARD,
                ReferenceMap.WEAK);
            setterMethodCache.put(cls, clsMap);
        }
        clsMap.put(prop, method);
    }
View Full Code Here

        public Default() {
            initializeMaps();
        }

        private void initializeMaps() {
            ConcurrentReferenceHashMap statsMap =
                new ConcurrentReferenceHashMap(ReferenceMap.HARD, ReferenceMap.HARD, CONCURRENCY, LOAD_FACTOR);
            statsMap.setMaxSize(FIXED_SIZE);
            stats = statsMap;

            ConcurrentReferenceHashMap aStatsMap =
                new ConcurrentReferenceHashMap(ReferenceMap.HARD, ReferenceMap.HARD, CONCURRENCY, LOAD_FACTOR);
            aStatsMap.setMaxSize(FIXED_SIZE);
            astats = aStatsMap;
        }
View Full Code Here

    public Default() {
            initializeMaps();
        }

        private void initializeMaps() {
            ConcurrentReferenceHashMap statsMap =
                new ConcurrentReferenceHashMap(ReferenceMap.HARD, ReferenceMap.HARD, CONCURRENCY, LOAD_FACTOR);
            statsMap.setMaxSize(FIXED_SIZE);
            stats = statsMap;

            ConcurrentReferenceHashMap aStatsMap =
                new ConcurrentReferenceHashMap(ReferenceMap.HARD, ReferenceMap.HARD, CONCURRENCY, LOAD_FACTOR);
            aStatsMap.setMaxSize(FIXED_SIZE);
            astats = aStatsMap;
        }
View Full Code Here

    public CacheMap(boolean lru, int max, int size, float load,
        int concurrencyLevel) {
        if (size < 0)
            size = 500;

        softMap = new ConcurrentReferenceHashMap(ReferenceMap.HARD,
            ReferenceMap.SOFT, size, load) {
            public void overflowRemoved(Object key, Object value) {
                softMapOverflowRemoved(key, value);
            }
View Full Code Here

    private static void setGetterMethod(Class<?> cls, String prop,
        Method method) {
        Map<String, Method> clsMap = getterMethodCache.get(cls);
        if (clsMap == null) {
            clsMap = new ConcurrentReferenceHashMap(ReferenceMap.HARD,
                ReferenceMap.WEAK);
            getterMethodCache.put(cls, clsMap);
        }
        clsMap.put(prop, method);
    }
View Full Code Here

    private static void setSetterMethod(Class<?> cls, String prop,
        Method method) {
        Map<String, Method> clsMap = setterMethodCache.get(cls);
        if (clsMap == null) {
            clsMap = new ConcurrentReferenceHashMap(ReferenceMap.HARD,
                ReferenceMap.WEAK);
            setterMethodCache.put(cls, clsMap);
        }
        clsMap.put(prop, method);
    }
View Full Code Here

    public CacheMap(boolean lru, int max, int size, float load,
        int concurrencyLevel) {
        if (size < 0)
            size = 500;

        softMap = new ConcurrentReferenceHashMap(ReferenceMap.HARD,
            ReferenceMap.SOFT, size, load) {
            public void overflowRemoved(Object key, Object value) {
                softMapOverflowRemoved(key, value);
            }
View Full Code Here

TOP

Related Classes of org.apache.openjpa.lib.util.concurrent.ConcurrentReferenceHashMap

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.