Author: asoldano
Date: 2014-05-26 11:50:31 -0400 (Mon, 26 May 2014)
New Revision: 18695
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFHandlerResolverImpl.java
Log:
[JBWS-3796] Perform injections once on handlers and prevent concurrency issues
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFHandlerResolverImpl.java
===================================================================
---
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFHandlerResolverImpl.java 2014-05-26
09:20:26 UTC (rev 18694)
+++
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFHandlerResolverImpl.java 2014-05-26
15:50:31 UTC (rev 18695)
@@ -109,20 +109,22 @@
@SuppressWarnings("rawtypes")
public List<Handler> getHandlerChain(PortInfo portInfo)
{
- List<Handler> handlerChain = handlerMap.get(portInfo);
- if (handlerChain == null) {
- QName portQName = portInfo.getPortName();
- QName serviceQName = portInfo.getServiceName();
- String bindingId = portInfo.getBindingID();
- handlerChain = createHandlerChain(portInfo, portQName, serviceQName,
bindingId);
- handlerMap.put(portInfo, handlerChain);
+ synchronized (handlerMap)
+ {
+ List<Handler> handlerChain = handlerMap.get(portInfo);
+ if (handlerChain == null) {
+ QName portQName = portInfo.getPortName();
+ QName serviceQName = portInfo.getServiceName();
+ String bindingId = portInfo.getBindingID();
+ handlerChain = createHandlerChain(portInfo, portQName, serviceQName,
bindingId);
+ handlerMap.put(portInfo, handlerChain);
+
+ for (Handler h : handlerChain) {
+ configHandler(h);
+ }
+ }
+ return handlerChain;
}
-
- for (Handler h : handlerChain) {
- configHandler(h);
- }
-
- return handlerChain;
}
/**
@@ -149,7 +151,7 @@
}
@SuppressWarnings("rawtypes")
- public List<Handler> createHandlerChain(PortInfo portInfo, QName portQName,
QName serviceQName, String bindingID) {
+ protected List<Handler> createHandlerChain(PortInfo portInfo, QName portQName,
QName serviceQName, String bindingID) {
List<Handler> chain = new ArrayList<Handler>();
InputStream is = getInputStream();
try {
Show replies by date