Author: asoldano
Date: 2013-11-07 18:10:39 -0500 (Thu, 07 Nov 2013)
New Revision: 18070
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java
Log:
[JBWS-3731] Control and document behavior regarding thread default bus changes depending
on client bus selection strategy
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java
===================================================================
---
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java 2013-11-07
22:29:26 UTC (rev 18069)
+++
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java 2013-11-07
23:10:39 UTC (rev 18070)
@@ -72,8 +72,37 @@
/**
* A custom javax.xml.ws.spi.Provider implementation
* extending the CXF one while adding few customizations.
+ *
+ * The most important customization is on the CXF Bus used
+ * the Endpoint.publish() or client.
+ * In particular, when a client is created, the thread
+ * default bus changes depending on the selected strategy:
+ *
+ * * Thread default busses with THREAD_BUS strategy
+ * ------------------------------------------------------------------
+ * |BEFORE client creation | USED for client | AFTER client creation|
+ * ------------------------------------------------------------------
+ * | NULL | NEW | NEW |
+ * | X | X | X |
+ * ------------------------------------------------------------------
+ *
+ * * Thread default busses with NEW_BUS strategy:
+ * ------------------------------------------------------------------
+ * |BEFORE client creation | USED for client | AFTER client creation|
+ * ------------------------------------------------------------------
+ * | NULL | NEW | NULL |
+ * | X | NEW | X |
+ * ------------------------------------------------------------------
+ *
+ * * Thread default busses with TCCL_BUS strategy:
+ * ------------------------------------------------------------------
+ * |BEFORE client creation | USED for client | AFTER client creation|
+ * ------------------------------------------------------------------
+ * | NULL | TCCL | NULL |
+ * | X | TCCL | X |
+ * ------------------------------------------------------------------
*
- * This also ensures a proper context classloader is set
+ * This class also ensures a proper context classloader is set
* (required on JBoss AS 7, as the TCCL does not include
* implementation classes by default)
*
@@ -239,7 +268,7 @@
}
private static void restoreThreadDefaultBus(final String busStrategy, final Bus
origBus) {
- if (origBus != null && !busStrategy.equals(Constants.THREAD_BUS_STRATEGY))
+ if (origBus != null || !busStrategy.equals(Constants.THREAD_BUS_STRATEGY))
{
BusFactory.setThreadDefaultBus(origBus);
}