You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by an...@apache.org on 2006/08/21 14:15:39 UTC
svn commit: r433234 - in /incubator/tuscany/java/sca:
core/src/main/java/org/apache/tuscany/core/launcher/ runtime/webapp-host/
runtime/webapp-host/src/main/java/org/apache/tuscany/runtime/webapp/
runtime/webapp-host/src/main/resources/META-INF/sca/ ru...
Author: antelder
Date: Mon Aug 21 05:15:36 2006
New Revision: 433234
URL: http://svn.apache.org/viewvc?rev=433234&view=rev
Log:
Move servlet classes from core to webapp-host, and make ServletHostImpl eager init. Review moving webapp-host from runtime to host
Added:
incubator/tuscany/java/sca/runtime/webapp-host/src/main/java/org/apache/tuscany/runtime/webapp/ServletHostImpl.java
- copied, changed from r433200, incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/launcher/ServletHostImpl.java
incubator/tuscany/java/sca/runtime/webapp-host/src/main/java/org/apache/tuscany/runtime/webapp/ServletLauncherListener.java
- copied, changed from r433200, incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/launcher/ServletLauncherListener.java
Removed:
incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/launcher/ServletHostImpl.java
incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/launcher/ServletLauncherListener.java
Modified:
incubator/tuscany/java/sca/runtime/webapp-host/pom.xml
incubator/tuscany/java/sca/runtime/webapp-host/src/main/resources/META-INF/sca/webapp.system.scdl
incubator/tuscany/java/sca/runtime/webapp/src/main/java/org/apache/tuscany/runtime/webapp/TuscanyContextListener.java
Modified: incubator/tuscany/java/sca/runtime/webapp-host/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/runtime/webapp-host/pom.xml?rev=433234&r1=433233&r2=433234&view=diff
==============================================================================
--- incubator/tuscany/java/sca/runtime/webapp-host/pom.xml (original)
+++ incubator/tuscany/java/sca/runtime/webapp-host/pom.xml Mon Aug 21 05:15:36 2006
@@ -38,6 +38,13 @@
<dependency>
<groupId>org.apache.tuscany</groupId>
+ <artifactId>core</artifactId>
+ <version>${sca.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany</groupId>
<artifactId>spi</artifactId>
<version>${sca.version}</version>
<scope>compile</scope>
Copied: incubator/tuscany/java/sca/runtime/webapp-host/src/main/java/org/apache/tuscany/runtime/webapp/ServletHostImpl.java (from r433200, incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/launcher/ServletHostImpl.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/runtime/webapp-host/src/main/java/org/apache/tuscany/runtime/webapp/ServletHostImpl.java?p2=incubator/tuscany/java/sca/runtime/webapp-host/src/main/java/org/apache/tuscany/runtime/webapp/ServletHostImpl.java&p1=incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/launcher/ServletHostImpl.java&r1=433200&r2=433234&rev=433234&view=diff
==============================================================================
--- incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/launcher/ServletHostImpl.java (original)
+++ incubator/tuscany/java/sca/runtime/webapp-host/src/main/java/org/apache/tuscany/runtime/webapp/ServletHostImpl.java Mon Aug 21 05:15:36 2006
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.tuscany.core.launcher;
+package org.apache.tuscany.runtime.webapp;
import java.io.IOException;
import java.util.HashMap;
@@ -30,19 +30,24 @@
import org.apache.tuscany.host.servlet.ServletRequestInjector;
import org.apache.tuscany.spi.host.ServletHost;
-import org.osoa.sca.annotations.Scope;
+import org.osoa.sca.annotations.Init;
+import org.osoa.sca.annotations.Service;
/**
* ServletHost impl that forwards requests to registered servlets
* TODO: TUSCANY-649, move this and ServletLauncherListener to a new webapp-host module
*/
-@Scope("MODULE")
+@Service(ServletHost.class)
public class ServletHostImpl implements ServletHost, ServletRequestInjector {
protected Map<String, Servlet> servlets;
public ServletHostImpl() {
this.servlets = new HashMap<String, Servlet>();
+ }
+
+ @Init(eager = true)
+ public void init() {
}
public void service(ServletRequest req, ServletResponse resp) throws ServletException, IOException {
Copied: incubator/tuscany/java/sca/runtime/webapp-host/src/main/java/org/apache/tuscany/runtime/webapp/ServletLauncherListener.java (from r433200, incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/launcher/ServletLauncherListener.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/runtime/webapp-host/src/main/java/org/apache/tuscany/runtime/webapp/ServletLauncherListener.java?p2=incubator/tuscany/java/sca/runtime/webapp-host/src/main/java/org/apache/tuscany/runtime/webapp/ServletLauncherListener.java&p1=incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/launcher/ServletLauncherListener.java&r1=433200&r2=433234&rev=433234&view=diff
==============================================================================
--- incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/launcher/ServletLauncherListener.java (original)
+++ incubator/tuscany/java/sca/runtime/webapp-host/src/main/java/org/apache/tuscany/runtime/webapp/ServletLauncherListener.java Mon Aug 21 05:15:36 2006
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.tuscany.core.launcher;
+package org.apache.tuscany.runtime.webapp;
import java.net.MalformedURLException;
import java.net.URL;
@@ -28,10 +28,12 @@
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
+import org.apache.tuscany.core.launcher.CompositeContextImpl;
+import org.apache.tuscany.core.launcher.LauncherImpl;
import org.apache.tuscany.core.monitor.MonitorFactoryUtil;
+import org.apache.tuscany.host.MonitorFactory;
import org.apache.tuscany.spi.component.CompositeComponent;
import org.apache.tuscany.spi.loader.LoaderException;
-import org.apache.tuscany.host.MonitorFactory;
/**
* LauncherImpl for runtime environment that loads info from servlet context params.
@@ -111,8 +113,8 @@
try {
URL systemScdl = getClass().getResource(systemScdlPath);
CompositeComponent<?> rt = launcher.bootRuntime(systemScdl, mf);
- servletContext.setAttribute("Tuscany.SystemComposite", rt);
servletContext.setAttribute(LAUNCHER_ATTRIBUTE, launcher);
+ servletContext.setAttribute("Tuscany.ServletRequestInjector", rt.getChild("servletHost").getServiceInstance());
URL appScdl;
if (applicationScdlPath.startsWith("/")) {
Modified: incubator/tuscany/java/sca/runtime/webapp-host/src/main/resources/META-INF/sca/webapp.system.scdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/runtime/webapp-host/src/main/resources/META-INF/sca/webapp.system.scdl?rev=433234&r1=433233&r2=433234&view=diff
==============================================================================
--- incubator/tuscany/java/sca/runtime/webapp-host/src/main/resources/META-INF/sca/webapp.system.scdl (original)
+++ incubator/tuscany/java/sca/runtime/webapp-host/src/main/resources/META-INF/sca/webapp.system.scdl Mon Aug 21 05:15:36 2006
@@ -111,7 +111,7 @@
<!-- Web app ServletHost -->
<component name="servletHost">
- <system:implementation.system class="org.apache.tuscany.core.launcher.ServletHostImpl"/>
+ <system:implementation.system class="org.apache.tuscany.runtime.webapp.ServletHostImpl"/>
</component>
<!-- TODO: Hack the Axis extension in -->
Modified: incubator/tuscany/java/sca/runtime/webapp/src/main/java/org/apache/tuscany/runtime/webapp/TuscanyContextListener.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/runtime/webapp/src/main/java/org/apache/tuscany/runtime/webapp/TuscanyContextListener.java?rev=433234&r1=433233&r2=433234&view=diff
==============================================================================
--- incubator/tuscany/java/sca/runtime/webapp/src/main/java/org/apache/tuscany/runtime/webapp/TuscanyContextListener.java (original)
+++ incubator/tuscany/java/sca/runtime/webapp/src/main/java/org/apache/tuscany/runtime/webapp/TuscanyContextListener.java Mon Aug 21 05:15:36 2006
@@ -89,7 +89,7 @@
protected ServletContextListener getLauncher(ServletContext servletContext, ClassLoader bootClassLoader) {
String launcherClass = servletContext.getInitParameter(LAUNCHER_PARAM);
if (launcherClass == null) {
- launcherClass = "org.apache.tuscany.core.launcher.ServletLauncherListener";
+ launcherClass = "org.apache.tuscany.runtime.webapp.ServletLauncherListener";
}
try {
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org