[SMXCOMP-938]introduce a showAllServices property for CxfBcComponent
git-svn-id: https://svn.apache.org/repos/asf/servicemix/components/branches/components-2011.02.x@1365408 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/bindings/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcComponent.java b/bindings/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcComponent.java
index d6a7207..695809a 100644
--- a/bindings/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcComponent.java
+++ b/bindings/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcComponent.java
@@ -40,6 +40,8 @@
private String busCfg;
+ private boolean showAllServices = false;
+
private CxfBcConfiguration configuration = new CxfBcConfiguration();
/**
@@ -165,4 +167,12 @@
this.configuration.setAuthenticationService(authenticationService);
}
+ public boolean isShowAllServices() {
+ return showAllServices;
+ }
+
+ public void setShowAllServices(boolean showAllServices) {
+ this.showAllServices = showAllServices;
+ }
+
}
diff --git a/bindings/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java b/bindings/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java
index b838e04..8c0080a 100644
--- a/bindings/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java
+++ b/bindings/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcConsumer.java
@@ -387,7 +387,8 @@
handlers = new ArrayList<Handler>();
jettyEng.setHandlers(handlers);
}
- handlers.add(new ListServiceHandler(((CxfBcComponent) getServiceUnit().getComponent()).getAllBuses()));
+ handlers.add(new ListServiceHandler(((CxfBcComponent) getServiceUnit().getComponent()).getAllBuses(),
+ (CxfBcComponent) getServiceUnit().getComponent()));
}
}
diff --git a/bindings/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/ListServiceHandler.java b/bindings/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/ListServiceHandler.java
index 36d5c54..54abd38 100644
--- a/bindings/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/ListServiceHandler.java
+++ b/bindings/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/ListServiceHandler.java
@@ -45,11 +45,17 @@
private Map<String, Bus> allBuses;
+ private CxfBcComponent cxfBcComponent;
public ListServiceHandler(Map<String, Bus> allBuses) {
this.allBuses = allBuses;
}
+ public ListServiceHandler(Map<String, Bus> allBuses, CxfBcComponent cxfBcComponent) {
+ this.allBuses = allBuses;
+ this.cxfBcComponent = cxfBcComponent;
+ }
+
public void handle(String target, HttpServletRequest request,
HttpServletResponse response, int dispatch) throws IOException,
ServletException {
@@ -89,7 +95,9 @@
for (Iterator<Server> iter = servers.iterator(); iter.hasNext();) {
Server server = (Server) iter.next();
JettyHTTPDestination jhd = (JettyHTTPDestination)server.getDestination();
- if (((JettyHTTPServerEngine)jhd.getEngine()).getPort() != serverPort) {
+ if (cxfBcComponent != null
+ && !cxfBcComponent.isShowAllServices()
+ && ((JettyHTTPServerEngine)jhd.getEngine()).getPort() != serverPort) {
continue;
}
String address = jhd.getAddress().getAddress().getValue();
diff --git a/bindings/servicemix-cxf-bc/src/main/resources/OSGI-INF/blueprint/servicemix-cxf-bc.xml b/bindings/servicemix-cxf-bc/src/main/resources/OSGI-INF/blueprint/servicemix-cxf-bc.xml
index 8311142..a1041e6 100644
--- a/bindings/servicemix-cxf-bc/src/main/resources/OSGI-INF/blueprint/servicemix-cxf-bc.xml
+++ b/bindings/servicemix-cxf-bc/src/main/resources/OSGI-INF/blueprint/servicemix-cxf-bc.xml
@@ -28,6 +28,7 @@
<property name="configuration" ref="servicemix-cxfbc-configuration" />
<property name="authenticationService" ref="authenticationService" />
<property name="executorFactory" ref="executorFactory" />
+ <property name="showAllServices" value="${showAllServices}"/>
</bean>
<bean id="servicemix-cxfbc-configuration" class="org.apache.servicemix.cxfbc.CxfBcConfiguration">
@@ -82,6 +83,7 @@
<cm:property name="threadPoolMaximumPoolSize" value="32"/>
<cm:property name="threadPoolQueueSize" value="256"/>
<cm:property name="busCfg" value=""/>
+ <cm:property name="showAllServices" value="false"/>
</cm:default-properties>
</cm:property-placeholder>