Author: sergeyb
Date: 2010-06-23 07:37:48 -0400 (Wed, 23 Jun 2010)
New Revision: 12514
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/AbstractInvoker.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingInterceptor.java
Log:
[JBWS-3028] Some minor clean up
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/AbstractInvoker.java
===================================================================
---
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/AbstractInvoker.java 2010-06-23
09:20:45 UTC (rev 12513)
+++
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/AbstractInvoker.java 2010-06-23
11:37:48 UTC (rev 12514)
@@ -75,7 +75,6 @@
import org.jboss.wsf.spi.invocation.Invocation;
import org.jboss.wsf.spi.invocation.InvocationContext;
import org.jboss.wsf.spi.invocation.InvocationHandler;
-import org.jboss.wsf.spi.invocation.SecurityAdaptor;
/**
* An abstract CXF invoker
@@ -113,12 +112,6 @@
{
//clear the WebServiceContextImpl's ThreadLocal variable
WebServiceContextImpl.clear();
- // clear SecurityContext in case it has been propagated
- SecurityAdaptor adaptor =
exchange.getInMessage().getContent(SecurityAdaptor.class);
- if (adaptor != null) {
- //TODO: release the propagated state
- }
-
}
return new MessageContentsList(retObj);
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingInterceptor.java
===================================================================
---
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingInterceptor.java 2010-06-23
09:20:45 UTC (rev 12513)
+++
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingInterceptor.java 2010-06-23
11:37:48 UTC (rev 12514)
@@ -32,9 +32,7 @@
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.callback.UnsupportedCallbackException;
-import org.apache.cxf.binding.soap.SoapMessage;
import org.apache.cxf.common.security.SimplePrincipal;
-import org.apache.cxf.phase.PhaseInterceptorChain;
import org.apache.cxf.ws.security.wss4j.AbstractUsernameTokenAuthenticatingInterceptor;
import org.apache.ws.security.WSSecurityException;
import org.apache.ws.security.handler.RequestData;
@@ -159,7 +157,9 @@
{
if (isDigest)
{
- // how do we remove the handler from the thread local storage ?
+ // does not remove the TL entry completely but limits the potential
+ // growth to a number of available threads in a container
+ CallbackHandlerPolicyContextHandler.setCallbackHandler(null);
}
}
@@ -169,11 +169,7 @@
if (propagateContext)
{
SecurityAdaptor adaptor = secAdaptorFactory.newSecurityAdapter();
- adaptor.setPrincipal(principal);
- adaptor.setCredential(password);
adaptor.pushSubjectContext(subject, principal, password);
-
- PhaseInterceptorChain.getCurrentMessage().setContent(SecurityAdaptor.class,
adaptor);
if (TRACE)
log.trace("Security Context has been propagated");
}
@@ -207,14 +203,6 @@
this.timestampThreshold = timestampThreshold;
}
- @Override
- public void handleFault(SoapMessage message) {
- SecurityAdaptor adaptor = message.getContent(SecurityAdaptor.class);
- if (adaptor != null) {
- //TODO: release the propagated state
- }
- }
-
public void setNonceStore(NonceStore nonceStore) {
this.nonceStore = nonceStore;
}