improved logging of errors.
This commit is contained in:
Scott Battaglia 2010-10-06 03:30:57 +00:00
parent ac08968c30
commit ff5a99ea0a
3 changed files with 20 additions and 4 deletions

View File

@ -184,6 +184,12 @@ public final class CommonUtils {
}
proxyGrantingTicketStorage.save(proxyGrantingTicketIou, proxyGrantingTicket);
if (LOG.isDebugEnabled()) {
LOG.debug("Successfully saved proxyGrantingTicketId ["
+ proxyGrantingTicket + "] for proxyGrantingTicketIou ["
+ proxyGrantingTicketIou + "]");
}
response.getWriter().write("<?xml version=\"1.0\"?>");
response.getWriter().write("<casClient:proxySuccess xmlns:casClient=\"http://www.yale.edu/tp/casClient\" />");

View File

@ -147,7 +147,12 @@ public class Cas20ProxyReceivingTicketValidationFilter extends AbstractTicketVal
return true;
}
CommonUtils.readAndRespondToProxyReceptorRequest(request, response, this.proxyGrantingTicketStorage);
try {
CommonUtils.readAndRespondToProxyReceptorRequest(request, response, this.proxyGrantingTicketStorage);
} catch (final RuntimeException e) {
log.error(e.getMessage(), e);
throw e;
}
return false;
}

View File

@ -8,6 +8,8 @@ package org.jasig.cas.client.proxy;
import net.sf.ehcache.Cache;
import net.sf.ehcache.Element;
import net.sf.ehcache.CacheManager;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* @author Scott Battaglia
@ -18,15 +20,18 @@ public final class EhcacheBackedProxyGrantingTicketStorageImpl implements ProxyG
public static final String EHCACHE_CACHE_NAME = "org.jasig.cas.client.proxy.EhcacheBackedProxyGrantingTicketStorageImpl.cache";
private static final Log log = LogFactory.getLog(EhcacheBackedProxyGrantingTicketStorageImpl.class);
final Cache cache;
public EhcacheBackedProxyGrantingTicketStorageImpl() {
this(CacheManager.create().getCache(EHCACHE_CACHE_NAME));
this(CacheManager.getInstance().getCache(EHCACHE_CACHE_NAME));
log.info("Created cache with name: " + this.cache.getName());
}
public EhcacheBackedProxyGrantingTicketStorageImpl(final Cache cache) {
this.cache = cache;
}
public void save(final String proxyGrantingTicketIou, final String proxyGrantingTicket) {
@ -45,6 +50,6 @@ public final class EhcacheBackedProxyGrantingTicketStorageImpl implements ProxyG
}
public void cleanUp() {
return;
// nothing to do
}
}