本文整理汇总了Java中com.googlecode.ehcache.annotations.Cacheable类的典型用法代码示例。如果您正苦于以下问题:Java Cacheable类的具体用法?Java Cacheable怎么用?Java Cacheable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Cacheable类属于com.googlecode.ehcache.annotations包,在下文中一共展示了Cacheable类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getFeedStatus
import com.googlecode.ehcache.annotations.Cacheable; //导入依赖的package包/类
@Cacheable(cacheName = "remoteCache", keyGenerator = @KeyGenerator(name = "ListCacheKeyGenerator") )
public GetFeedStatusResponse getFeedStatus(GetFeedStatusRequest request) {
GetFeedStatusResponse response = null;
try {
response = remoteFeedService.getFeedStatus(request);
lastKnownRepsonse.put(request, response);
} catch (Exception ex) {
LOGGER.debug("handleHeader() - Unable to check remote feed service", ex);
response = lastKnownRepsonse.get(request);
if (response != null) {
LOGGER.error(
"handleHeader() - Unable to check remote feed service (%s).... will use last response (%s) - %s",
request, response, ex.getMessage());
} else {
response = new GetFeedStatusResponse();
LOGGER.error("handleHeader() - Unable to check remote feed service (%s).... will assume OK (%s) - %s",
request, response, ex.getMessage());
}
}
LOGGER.debug("getFeedStatus() " + request + " -> " + response);
return response;
}
开发者ID:gchq,项目名称:stroom-proxy,代码行数:24,代码来源:RemoteFeedServiceCacheable.java
示例2: doRequest
import com.googlecode.ehcache.annotations.Cacheable; //导入依赖的package包/类
@Cacheable( cacheName = "categories", cacheNull = false )
public List<Items> doRequest(FindAllPlaylistsBuilder builder, PlaylistFieldsBuilder pfBuilder) throws VideoCloudRequestException {
Logger.getLogger(WebbvideoAbstractController.class.getName()).log(Level.INFO,
":"+"REQUEST_SERVICE");
CategoryItems entity;
try {
entity = restTemplate.getForObject(builder.build(pfBuilder), CategoryItems.class);
}
catch(RestClientException ex) {
Logger.getLogger(VideoCloudCategoriesRequestService.class.getName()).log(Level.SEVERE, null, ex);
throw new VideoCloudRequestException("Could not retrieve categories. ");
}
List<Items> items = entity.getItems();
if(items != null) {
Collections.sort(items, Items.COMPARE_BY_NAME);
}
return items;
}
开发者ID:malmostad,项目名称:sv-webbvideo,代码行数:23,代码来源:VideoCloudCategoriesRequestService.java
示例3: doRequest
import com.googlecode.ehcache.annotations.Cacheable; //导入依赖的package包/类
@Cacheable( cacheName = "categoryVideos", cacheNull = false )
public ItemsWithVideos doRequest(FindPlaylistByIdBuilder builder, PlaylistFieldsBuilder pfBuilder, VideoFieldsBuilder vfBuilder) throws VideoCloudRequestException {
Logger.getLogger(WebbvideoAbstractController.class.getName()).log(Level.INFO, builder.build(pfBuilder));
ItemsWithVideos entity;
try {
entity = restTemplate.getForObject(builder.build(pfBuilder,vfBuilder), ItemsWithVideos.class);
}
catch(RestClientException ex) {
Logger.getLogger(VideoCloudCategoryVideoRequestService.class.getName()).log(Level.SEVERE, null, ex);
throw new VideoCloudRequestException("Could not retrieve the playlist.");
}
return entity;
}
开发者ID:malmostad,项目名称:sv-webbvideo,代码行数:17,代码来源:VideoCloudCategoryVideoRequestService.java
示例4: getAutodiscoverEndpoint
import com.googlecode.ehcache.annotations.Cacheable; //导入依赖的package包/类
@Override
@Cacheable(cacheName="autodiscoverCache")
public String getAutodiscoverEndpoint(String email) throws AutodiscoverException {
String ewsUrl = null;
for(ExchangeAutodiscoverService service : getAutodiscoverServices()){
try {
ewsUrl = service.getAutodiscoverEndpoint(email);
} catch (AutodiscoverException e) {
log.warn("autodiscover failure: "+e.getMessage());
}
if(StringUtils.isNotBlank(ewsUrl)) return ewsUrl;
}
throw new AutodiscoverException("autodiscover failed. cannot find ewsurl for email="+email);
}
开发者ID:Bedework,项目名称:exchange-ws-client,代码行数:15,代码来源:CompositeAutodiscoverServiceImpl.java
示例5: getSkillsForRaceClass
import com.googlecode.ehcache.annotations.Cacheable; //导入依赖的package包/类
@Override
@Cacheable(cacheName = "skillsForRaceClassCache")
public List<SkillRaceClassInfoEntity> getSkillsForRaceClass(final Races race,
final Classes clazz) {
return this.skillRaceClassDao.findAll(Specifications.where(
SkillRaceClassSpecs.isClassMatchToClassMask(clazz)).and(
SkillRaceClassSpecs.isRaceMatchToRaceMask(race)));
}
开发者ID:JMaNGOS,项目名称:JMaNGOS,代码行数:9,代码来源:SkillServiceImpl.java
示例6: getAbilitiesForRaceClassSkill
import com.googlecode.ehcache.annotations.Cacheable; //导入依赖的package包/类
@Override
@Cacheable(cacheName = "abilitiesForRaceClassSkillCache")
public List<SkillLineAbilityEntity> getAbilitiesForRaceClassSkill(final Races race,
final Classes clazz, final int skill) {
return this.skillLineAbilityDao.findAll(Specifications.where(
SkillLineAbilitySpecs.isClassMatchToClassMask(clazz)).and(
SkillLineAbilitySpecs.isLearnOnGetSkill()).and(
SkillLineAbilitySpecs.isRaceMatchToRaceMask(race)).and(
SkillLineAbilitySpecs.isSkill(skill)));
}
开发者ID:JMaNGOS,项目名称:JMaNGOS,代码行数:11,代码来源:SkillLineAbilityServiceImpl.java
示例7: getAdvisorReports
import com.googlecode.ehcache.annotations.Cacheable; //导入依赖的package包/类
@Cacheable(cacheName="advisorReports", exceptionCacheName="cypressUnknownExceptionCache")
@Override
public AdvisorReports getAdvisorReports(String pvi) {
final HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.set("PVI", pvi);
final XmlAdvisorReports xmlAdvisorReports = this.restOperations.getForObject(this.statementsUrl, XmlAdvisorReports.class, httpHeaders, pvi);
return this.mapAdvisorReports(xmlAdvisorReports);
}
开发者ID:UW-Madison-DoIT,项目名称:advisor-reports-portlet,代码行数:11,代码来源:RestAdvisorReportDao.java
示例8: getFeedStatus
import com.googlecode.ehcache.annotations.Cacheable; //导入依赖的package包/类
@Cacheable(cacheName = "dataBaseCache", keyGenerator = @KeyGenerator(name = "ListCacheKeyGenerator") )
@SuppressWarnings("SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING")
public GetFeedStatusResponse getFeedStatus(GetFeedStatusRequest request) {
GetFeedStatusResponse response = new GetFeedStatusResponse();
response.setStatus(FeedStatus.Receive);
try (Connection connection = getConnection()) {
long start = System.currentTimeMillis();
String feed = request.getFeedName();
if (feed == null || feed.length() == 0) {
return GetFeedStatusResponse.createFeedRequiredResponse();
}
try (PreparedStatement feedQuery = connection.prepareStatement(dbRequestValidatorFeedQuery)) {
feedQuery.setString(1, feed);
try (ResultSet feedResults = feedQuery.executeQuery()) {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("getFeedStatus() - Query took " + (System.currentTimeMillis() - start) + " ms - "
+ dbRequestValidatorFeedQuery + " - (" + feed + ")");
}
if (feedResults.next()) {
String receive = feedResults.getString(SQL_RECEIVE);
String drop = feedResults.getString(SQL_DROP);
String reqCert = feedResults.getString(SQL_REQ_CERT);
String checkCert = feedResults.getString(SQL_CHECK_CERT);
if (!SQL_Y.equals(receive)) {
return GetFeedStatusResponse.createFeedNotSetToReceiveDataResponse();
}
if (SQL_Y.equals(drop)) {
return GetFeedStatusResponse.createOKDropResponse();
}
if (SQL_Y.equals(reqCert)) {
if (request.getSenderDn() == null) {
return GetFeedStatusResponse.createCertificateRequiredResponse();
}
if (SQL_Y.equals(checkCert)) {
String remoteDN = request.getSenderDn();
String remoteCN = CertificateUtil.extractCNFromDN(remoteDN);
start = System.currentTimeMillis();
try (PreparedStatement certQuery = connection
.prepareStatement(dbRequestValidatorAuthQuery)) {
certQuery.setString(1, feed);
certQuery.setString(2, remoteCN);
try (ResultSet certResults = certQuery.executeQuery()) {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("getFeedStatus() - Query took "
+ (System.currentTimeMillis() - start) + " ms - "
+ dbRequestValidatorAuthQuery + " - (" + feed + "," + remoteCN
+ ")");
}
if (!certResults.next()) {
return GetFeedStatusResponse.createCertificateNotAuthorisedResponse();
}
}
}
}
}
} else {
return GetFeedStatusResponse.createFeedNotSetToReceiveDataResponse();
}
}
}
} catch (SQLException sqlEx) {
LOGGER.error("getFeedStatus", sqlEx);
}
return response;
}
开发者ID:gchq,项目名称:stroom-proxy,代码行数:78,代码来源:DataBaseFeedQueryCacheable.java
示例9: getSpellById
import com.googlecode.ehcache.annotations.Cacheable; //导入依赖的package包/类
@Override
@Cacheable(cacheName = "spellCache")
public SpellEntity getSpellById(final Integer id) {
return this.spellDao.findOne(id);
}
开发者ID:JMaNGOS,项目名称:JMaNGOS,代码行数:7,代码来源:SpellServiceImpl.java
示例10: readItemPrototype
import com.googlecode.ehcache.annotations.Cacheable; //导入依赖的package包/类
@Override
@Cacheable(cacheName = "itemPrototypeCache")
public ItemPrototype readItemPrototype(final Integer id) {
return this.itemPrototypeDao.findOne(id);
}
开发者ID:JMaNGOS,项目名称:JMaNGOS,代码行数:7,代码来源:ItemPrototypeServiceImpl.java
注:本文中的com.googlecode.ehcache.annotations.Cacheable类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论