[hornetq-commits] JBoss hornetq SVN: r7967 - branches/Branch_Replication_Changes/tests/src/org/hornetq/tests/integration/cluster/failover.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Sep 17 10:08:01 EDT 2009


Author: timfox
Date: 2009-09-17 10:08:00 -0400 (Thu, 17 Sep 2009)
New Revision: 7967

Added:
   branches/Branch_Replication_Changes/tests/src/org/hornetq/tests/integration/cluster/failover/DelayInterceptor.java
Log:
added missing file

Added: branches/Branch_Replication_Changes/tests/src/org/hornetq/tests/integration/cluster/failover/DelayInterceptor.java
===================================================================
--- branches/Branch_Replication_Changes/tests/src/org/hornetq/tests/integration/cluster/failover/DelayInterceptor.java	                        (rev 0)
+++ branches/Branch_Replication_Changes/tests/src/org/hornetq/tests/integration/cluster/failover/DelayInterceptor.java	2009-09-17 14:08:00 UTC (rev 7967)
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.tests.integration.cluster.failover;
+
+import org.hornetq.core.exception.HornetQException;
+import org.hornetq.core.remoting.Interceptor;
+import org.hornetq.core.remoting.Packet;
+import org.hornetq.core.remoting.RemotingConnection;
+import org.hornetq.core.remoting.impl.wireformat.PacketImpl;
+
+/**
+ * A DelayInterceptor
+ *
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ *
+ *
+ */
+public class DelayInterceptor implements Interceptor
+{
+   public boolean intercept(Packet packet, RemotingConnection connection) throws HornetQException
+   {
+      if (packet.getType() == PacketImpl.SESS_SEND)
+      {
+         try
+         {
+            Thread.sleep(2000);
+         }
+         catch (Exception e)
+         {                  
+         }                  
+      }
+      
+      return true;
+   }
+}



More information about the hornetq-commits mailing list