incubator-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hamm...@apache.org
Subject cvs commit: incubator-altrmi/src/test/org/apache/altrmi/test AbstractHelloTestCase.java
Date Fri, 18 Apr 2003 12:57:16 GMT
hammant     2003/04/18 05:57:15

  Modified:    src/java/org/apache/altrmi/client/impl/messenger
                        SynchronousMessengerClientInvocationHandler.java
               src/java/org/apache/altrmi/server/impl/messenger
                        SynchronousMessengerServer.java
               src/test/org/apache/altrmi/test AbstractHelloTestCase.java
  Log:
  ThreadPool works again for JMS transport.
  
  Revision  Changes    Path
  1.3       +6 -9      incubator-altrmi/src/java/org/apache/altrmi/client/impl/messenger/SynchronousMessengerClientInvocationHandler.java
  
  Index: SynchronousMessengerClientInvocationHandler.java
  ===================================================================
  RCS file: /home/cvs/incubator-altrmi/src/java/org/apache/altrmi/client/impl/messenger/SynchronousMessengerClientInvocationHandler.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SynchronousMessengerClientInvocationHandler.java	18 Apr 2003 09:41:47 -0000	1.2
  +++ SynchronousMessengerClientInvocationHandler.java	18 Apr 2003 12:57:15 -0000	1.3
  @@ -91,7 +91,7 @@
       private Messenger m_clientMessenger;
       private String m_subject;
       private Destination m_destination;
  -    
  +
       /** timeout of requests in milliseconds or negative to disable */
       private long timeout = 4000L;
   
  @@ -214,17 +214,14 @@
           {
               ObjectMessage message = m_clientMessenger.createObjectMessage(request);
   
  -            //JFrame jf = new JFrame("hello");
  -            //jf.setVisible(true);
  -            Message response = (timeout > 0 ) 
  +            Message response = (timeout > 0 )
                   ? m_clientMessenger.call(m_destination, message, timeout)
                   : m_clientMessenger.call(m_destination, message);
  -            //jf = new JFrame("hello2");
  -            //jf.setVisible(true);
  +
   
               System.out.println("<<<< client has received: " + response);
  -            
  -            if (response == null) 
  +
  +            if (response == null)
               {
                   throw new AltrmiRuntimeException("Request timed out");
               }
  
  
  
  1.7       +7 -14     incubator-altrmi/src/java/org/apache/altrmi/server/impl/messenger/SynchronousMessengerServer.java
  
  Index: SynchronousMessengerServer.java
  ===================================================================
  RCS file: /home/cvs/incubator-altrmi/src/java/org/apache/altrmi/server/impl/messenger/SynchronousMessengerServer.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- SynchronousMessengerServer.java	18 Apr 2003 09:41:47 -0000	1.6
  +++ SynchronousMessengerServer.java	18 Apr 2003 12:57:15 -0000	1.7
  @@ -85,8 +85,6 @@
       private Messenger m_messenger;
       private String m_subject;
       private Destination m_destination;
  -    private ThreadContext m_threadContext;
  -    private boolean useThreadPool = false;
   
       public SynchronousMessengerServer(Messenger messenger, String subject) {
           super(new InvocationHandlerAdapter());
  @@ -132,7 +130,7 @@
       public void onMessage(final Message message) {
               System.out.println(">>>> server received inbound message: " + message);
               //JOptionPane.showInputDialog("receved inbound message: " + message);
  -            
  +
               Runnable runnable = new Runnable() {
                   public void run() {
                       try
  @@ -153,10 +151,10 @@
                                   ObjectMessage om = m_messenger.createObjectMessage( reply
);
                                   //ObjectMessage om = m_messenger.createObjectMessage( replyBytes
);
                                   om.setJMSCorrelationID(correlationID);
  -                                
  +
                                   System.out.println("**** sending reply to client: " + om);
                                   //JOptionPane.showInputDialog("**** sending message: "
+ om);
  -            
  +
                                   m_messenger.send(dest, om);
                               }
                               else {
  @@ -172,14 +170,9 @@
                       }
                   }
               };
  -            
  -            if (useThreadPool) {
  -                getThreadPool().getThreadContext(runnable);            
  -            }
  -            else {
  -                runnable.run();
  -            }
   
  -           
  +            ThreadContext tc = getThreadPool().getThreadContext(runnable);
  +            tc.start();
  +
        }
   }
  
  
  
  1.5       +5 -2      incubator-altrmi/src/test/org/apache/altrmi/test/AbstractHelloTestCase.java
  
  Index: AbstractHelloTestCase.java
  ===================================================================
  RCS file: /home/cvs/incubator-altrmi/src/test/org/apache/altrmi/test/AbstractHelloTestCase.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AbstractHelloTestCase.java	22 Feb 2003 19:14:17 -0000	1.4
  +++ AbstractHelloTestCase.java	18 Apr 2003 12:57:15 -0000	1.5
  @@ -294,10 +294,13 @@
               // IDE, in which case the test is not run.
           }
   
  -
  -        for (int i = 1; i < iterations; i++ ) {
  +        long start = System.currentTimeMillis();
  +        for (int i = 0; i < iterations; i++ ) {
               testClient.testSpeed();
           }
  +        long end = System.currentTimeMillis();
  +        System.out.println("--> ST " + this.getClass().getName() + " " + iterations
+ " " + ((end - start)/1000) );
  +
   
       }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@incubator.apache.org
For additional commands, e-mail: cvs-help@incubator.apache.org


Mime
View raw message