*
* @see CacheModelParser#parseCachingModel(Element)
*/
public CachingModel parseCachingModel(Element element) {
String cacheName = element.getAttribute("cacheName");
GigaSpacesCachingModel model = new GigaSpacesCachingModel(cacheName);
String timeToLiveAttr = element.getAttribute("timeToLive");
String waitForResponseAttr = element.getAttribute("waitForResponse");
if (StringUtils.hasText(timeToLiveAttr)) {
try {
long timeToLive = Long.parseLong(timeToLiveAttr);
model.setTimeToLive(timeToLive);
}
catch (NumberFormatException exception) {
// ignore exception
}
}
if (StringUtils.hasText(waitForResponseAttr)) {
try {
long waitForResponse = Long.parseLong(waitForResponseAttr);
model.setWaitForResponse(waitForResponse);
}
catch (NumberFormatException exception) {
// ignore exception
}
}