Ignore:
Timestamp:
10/14/13 16:38:34 (11 years ago)
Author:
stoda
Message:

All tests working

TODO sometimes exceptiontest fails

Location:
branches/supervisor/src/main/java/omq
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/supervisor/src/main/java/omq/common/util/OmqConnectionFactory.java

    r83 r102  
    5757                                working = true;
    5858                        } catch (Exception e) {
     59//                              e.printStackTrace();
    5960                                logger.error(e);
    6061                                long milis = 2000;
  • branches/supervisor/src/main/java/omq/common/util/ParameterQueue.java

    r101 r102  
    132132         */
    133133
    134         /**
    135          * Set how many threads will be created to invoke remote methods
    136          */
    137         public static String NUM_THREADS = "omq.num_threads";
    138134
    139135        /**
  • branches/supervisor/src/main/java/omq/server/InvocationThread.java

    r101 r102  
    157157
    158158                }
     159                logger.info("ObjectMQ ('" + obj.getRef() + "') InvocationThread " + Thread.currentThread().getId() + " is killed");
    159160        }
    160161
  • branches/supervisor/src/main/java/omq/server/RemoteThreadPool.java

    r101 r102  
    44import java.util.ArrayList;
    55import java.util.List;
     6import java.util.ListIterator;
    67import java.util.concurrent.atomic.AtomicInteger;
    78
     
    102103                long now = System.currentTimeMillis();
    103104
    104                 int i = 0;
    105                 for (InvocationThread worker : workers) {
    106                         // Ensure there are at least minThreads available
    107                         if (workers.size() == minPoolThreads) {
    108                                 break;
    109                         }
     105                ListIterator<InvocationThread> lIter = workers.listIterator();
     106                while (workers.size() > minPoolThreads && lIter.hasNext()) {
     107                        InvocationThread worker = lIter.next();
    110108                        long lastExec = worker.getLastExecution();
    111109                        System.out.println("last - now = " + (now - lastExec) + " keep alive = " + keepAliveTime);
     
    114112                                try {
    115113                                        worker.kill();
    116                                         workers.remove(i);
     114                                        lIter.remove();
    117115                                } catch (IOException e) {
    118                                         // TODO Auto-generated catch block
    119                                         e.printStackTrace();
     116                                        logger.error(e);
    120117                                }
    121118
    122119                        }
    123                         i++;
    124120                }
    125121        }
Note: See TracChangeset for help on using the changeset viewer.