CacheManagerImpl.java 文件源码

java
阅读 24 收藏 0 点赞 0 评论 0

项目:Telepathology 作者:
/**
 * The operations are pulled from the core cache and the member regions.
 * @param cache 
 *
 */
private OpenMBeanOperationInfo[] createMBeanOperationInfo()
{
    List<OpenMBeanOperationInfo> operations = new ArrayList<OpenMBeanOperationInfo>();

    for(Cache cache : getKnownCaches())
    {
        if(cache != null && !cache.isInitialized())
            operations.add(
                new OpenMBeanOperationInfoSupport(initializePrefix + cache.getName(), 
                        "Initialize the cache (root directory must be set first) \n" +
                        "This action is ignored if the cache is initialized.\n" + 
                        "If the cache has been started with a valid configuration state available \n" +
                        "it will start in an initialized state.  Changes to configuration will then require a restart of the server.", 
                        new OpenMBeanParameterInfo[]{}, 
                        SimpleType.VOID, MBeanOperationInfo.ACTION)
            );

        if(cache != null && cache.isInitialized() && !cache.isEnabled() )
            operations.add(
                new OpenMBeanOperationInfoSupport(enablePrefix + cache.getName(), 
                        "Enable the cache (cache must be initialized)", 
                        new OpenMBeanParameterInfo[]{}, 
                        SimpleType.VOID, MBeanOperationInfo.ACTION)
            );

        else if(cache != null && cache.isEnabled())
            operations.add(
                new OpenMBeanOperationInfoSupport(disablePrefix + cache.getName(), 
                        "Disable the cache (cache must be initialized and enabled)", 
                        new OpenMBeanParameterInfo[]{}, 
                        SimpleType.VOID, MBeanOperationInfo.ACTION)
            );
    }

    operations.add(
            new OpenMBeanOperationInfoSupport(storeOperation, 
                    "Store the named cache configuration to persistent storage", 
                    new OpenMBeanParameterInfo[]{new OpenMBeanParameterInfoSupport("name", "the bname of the cache to save configuration of", SimpleType.STRING)}, 
                    SimpleType.VOID, MBeanOperationInfo.ACTION)
        );

    operations.add(
            new OpenMBeanOperationInfoSupport(storeAllOperation, 
                    "Store all current cache configuration to persistent storage", 
                    new OpenMBeanParameterInfo[]{}, 
                    SimpleType.VOID, MBeanOperationInfo.ACTION)
        );

    operations.add(
            new OpenMBeanOperationInfoSupport(createOperation, 
                    "Create a new cache at the specified location.", 
                new OpenMBeanParameterInfo[]
                {
                    new OpenMBeanParameterInfoSupport("cacheName", "The name of the cache (and the root of the configuration file name)", SimpleType.STRING),
                    new OpenMBeanParameterInfoSupport("cacheLocation", "The URI of the cache location (e.g. 'file:///vix/cache' or 'smb://server/cacheroot')", SimpleType.STRING),
                    new OpenMBeanParameterInfoSupport("prototypeName", "The name of the prototype or blank(e.g. 'VixPrototype', 'TestWithEvictionPrototype')", SimpleType.STRING)
                }, 
                SimpleType.STRING, 
                MBeanOperationInfo.ACTION)
        );

    return operations.toArray(new OpenMBeanOperationInfoSupport[operations.size()]);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号