}
return busCfg;
}
private void configureHandlers(Configuration config, boolean isServer) {
SystemHandlerChainType systemHandlers = config.getObject(SystemHandlerChainType.class,
"systemHandlerChain");
org.objectweb.celtix.bus.jaxws.configuration.types.ObjectFactory factory
= new org.objectweb.celtix.bus.jaxws.configuration.types.ObjectFactory();
HandlerChainType handlerChain = null;
HandlerType handler = null;
if (null == systemHandlers) {
systemHandlers = factory.createSystemHandlerChainType();
boolean withRM = true;
// pre-logical
handlerChain = factory.createHandlerChainType();
handler = factory.createHandlerType();
handler.setHandlerClass(MAPAggregator.class.getName());
handler.setHandlerName("logical addressing handler");
handlerChain.getHandler().add(handler);
if (withRM) {
handler = factory.createHandlerType();
handler.setHandlerClass(RMHandler.class.getName());
handler.setHandlerName("logical rm handler");
handlerChain.getHandler().add(handler);
}
if (!isServer) {
handler = factory.createHandlerType();
handler.setHandlerClass(LogicalMessageContextRecorder.class.getName());
handler.setHandlerName("logical message context recorder");
handlerChain.getHandler().add(handler);
}
systemHandlers.setPreLogical(handlerChain);
// post-protocol
handlerChain = factory.createHandlerChainType();
if (withRM) {
handler = factory.createHandlerType();
handler.setHandlerClass(RMSoapHandler.class.getName());
handler.setHandlerName("protocol rm handler");
handlerChain.getHandler().add(handler);
}
handler = factory.createHandlerType();
handler.setHandlerClass(MAPCodec.class.getName());
handler.setHandlerName("protocol addressing handler");
handlerChain.getHandler().add(handler);
boolean persist = true;
if (persist) {
handler = factory.createHandlerType();
handler.setHandlerClass(RMPersistenceHandler.class.getName());
handler.setHandlerName("protocol rm persistence handler");
handlerChain.getHandler().add(handler);
}
systemHandlers.setPostProtocol(handlerChain);
config.setObject("systemHandlerChain", systemHandlers);
}
handlerChain = config.getObject(HandlerChainType.class, "handlerChain");