You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by sl...@apache.org on 2007/07/26 00:36:15 UTC
svn commit: r559636 -
/incubator/tuscany/java/sca/modules/host-http/src/main/java/org/apache/tuscany/sca/http/ExtensibleServletHost.java
Author: slaws
Date: Wed Jul 25 15:36:12 2007
New Revision: 559636
URL: http://svn.apache.org/viewvc?view=rev&rev=559636
Log:
Add some debugging to the default servlet host implementation to allow the list of registered servlets to be extracted
We need a generic mechanism for getting at all the enpoints that are offered but this is a stopgap until we get that
Modified:
incubator/tuscany/java/sca/modules/host-http/src/main/java/org/apache/tuscany/sca/http/ExtensibleServletHost.java
Modified: incubator/tuscany/java/sca/modules/host-http/src/main/java/org/apache/tuscany/sca/http/ExtensibleServletHost.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/host-http/src/main/java/org/apache/tuscany/sca/http/ExtensibleServletHost.java?view=diff&rev=559636&r1=559635&r2=559636
==============================================================================
--- incubator/tuscany/java/sca/modules/host-http/src/main/java/org/apache/tuscany/sca/http/ExtensibleServletHost.java (original)
+++ incubator/tuscany/java/sca/modules/host-http/src/main/java/org/apache/tuscany/sca/http/ExtensibleServletHost.java Wed Jul 25 15:36:12 2007
@@ -19,6 +19,9 @@
package org.apache.tuscany.sca.http;
+import java.util.ArrayList;
+import java.util.List;
+
import javax.servlet.Servlet;
/**
@@ -29,12 +32,14 @@
public class ExtensibleServletHost implements ServletHost {
private ServletHostExtensionPoint servletHosts;
+ private List<String> uriList = new ArrayList<String>();
public ExtensibleServletHost(ServletHostExtensionPoint servletHosts) {
this.servletHosts = servletHosts;
}
public void addServletMapping(String uri, Servlet servlet) throws ServletMappingException {
+ uriList.add(uri);
if (servletHosts.getServletHosts().isEmpty()) {
throw new ServletMappingException("No servlet host available");
}
@@ -45,9 +50,20 @@
}
public Servlet removeServletMapping(String uri) throws ServletMappingException {
+ uriList.remove(uri);
// TODO implement selection of the correct servlet host based on the mapping
// For now just select the first one
return servletHosts.getServletHosts().get(0).removeServletMapping(uri);
}
+
+ /**
+ * For debugging purposes this returns the list of URI strings
+ * that have been passed in
+ *
+ * @return the string uri list
+ */
+ public List<String> getURIList(){
+ return uriList;
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org