[jboss-cvs] JBossRemoting/src/tests/org/jboss/test/remoting/transport/socket/timeout/idle ...

Tom Elrod tom.elrod at jboss.com
Fri Nov 3 11:14:35 EST 2006


  User: telrod  
  Date: 06/11/03 11:14:35

  Added:       src/tests/org/jboss/test/remoting/transport/socket/timeout/idle 
                        Tag: remoting_2_x SampleInvocationHandler.java
  Log:
  JBREM-607 - adding idle timeout for server threads
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +57 -0     JBossRemoting/src/tests/org/jboss/test/remoting/transport/socket/timeout/idle/Attic/SampleInvocationHandler.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: SampleInvocationHandler.java
  ===================================================================
  RCS file: SampleInvocationHandler.java
  diff -N SampleInvocationHandler.java
  --- /dev/null	1 Jan 1970 00:00:00 -0000
  +++ SampleInvocationHandler.java	3 Nov 2006 16:14:35 -0000	1.1.2.1
  @@ -0,0 +1,57 @@
  +package org.jboss.test.remoting.transport.socket.timeout.idle;
  +
  +import org.jboss.remoting.ServerInvocationHandler;
  +import org.jboss.remoting.InvocationRequest;
  +import org.jboss.remoting.ServerInvoker;
  +import org.jboss.remoting.callback.InvokerCallbackHandler;
  +import org.apache.log4j.Logger;
  +
  +import javax.management.MBeanServer;
  +
  +public class SampleInvocationHandler implements ServerInvocationHandler
  +{
  +   private static Logger logger = Logger.getRootLogger();
  +   private boolean first = true;
  +
  +   public Object invoke(InvocationRequest invocation) throws Throwable
  +   {
  +      Object parm = invocation.getParameter();
  +      if(parm instanceof Boolean)
  +      {
  +         synchronized(this)
  +         {
  +            if(first)
  +            {
  +               first = false;
  +               return Boolean.TRUE;
  +            }
  +            else
  +            {
  +               return Boolean.FALSE;
  +            }
  +         }
  +      }
  +      System.out.println(Thread.currentThread() + "******* Invoked " + parm);
  +      //Thread.sleep(5000);
  +      System.out.println(Thread.currentThread() + "******* Returning - response" + parm);
  +      String s = "response" + parm;
  +      return s;
  +   }
  +
  +   public void setMBeanServer(MBeanServer server)
  +   {
  +   }
  +
  +   public void setInvoker(ServerInvoker invoker)
  +   {
  +   }
  +
  +   public void addListener(InvokerCallbackHandler callbackHandler)
  +   {
  +   }
  +
  +   public void removeListener(InvokerCallbackHandler callbackHandler)
  +   {
  +   }
  +
  +}
  
  
  



More information about the jboss-cvs-commits mailing list