[kune-commits] r1142 - in trunk/src/main: java/org/ourproject/kune/app/server java/org/ourproject/kune/app/server/wave resources

vjrj vjrj at ourproject.org
Mon Aug 31 18:10:14 CEST 2009


Author: vjrj
Date: 2009-08-31 18:10:13 +0200 (Mon, 31 Aug 2009)
New Revision: 1142

Added:
   trunk/src/main/java/org/ourproject/kune/app/server/wave/WaveInterceptorModule.java
Modified:
   trunk/src/main/java/org/ourproject/kune/app/server/KuneRackModule.java
   trunk/src/main/resources/kune.properties
Log:
Basic wave method interception

Modified: trunk/src/main/java/org/ourproject/kune/app/server/KuneRackModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/server/KuneRackModule.java	2009-08-31 10:58:17 UTC (rev 1141)
+++ trunk/src/main/java/org/ourproject/kune/app/server/KuneRackModule.java	2009-08-31 16:10:13 UTC (rev 1142)
@@ -20,6 +20,7 @@
 package org.ourproject.kune.app.server;
 
 import org.ourproject.kune.app.server.wave.WaveContainerListener;
+import org.ourproject.kune.app.server.wave.WaveInterceptorModule;
 import org.ourproject.kune.app.server.wave.WavePropertiesParser;
 import org.ourproject.kune.blogs.server.BlogServerModule;
 import org.ourproject.kune.chat.server.ChatServerModule;
@@ -128,6 +129,7 @@
         builder.use(new RESTServicesModule());
         builder.use(configModule);
         builder.use(WavePropertiesParser.parseFlags(FlagSettings.class));
+        builder.use(new WaveInterceptorModule());
         builder.use(new ServerModule());
     }
 

Added: trunk/src/main/java/org/ourproject/kune/app/server/wave/WaveInterceptorModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/server/wave/WaveInterceptorModule.java	2009-08-31 10:58:17 UTC (rev 1141)
+++ trunk/src/main/java/org/ourproject/kune/app/server/wave/WaveInterceptorModule.java	2009-08-31 16:10:13 UTC (rev 1142)
@@ -0,0 +1,30 @@
+package org.ourproject.kune.app.server.wave;
+
+import org.aopalliance.intercept.MethodInterceptor;
+import org.aopalliance.intercept.MethodInvocation;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.waveprotocol.wave.examples.fedone.waveserver.WaveClientRpcImpl;
+
+import com.google.inject.AbstractModule;
+import com.google.inject.matcher.Matchers;
+
+public class WaveInterceptorModule extends AbstractModule {
+    public class WaveInterceptor implements MethodInterceptor {
+        public WaveInterceptor() {
+        }
+
+        public Object invoke(final MethodInvocation invocation) throws Throwable {
+            LOG.info("Wave method intercepted: " + invocation.getMethod().toString());
+            return invocation.proceed();
+        }
+    }
+
+    private static final Log LOG = LogFactory.getLog(WaveInterceptorModule.class);
+
+    @Override
+    protected void configure() {
+        bindInterceptor(Matchers.identicalTo(WaveClientRpcImpl.class), Matchers.any(), new WaveInterceptor());
+    }
+
+}

Modified: trunk/src/main/resources/kune.properties
===================================================================
--- trunk/src/main/resources/kune.properties	2009-08-31 10:58:17 UTC (rev 1141)
+++ trunk/src/main/resources/kune.properties	2009-08-31 16:10:13 UTC (rev 1142)
@@ -67,8 +67,8 @@
 kune.wave.xmpp_server_ping =
 kune.wave.client_frontend_hostname = 127.0.0.1
 kune.wave.client_frontend_port = 9876
-kune.wave.certificate_private_key = war/WEB-INF/classes/localhost.key
-kune.wave.certificate_files = war/WEB-INF/classes/localhost.cer
+kune.wave.certificate_private_key = war/WEB-INF/localhost.key
+kune.wave.certificate_files = war/WEB-INF/localhost.cer
 kune.wave.certificate_domain = localhost
 kune.wave.waveserver_disable_verification = true
 




More information about the kune-commits mailing list