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

com.alachisoft.ncache.jsr107.NCacheManagementMXBean Maven / Gradle / Ivy

There is a newer version: 5.3.0
Show newest version
package com.alachisoft.ncache.jsr107;

import javax.cache.configuration.CompleteConfiguration;
import javax.cache.management.CacheMXBean;

public class NCacheManagementMXBean extends NCacheMXBean implements CacheMXBean {

    /**
     * @param jCache
     */
    public NCacheManagementMXBean(final NCacheCache jCache) {
        super(jCache, "Configuration");
    }

    /**
     * Determines the required type of keys for this Cache, if any.
     *
     * @return
     */
    @Override
    public String getKeyType() {
        //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
        return jCache.getConfiguration(CompleteConfiguration.class).getKeyType().getName();
    }

    /**
     * Determines the required type of values for this Cache, if any.
     *
     * @return
     */
    @Override
    public String getValueType() {
        //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
        return jCache.getConfiguration(CompleteConfiguration.class).getValueType().getName();
    }

    /**
     * Determines if a Cache should operate in read-through mode.
     *
     * @return
     */
    @Override
    public boolean isReadThrough() {
        //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
        return ((CompleteConfiguration) jCache.getConfiguration(CompleteConfiguration.class)).isReadThrough();
    }

    /**
     * Determines if a Cache should operate in "write-through" mode.
     *
     * @return
     */
    @Override
    public boolean isWriteThrough() {
        //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
        return ((CompleteConfiguration) jCache.getConfiguration(CompleteConfiguration.class)).isWriteThrough();
    }

    /**
     * Whether storeByValue (true) or storeByReference (false). When true, both keys and values are stored by value.
     *
     * @return
     */

    @Override
    public boolean isStoreByValue() {
        //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
        return jCache.getConfiguration(CompleteConfiguration.class).isStoreByValue();
    }

    /**
     * Checks whether statistics collection is enabled in this cache.
     *
     * @return
     */

    @Override
    public boolean isStatisticsEnabled() {
        //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
        return ((CompleteConfiguration) jCache.getConfiguration(CompleteConfiguration.class)).isStatisticsEnabled();
    }

    /**
     * Checks whether management is enabled on this cache.
     *
     * @return
     */

    @Override
    public boolean isManagementEnabled() {
        //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
        return ((CompleteConfiguration) jCache.getConfiguration(CompleteConfiguration.class)).isManagementEnabled();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy