Skip to content
Permalink
Browse files
[CXF-5541] Adding a 'bus' parameter to CXFServlet
git-svn-id: https://svn.apache.org/repos/asf/cxf/trunk@1564734 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Sergey Beryozkin committed Feb 5, 2014
1 parent 5df3f72 commit 5d1e71a3e74ae5c8b5740bdaec00cad65918c39a
Showing 1 changed file with 6 additions and 1 deletion.
@@ -41,6 +41,8 @@
public class CXFServlet extends CXFNonSpringServlet
implements ApplicationListener<ContextRefreshedEvent> {
private static final long serialVersionUID = -5922443981969455305L;
private static final String BUS_PARAMETER = "bus";

private boolean busCreated;
private XmlWebApplicationContext createdContext;

@@ -72,7 +74,10 @@ protected void loadBus(ServletConfig servletConfig) {
wac = createSpringContext(wac, servletConfig, configLocation);
}
if (wac != null) {
setBus((Bus)wac.getBean("cxf", Bus.class));
String busParam = servletConfig.getInitParameter(BUS_PARAMETER);
String busName = busParam == null ? "cxf" : busParam.trim();

setBus((Bus)wac.getBean(busName, Bus.class));
} else {
busCreated = true;
setBus(BusFactory.newInstance().createBus());

0 comments on commit 5d1e71a

Please sign in to comment.