* @param XMLPath XML path
* @return XmlToolDoc
*/
public static XmlToolDoc getXmlToolDoc(String XMLPath) {
DotCacheAdministrator cache = CacheLocator.getCacheAdministrator();
XmlToolDoc doc = null;
try{
doc = (XmlToolDoc) cache.get(getPrimaryGroup() + hashPath(XMLPath), getPrimaryGroup());
}catch (DotCacheException e) {
Logger.debug(XmlToolCache.class,"Cache Entry not found", e);
}
if (doc != null) {
try{
/*validate time to live*/
long ttl = doc.getTtl() - new Date().getTime();
if(ttl <= 0 ){
removeXmlToolDoc(doc);
doc =null;
}