|
@@ -20,7 +20,6 @@ import java.util.List;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
|
-import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
|
|
|
|
import org.apache.commons.logging.Log;
|
|
import org.apache.commons.logging.Log;
|
|
import org.apache.commons.logging.LogFactory;
|
|
import org.apache.commons.logging.LogFactory;
|
|
import org.openid4java.association.AssociationException;
|
|
import org.openid4java.association.AssociationException;
|
|
@@ -38,17 +37,15 @@ import org.openid4java.message.ParameterList;
|
|
import org.openid4java.message.ax.AxMessage;
|
|
import org.openid4java.message.ax.AxMessage;
|
|
import org.openid4java.message.ax.FetchRequest;
|
|
import org.openid4java.message.ax.FetchRequest;
|
|
import org.openid4java.message.ax.FetchResponse;
|
|
import org.openid4java.message.ax.FetchResponse;
|
|
-import org.springframework.beans.factory.DisposableBean;
|
|
|
|
import org.springframework.util.StringUtils;
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* @author Ray Krueger
|
|
* @author Ray Krueger
|
|
* @author Luke Taylor
|
|
* @author Luke Taylor
|
|
- * @author Rob Winch
|
|
|
|
*/
|
|
*/
|
|
@SuppressWarnings("unchecked")
|
|
@SuppressWarnings("unchecked")
|
|
-public class OpenID4JavaConsumer implements OpenIDConsumer, DisposableBean {
|
|
|
|
|
|
+public class OpenID4JavaConsumer implements OpenIDConsumer {
|
|
private static final String DISCOVERY_INFO_KEY = DiscoveryInformation.class.getName();
|
|
private static final String DISCOVERY_INFO_KEY = DiscoveryInformation.class.getName();
|
|
private static final String ATTRIBUTE_LIST_KEY = "SPRING_SECURITY_OPEN_ID_ATTRIBUTES_FETCH_LIST";
|
|
private static final String ATTRIBUTE_LIST_KEY = "SPRING_SECURITY_OPEN_ID_ATTRIBUTES_FETCH_LIST";
|
|
|
|
|
|
@@ -58,7 +55,6 @@ public class OpenID4JavaConsumer implements OpenIDConsumer, DisposableBean {
|
|
|
|
|
|
private final ConsumerManager consumerManager;
|
|
private final ConsumerManager consumerManager;
|
|
private final AxFetchListFactory attributesToFetchFactory;
|
|
private final AxFetchListFactory attributesToFetchFactory;
|
|
- private boolean skipShutdownConnectionManager;
|
|
|
|
|
|
|
|
//~ Constructors ===================================================================================================
|
|
//~ Constructors ===================================================================================================
|
|
|
|
|
|
@@ -227,27 +223,4 @@ public class OpenID4JavaConsumer implements OpenIDConsumer, DisposableBean {
|
|
|
|
|
|
return attributes;
|
|
return attributes;
|
|
}
|
|
}
|
|
-
|
|
|
|
- /**
|
|
|
|
- * If <code>false</code> will invoke {@link MultiThreadedHttpConnectionManager#shutdownAll()}
|
|
|
|
- * when the bean is destroyed. This ensures that threads are
|
|
|
|
- * shutdown to prevent memory leaks. Default is <code>false</code>.
|
|
|
|
- *
|
|
|
|
- * @param skipShutdownConnectionManager
|
|
|
|
- * <code>false</code> (default value) if should shutdown
|
|
|
|
- * MultiThreadedHttpConnectionManager on destroy, otherwise
|
|
|
|
- * <code>true</code>.
|
|
|
|
- */
|
|
|
|
- public void setSkipShutdownConnectionManager(boolean skipShutdownConnectionManager) {
|
|
|
|
- this.skipShutdownConnectionManager = skipShutdownConnectionManager;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public void destroy() throws Exception {
|
|
|
|
- if(!skipShutdownConnectionManager) {
|
|
|
|
- MultiThreadedHttpConnectionManager.shutdownAll();
|
|
|
|
- }else if(logger.isDebugEnabled()) {
|
|
|
|
- logger.debug("Skipping calling MultiThreadedHttpConnectionManager.shutdownAll(). "
|
|
|
|
- + "Note this could cause memory leaks if the resources are not cleaned up else where.");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
}
|
|
}
|