You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Benson Margulies <bi...@gmail.com> on 2008/01/11 19:12:22 UTC

Bus convention

In the process of fixing up something, I think I need to get to the bus
from some places that don't have an (obvious) relationship to it. E.G.
AbstractInDatabindingInterceptor.

Can anyone give me a suggestion?



RE: Bus convention

Posted by "Liu, Jervis" <jl...@iona.com>.
You can get Bus from Message if you are in the interceptors, or normally it is safe to get bus by calling BusFactory.getDefaultBus(false). Following code snippet is from ColocOutInterceptor.java:

        if (bus == null) {
            bus = message.getExchange().get(Bus.class);
            if (bus == null) {
                bus = BusFactory.getDefaultBus(false);
            }
            if (bus == null) {
                throw new Fault(new org.apache.cxf.common.i18n.Message("BUS_NOT_FOUND", BUNDLE));
            }
        }

Cheers,
Jervis

> -----Original Message-----
> From: Benson Margulies [mailto:bimargulies@gmail.com]
> Sent: 2008年1月12日 2:12
> To: cxf-dev
> Subject: Bus convention
> 
> In the process of fixing up something, I think I need to get to the bus
> from some places that don't have an (obvious) relationship to it. E.G.
> AbstractInDatabindingInterceptor.
> 
> Can anyone give me a suggestion?

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland