Hi
If you use the Jaxws API getPort to create the client proxy. CXF will try to get a default bus first , if the default bus is not exit, it will create a bus and set default bus and default thread local bus for you.

So the thread local object in your case should be the bus :)

Here are some code snippets which can help you to know better about the default Bus and bus.shutdown()
1. Bus creation
public CXFBusImpl(Map<Class, Object> extensions) {
       if (extensions == null) {
           extensions = new ConcurrentHashMap<Class, Object>();
       } else {
           extensions = new ConcurrentHashMap<Class, Object>(extensions);
       }
       this.extensions = extensions;
state = BusState.INITIAL; CXFBusFactory.possiblySetDefaultBus(this);
   }

2.  CXFBusFactory.possiblySetDefaultBus(this);
public static synchronized boolean possiblySetDefaultBus(Bus bus) {
// there is a thread location variable which store the default thread local bus
      if (localBus.get() == null) {
           localBus.set(bus);
       }
if (defaultBus == null) { defaultBus = bus; return true;
       }
       return false;
   }

3. CXFBusImpl.shutdown(boolean wait)
   public void shutdown(boolean wait) {
BusLifeCycleManager lifeCycleManager = this.getExtension(BusLifeCycleManager.class);
       if (null != lifeCycleManager) {
           lifeCycleManager.preShutdown();
       }
       synchronized (this) {
           state = BusState.SHUTDOWN;
           notifyAll();
       }
       if (null != lifeCycleManager) {
           lifeCycleManager.postShutdown();
       }
       if (BusFactory.getDefaultBus(false) == this) {
           BusFactory.setDefaultBus(null);
       }
   }

You can find more information about bus by reading the source code.

CXFBusImpl https://svn.apache.org/repos/asf/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java CXFBusFactory https://svn.apache.org/repos/asf/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusFactory.java

Willem.

Joe Sunday wrote:
Is that a done with the client or done with the application call?

If there's something I need to call when I'm done with a particular port, I can deal with that. I don't see it documented anywhere though.

--Joe

On Sep 6, 2007, at 3:21 PM, Daniel Kulp wrote:


Joe,

One thing to keep in mind: the Bus would still be around. You'd need to
get the default Bus and call shutdown() on it if you're completely done.

Dan

--
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
[EMAIL PROTECTED]
http://www.dankulp.com/blog

Reply via email to