Author: gnodet
Date: Mon Sep 25 01:37:54 2006
New Revision: 449608
URL: http://svn.apache.org/viewvc?view=rev&rev=449608
Log:
SM-578: HttpComponent can not be deployed as managed
Modified:
incubator/servicemix/branches/servicemix-3.0/servicemix-http/src/main/java/org/apache/servicemix/http/HttpComponent.java
incubator/servicemix/branches/servicemix-3.0/servicemix-http/src/main/java/org/apache/servicemix/http/HttpManagedServlet.java
Modified:
incubator/servicemix/branches/servicemix-3.0/servicemix-http/src/main/java/org/apache/servicemix/http/HttpComponent.java
URL:
http://svn.apache.org/viewvc/incubator/servicemix/branches/servicemix-3.0/servicemix-http/src/main/java/org/apache/servicemix/http/HttpComponent.java?view=diff&rev=449608&r1=449607&r2=449608
==============================================================================
---
incubator/servicemix/branches/servicemix-3.0/servicemix-http/src/main/java/org/apache/servicemix/http/HttpComponent.java
(original)
+++
incubator/servicemix/branches/servicemix-3.0/servicemix-http/src/main/java/org/apache/servicemix/http/HttpComponent.java
Mon Sep 25 01:37:54 2006
@@ -53,4 +53,23 @@
return HttpResolvedEndpoint.resolveEndpoint(epr);
}
+ /**
+ * @return the configuration
+ * @org.apache.xbean.Flat
+ */
+ public HttpConfiguration getConfiguration() {
+ return ((HttpLifeCycle) getLifeCycle()).getConfiguration();
+ }
+
+ /**
+ * @param configuration the configuration to set
+ */
+ public void setConfiguration(HttpConfiguration configuration) {
+ ((HttpLifeCycle) getLifeCycle()).setConfiguration(configuration);
+ }
+
+ public HttpProcessor getMainProcessor() {
+ return ((HttpLifeCycle) getLifeCycle()).getMainProcessor();
+ }
+
}
Modified:
incubator/servicemix/branches/servicemix-3.0/servicemix-http/src/main/java/org/apache/servicemix/http/HttpManagedServlet.java
URL:
http://svn.apache.org/viewvc/incubator/servicemix/branches/servicemix-3.0/servicemix-http/src/main/java/org/apache/servicemix/http/HttpManagedServlet.java?view=diff&rev=449608&r1=449607&r2=449608
==============================================================================
---
incubator/servicemix/branches/servicemix-3.0/servicemix-http/src/main/java/org/apache/servicemix/http/HttpManagedServlet.java
(original)
+++
incubator/servicemix/branches/servicemix-3.0/servicemix-http/src/main/java/org/apache/servicemix/http/HttpManagedServlet.java
Mon Sep 25 01:37:54 2006
@@ -69,15 +69,23 @@
if (componentMBean == null) {
throw new IllegalStateException("Unable to find component " +
componentName);
}
- if (componentMBean.getComponent() instanceof HttpSpringComponent ==
false) {
+ if (componentMBean.getComponent() instanceof HttpSpringComponent) {
+ HttpSpringComponent component = (HttpSpringComponent)
componentMBean.getComponent();
+ String mapping = config.getInitParameter(MAPPING_PROPERTY);
+ if (mapping != null) {
+ component.getConfiguration().setMapping(mapping);
+ }
+ processor = component.getMainProcessor();
+ } else if (componentMBean.getComponent() instanceof HttpComponent) {
+ HttpComponent component = (HttpComponent)
componentMBean.getComponent();
+ String mapping = config.getInitParameter(MAPPING_PROPERTY);
+ if (mapping != null) {
+ component.getConfiguration().setMapping(mapping);
+ }
+ processor = component.getMainProcessor();
+ } else {
throw new IllegalStateException("The component is not an instance
of HttpSpringComponent");
}
- HttpSpringComponent component = (HttpSpringComponent)
componentMBean.getComponent();
- String mapping = config.getInitParameter(MAPPING_PROPERTY);
- if (mapping != null) {
- component.getConfiguration().setMapping(mapping);
- }
- processor = component.getMainProcessor();
}
protected void service(HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException {