Java 类net.sf.ehcache.config.Searchable 实例源码

项目:FinanceAnalytics    文件:AbstractEHCachingMaster.java   
private CacheConfiguration tweakCacheConfiguration(CacheConfiguration cacheConfiguration) {

    // Set searchable index
    Searchable uidToDocumentCacheSearchable = new Searchable();
    uidToDocumentCacheSearchable.addSearchAttribute(new SearchAttribute().name("ObjectId")
                                                        .expression("value.getObjectId().toString()"));
    uidToDocumentCacheSearchable.addSearchAttribute(new SearchAttribute().name("VersionFromInstant")
                                                        .className("com.opengamma.master.cache.InstantExtractor"));
    uidToDocumentCacheSearchable.addSearchAttribute(new SearchAttribute().name("VersionToInstant")
                                                        .className("com.opengamma.master.cache.InstantExtractor"));
    uidToDocumentCacheSearchable.addSearchAttribute(new SearchAttribute().name("CorrectionFromInstant")
                                                        .className("com.opengamma.master.cache.InstantExtractor"));
    uidToDocumentCacheSearchable.addSearchAttribute(new SearchAttribute().name("CorrectionToInstant")
                                                        .className("com.opengamma.master.cache.InstantExtractor"));
    cacheConfiguration.addSearchable(uidToDocumentCacheSearchable);

    // Make copies of cached objects
    CopyStrategyConfiguration copyStrategyConfiguration = new CopyStrategyConfiguration();
    copyStrategyConfiguration.setClass("com.opengamma.master.cache.JodaBeanCopyStrategy");
    cacheConfiguration.addCopyStrategy(copyStrategyConfiguration);
    cacheConfiguration.setCopyOnRead(true);
    cacheConfiguration.setCopyOnWrite(true);

    cacheConfiguration.setStatistics(true);

    return cacheConfiguration;
  }
项目:joynr    文件:DomainAccessControlStoreEhCache.java   
private Cache createAclCache(CacheId cacheId) {
    // configure cache as searchable
    CacheConfiguration cacheConfig = new CacheConfiguration(cacheId.getIdAsString(), 0).eternal(true);
    Searchable searchable = new Searchable();
    cacheConfig.addSearchable(searchable);
    // register searchable attributes
    searchable.addSearchAttribute(new SearchAttribute().name(UserDomainInterfaceOperationKey.USER_ID));
    searchable.addSearchAttribute(new SearchAttribute().name(UserDomainInterfaceOperationKey.DOMAIN));
    searchable.addSearchAttribute(new SearchAttribute().name(UserDomainInterfaceOperationKey.INTERFACE));
    searchable.addSearchAttribute(new SearchAttribute().name(UserDomainInterfaceOperationKey.OPERATION));
    cacheManager.addCache(new Cache(cacheConfig));
    return cacheManager.getCache(cacheId.getIdAsString());
}
项目:joynr    文件:DomainAccessControlStoreEhCache.java   
private Cache createDrtCache() {
    // configure cache as searchable
    CacheConfiguration cacheConfig = new CacheConfiguration(CacheId.DOMAIN_ROLES.getIdAsString(), 0).eternal(true);
    Searchable searchable = new Searchable();
    cacheConfig.addSearchable(searchable);
    // register searchable attributes
    searchable.addSearchAttribute(new SearchAttribute().name(UserRoleKey.USER_ID));
    searchable.addSearchAttribute(new SearchAttribute().name(UserRoleKey.ROLE));
    cacheManager.addCache(new Cache(cacheConfig));
    return cacheManager.getCache(CacheId.DOMAIN_ROLES.getIdAsString());
}
项目:sdcct    文件:CacheFactoryBean.java   
@Nullable
public Searchable getSearchable() {
    return this.searchable;
}
项目:sdcct    文件:CacheFactoryBean.java   
public void setSearchable(@Nullable Searchable searchable) {
    this.searchable = searchable;
}