[kune-commits] r1265 - in trunk: script src/main/java/cc/kune/wave/client src/main/java/cc/kune/wave/server src/main/webapp/WEB-INF
Vicente J. Ruiz Jurado
vjrj_ at ourproject.org
Sat Feb 26 20:48:11 CET 2011
Author: vjrj_
Date: 2011-02-26 20:48:11 +0100 (Sat, 26 Feb 2011)
New Revision: 1265
Added:
trunk/script/kune server via mvn.launch
Removed:
trunk/src/main/java/cc/kune/wave/server/JettyModule.java
Modified:
trunk/src/main/java/cc/kune/wave/client/WaveClientTester.java
trunk/src/main/java/cc/kune/wave/server/CustomServerRpcProvider.java
trunk/src/main/webapp/WEB-INF/web.xml
Log:
WIAB server integration cleanup
Added: trunk/script/kune server via mvn.launch
===================================================================
--- trunk/script/kune server via mvn.launch (rev 0)
+++ trunk/script/kune server via mvn.launch 2011-02-26 19:48:11 UTC (rev 1265)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType">
+<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
+<listEntry value="org.eclipse.ui.externaltools.launchGroup"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="/usr/bin/mvn"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="exec:java"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/kune}"/>
+</launchConfiguration>
Modified: trunk/src/main/java/cc/kune/wave/client/WaveClientTester.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/WaveClientTester.java 2011-02-26 10:20:40 UTC (rev 1264)
+++ trunk/src/main/java/cc/kune/wave/client/WaveClientTester.java 2011-02-26 19:48:11 UTC (rev 1265)
@@ -62,7 +62,7 @@
final String url = WindowUtils.getLocation().getHost() + "/";
Log.debug("Wave client url: " + url);
// wsarmor.setFrameUrlForTesting(url);
- wsarmor.setFrameUrlForTesting("/wiiiabbb");
+ wsarmor.setFrameUrlForTesting("/");
}
});
} catch (final RequestException e) {
Modified: trunk/src/main/java/cc/kune/wave/server/CustomServerRpcProvider.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/CustomServerRpcProvider.java 2011-02-26 10:20:40 UTC (rev 1264)
+++ trunk/src/main/java/cc/kune/wave/server/CustomServerRpcProvider.java 2011-02-26 19:48:11 UTC (rev 1265)
@@ -11,9 +11,6 @@
import java.util.concurrent.Executors;
import javax.servlet.Servlet;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletContextEvent;
-import javax.servlet.ServletContextListener;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
@@ -21,13 +18,11 @@
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.nio.SelectChannelConnector;
import org.eclipse.jetty.servlet.DefaultServlet;
-import org.eclipse.jetty.servlet.FilterHolder;
import org.eclipse.jetty.servlet.ServletHolder;
+import org.eclipse.jetty.util.resource.ResourceCollection;
import org.eclipse.jetty.webapp.WebAppContext;
import org.eclipse.jetty.websocket.WebSocket;
import org.eclipse.jetty.websocket.WebSocketServlet;
-import org.jruby.rack.RackFilter;
-import org.jruby.rack.RackServletContextListener;
import org.ourproject.kune.rack.RackServletFilter;
import org.waveprotocol.box.common.comms.WaveClientRpc.ProtocolAuthenticate;
import org.waveprotocol.box.common.comms.WaveClientRpc.ProtocolAuthenticationResult;
@@ -55,7 +50,6 @@
import com.google.inject.Inject;
import com.google.inject.Injector;
import com.google.inject.name.Named;
-import com.google.inject.servlet.GuiceServletContextListener;
import com.google.protobuf.Descriptors;
import com.google.protobuf.Descriptors.MethodDescriptor;
import com.google.protobuf.Message;
@@ -63,13 +57,11 @@
import com.google.protobuf.Service;
import com.google.protobuf.UnknownFieldSet;
-import de.spieleck.servlets.ProxyServlet;
-
/**
* ServerRpcProvider can provide instances of type Service over an incoming
* network socket and service incoming RPCs to these services and their methods.
- *
- *
+ *
+ *
*/
public class CustomServerRpcProvider {
abstract class Connection implements ProtoCallback {
@@ -321,7 +313,7 @@
/**
* Construct a new ServerRpcProvider, hosting on the specified WebSocket
* addresses.
- *
+ *
* Also accepts an ExecutorService for spawning managing threads.
*/
public CustomServerRpcProvider(final InetSocketAddress[] httpAddresses, final Integer flashsocketPolicyPort,
@@ -359,7 +351,7 @@
/**
* Add a servlet to the servlet registry. This servlet will be attached to
* the specified URL pattern when the server is started up.
- *
+ *
* @param urlPattern
* URL pattern for paths. Eg, '/foo', '/foo/*'
* @param servlet
@@ -432,58 +424,15 @@
if (jettySessionManager != null) {
context.getSessionHandler().setSessionManager(jettySessionManager);
}
- context.setResourceBase(resourceBase);
+ final ResourceCollection resources = new ResourceCollection(new String[] { "src/main/webapp", resourceBase, });
+ context.setBaseResource(resources);
context.setContextPath(baseUrl);
- context.setWar(baseUrl);
+
context.setParentLoaderPriority(true);
context.setDescriptor("WEB-INF/web.xml");
- final ServletHolder httpbindHolder = new ServletHolder(ProxyServlet.class);
- httpbindHolder.setInitParameter("remotePath", "/http-bind/");
- httpbindHolder.setInitParameter("remotePort", "5280");
- context.addServlet(httpbindHolder, "/http-bind/");
-
- context.addEventListener(new ServletContextListener() {
-
- @Override
- public void contextDestroyed(final ServletContextEvent sce) {
- }
-
- @Override
- public void contextInitialized(final ServletContextEvent sce) {
- final ServletContext context = sce.getServletContext();
- context.setAttribute("jruby.standalone", "true");
- context.setAttribute("rails.root", "/WEB-INF/publicspace/");
- context.setAttribute("files.prefix", "/WEB-INF/publicspace/public");
- context.setAttribute("rails.env", "production");
- context.setAttribute("jruby.max.runtimes", "1");
- context.setAttribute("public.root", "/public/");
- }
- });
-
- context.addEventListener(new RackServletContextListener());
- // final FilterHolder rubyRack = new
- // FilterHolder(org.jruby.rack.rails.RailsServletContextListener.class);
- // rubyRack.setFilter(new RackFilter());
-
- // context.getInitParameter("rails.root");
-
- context.addFilter(RackFilter.class, "/public/*", 0);
-
- context.addEventListener(new GuiceServletContextListener() {
- @Override
- protected Injector getInjector() {
- return injector;
- }
- });
context.setAttribute(RackServletFilter.INJECTOR_PARENT_ATTRIBUTE, injector);
- final FilterHolder filterHolder = new FilterHolder(RackServletFilter.class);
- filterHolder.setInitParameter("org.ourproject.kune.rack.RackModule",
- "org.ourproject.kune.app.server.KuneRackModule");
- context.addFilter(filterHolder, "/ws/*", 0);
- // context.addFilter(GuiceFilter.class, "/*", 0);
-
// Servlet where the websocket connection is served from.
final ServletHolder wsholder = new ServletHolder(new WaveWebSocketServlet());
context.addServlet(wsholder, "/socket");
Deleted: trunk/src/main/java/cc/kune/wave/server/JettyModule.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/JettyModule.java 2011-02-26 10:20:40 UTC (rev 1264)
+++ trunk/src/main/java/cc/kune/wave/server/JettyModule.java 2011-02-26 19:48:11 UTC (rev 1265)
@@ -1,3 +0,0 @@
-package cc.kune.wave.server;
-
-
Modified: trunk/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/src/main/webapp/WEB-INF/web.xml 2011-02-26 10:20:40 UTC (rev 1264)
+++ trunk/src/main/webapp/WEB-INF/web.xml 2011-02-26 19:48:11 UTC (rev 1265)
@@ -19,48 +19,48 @@
<welcome-file>ws.html</welcome-file>
</welcome-file-list>
<!-- Wave proxies ========================================================================================= -->
-<!-- <filter>-->
-<!-- <filter-name>JettyContinuationFilter</filter-name>-->
-<!-- <filter-class>org.eclipse.jetty.continuation.ContinuationFilter</filter-class>-->
-<!-- </filter>-->
-<!-- <filter-mapping>-->
-<!-- <filter-name>JettyContinuationFilter</filter-name>-->
-<!-- <servlet-name>Wiab</servlet-name>-->
-<!-- <url-pattern>/*</url-pattern> -->
-<!-- </filter-mapping>-->
-<!-- <servlet>-->
-<!-- <servlet-name>Wiab</servlet-name>-->
-<!-- <servlet-class>org.eclipse.jetty.servlets.ProxyServlet$Transparent</servlet-class>-->
-<!-- <init-param>-->
-<!-- <param-name>ProxyTo</param-name>-->
-<!-- <param-value>http://127.0.0.1:9898/</param-value>-->
-<!-- </init-param>-->
-<!-- <init-param>-->
-<!-- <param-name>Prefix</param-name>-->
-<!-- <param-value>/</param-value>-->
-<!-- </init-param>-->
-<!-- </servlet>-->
-<!-- <servlet-mapping>-->
-<!-- <servlet-name>Wiab</servlet-name>-->
-<!-- <url-pattern>/attachment/*</url-pattern>-->
-<!-- <url-pattern>/auth/signin</url-pattern>-->
-<!-- <url-pattern>/auth/signout</url-pattern>-->
-<!-- <url-pattern>/auth/register</url-pattern>-->
-<!-- <url-pattern>/fetch/*</url-pattern>-->
-<!-- <url-pattern>/robot/dataapi</url-pattern>-->
-<!-- <url-pattern>/robot/dataapi/oauth/*</url-pattern>-->
-<!-- <url-pattern>/robot/dataapi/rpc</url-pattern>-->
-<!-- <url-pattern>/robot/register/*</url-pattern>-->
-<!-- <url-pattern>/robot/rpc</url-pattern>-->
-<!-- <url-pattern>/gadgets</url-pattern>-->
-<!-- <url-pattern>/gadgets/*</url-pattern>-->
-<!-- <url-pattern>/socket.io/*</url-pattern>-->
-<!-- <url-pattern>/socket</url-pattern>-->
-<!-- <url-pattern>/static/*</url-pattern>-->
-<!-- <url-pattern>/webclient/*</url-pattern>-->
-<!-- <url-pattern>/*</url-pattern> -->
-<!-- <load-on-startup>1</load-on-startup> -->
-<!-- </servlet-mapping>-->
+ <!-- <filter> -->
+ <!-- <filter-name>JettyContinuationFilter</filter-name> -->
+ <!-- <filter-class>org.eclipse.jetty.continuation.ContinuationFilter</filter-class> -->
+ <!-- </filter> -->
+ <!-- <filter-mapping> -->
+ <!-- <filter-name>JettyContinuationFilter</filter-name> -->
+ <!-- <servlet-name>Wiab</servlet-name> -->
+ <!-- <url-pattern>/*</url-pattern> -->
+ <!-- </filter-mapping> -->
+ <!-- <servlet> -->
+ <!-- <servlet-name>Wiab</servlet-name> -->
+ <!-- <servlet-class>org.eclipse.jetty.servlets.ProxyServlet$Transparent</servlet-class> -->
+ <!-- <init-param> -->
+ <!-- <param-name>ProxyTo</param-name> -->
+ <!-- <param-value>http://127.0.0.1:9898/</param-value> -->
+ <!-- </init-param> -->
+ <!-- <init-param> -->
+ <!-- <param-name>Prefix</param-name> -->
+ <!-- <param-value>/</param-value> -->
+ <!-- </init-param> -->
+ <!-- </servlet> -->
+ <!-- <servlet-mapping> -->
+ <!-- <servlet-name>Wiab</servlet-name> -->
+ <!-- <url-pattern>/attachment/*</url-pattern> -->
+ <!-- <url-pattern>/auth/signin</url-pattern> -->
+ <!-- <url-pattern>/auth/signout</url-pattern> -->
+ <!-- <url-pattern>/auth/register</url-pattern> -->
+ <!-- <url-pattern>/fetch/*</url-pattern> -->
+ <!-- <url-pattern>/robot/dataapi</url-pattern> -->
+ <!-- <url-pattern>/robot/dataapi/oauth/*</url-pattern> -->
+ <!-- <url-pattern>/robot/dataapi/rpc</url-pattern> -->
+ <!-- <url-pattern>/robot/register/*</url-pattern> -->
+ <!-- <url-pattern>/robot/rpc</url-pattern> -->
+ <!-- <url-pattern>/gadgets</url-pattern> -->
+ <!-- <url-pattern>/gadgets/*</url-pattern> -->
+ <!-- <url-pattern>/socket.io/*</url-pattern> -->
+ <!-- <url-pattern>/socket</url-pattern> -->
+ <!-- <url-pattern>/static/*</url-pattern> -->
+ <!-- <url-pattern>/webclient/*</url-pattern> -->
+ <!-- <url-pattern>/*</url-pattern> -->
+ <!-- <load-on-startup>1</load-on-startup> -->
+ <!-- </servlet-mapping> -->
<!-- JRuby servlets ======================================================================================= -->
<!-- Note: this gives problems depending on the version of jetty or tomcat -->
<context-param>
@@ -117,42 +117,42 @@
<!-- <servlet-name>HttpBind</servlet-name> -->
<!-- <url-pattern>/http-bind/</url-pattern> -->
<!-- </servlet-mapping> -->
-<!-- <servlet>-->
-<!-- <servlet-name>Proxy</servlet-name>-->
-<!-- <servlet-class>de.spieleck.servlets.ProxyServlet</servlet-class>-->
-<!-- <init-param>-->
-<!-- <param-name>remotePath</param-name>-->
-<!-- <param-value>/http-bind/</param-value>-->
-<!-- </init-param>-->
-<!-- <init-param>-->
-<!-- <param-name>remoteServer</param-name>-->
-<!-- <param-value>localhost</param-value>-->
-<!-- </init-param>-->
-<!-- <init-param>-->
-<!-- <param-name>remotePort</param-name>-->
-<!-- <param-value>5280</param-value>-->
-<!-- </init-param>-->
-<!-- </servlet>-->
-<!-- <servlet-mapping>-->
-<!-- <servlet-name>Proxy</servlet-name>-->
-<!-- <url-pattern>/http-bind/-->
-<!-- </url-pattern>-->
-<!-- </servlet-mapping>-->
+ <servlet>
+ <servlet-name>Proxy</servlet-name>
+ <servlet-class>de.spieleck.servlets.ProxyServlet</servlet-class>
+ <init-param>
+ <param-name>remotePath</param-name>
+ <param-value>/http-bind/</param-value>
+ </init-param>
+ <init-param>
+ <param-name>remoteServer</param-name>
+ <param-value>localhost</param-value>
+ </init-param>
+ <init-param>
+ <param-name>remotePort</param-name>
+ <param-value>5280</param-value>
+ </init-param>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Proxy</servlet-name>
+ <url-pattern>/http-bind/
+ </url-pattern>
+ </servlet-mapping>
<!-- Kune normal guice configuration ======================================================================== -->
-<!-- <filter>-->
-<!-- <filter-name>rack</filter-name>-->
-<!-- <filter-class>org.ourproject.kune.rack.RackServletFilter</filter-class>-->
-<!-- <init-param>-->
-<!-- <param-name>org.ourproject.kune.rack.RackModule</param-name>-->
-<!-- <param-value>-->
-<!-- org.ourproject.kune.app.server.KuneRackModule-->
-<!-- </param-value>-->
-<!-- </init-param>-->
-<!-- </filter>-->
-<!-- <filter-mapping>-->
-<!-- <filter-name>rack</filter-name>-->
-<!-- <url-pattern>/*</url-pattern>-->
-<!-- </filter-mapping>-->
+ <filter>
+ <filter-name>rack</filter-name>
+ <filter-class>org.ourproject.kune.rack.RackServletFilter</filter-class>
+ <init-param>
+ <param-name>org.ourproject.kune.rack.RackModule</param-name>
+ <param-value>
+ org.ourproject.kune.app.server.KuneRackModule
+ </param-value>
+ </init-param>
+ </filter>
+ <filter-mapping>
+ <filter-name>rack</filter-name>
+ <url-pattern>/ws/*</url-pattern>
+ </filter-mapping>
<!-- Wave proxies with context /wiab/ ====================================================================== -->
<!-- <servlet> -->
<!-- <servlet-name>WiabSocketIO</servlet-name> -->
More information about the kune-commits
mailing list