1 24 package org.objectweb.speedo.j2eedo; 25 26 import java.io.BufferedReader ; 27 import java.io.PrintWriter ; 28 import java.io.StringReader ; 29 import java.io.StringWriter ; 30 import java.util.ArrayList ; 31 import java.util.Collections ; 32 import java.util.HashMap ; 33 import java.util.Hashtable ; 34 import java.util.Iterator ; 35 import java.util.List ; 36 37 import javax.jdo.JDOException; 38 import javax.jdo.JDOFatalException; 39 import javax.jdo.PersistenceManager; 40 41 import org.objectweb.speedo.SpeedoTestHelper; 42 import org.objectweb.speedo.j2eedo.bo.DatabaseImpl; 43 import org.objectweb.speedo.j2eedo.common.PMHolder; 44 import org.objectweb.speedo.j2eedo.common.TraceTime; 45 import org.objectweb.util.monolog.Monolog; 46 import org.objectweb.util.monolog.api.BasicLevel; 47 48 54 public class TestJ2eedoApplication extends SpeedoTestHelper { 55 56 59 public final static String JEEDO_LOG_NAME = 60 org.objectweb.speedo.SpeedoTestHelper.LOG_NAME + ".j2eedo"; 61 62 protected final String SIMPLETEST = getLoggerName() + ".simpleTest"; 63 protected final String THREAD = getLoggerName() + ".thread"; 64 protected final String LOOP = getLoggerName() + ".loop"; 65 protected final String TIMEOUT = getLoggerName() + ".timeout"; 66 protected final String NBOFREAD = getLoggerName() + ".read"; 67 protected final String NBOFWRITE = getLoggerName() + ".write"; 68 69 protected boolean simpleTestOnly = false; 70 protected int nbThread = -1; 71 protected int nbTx = -1; 72 protected long timeout = -1; 73 protected int nbOfRead = -1; 74 protected int nbOfWrite = -1; 75 76 protected List methodsList = null; 77 78 private static boolean dataReset = false; 79 80 91 protected void setUp() { 92 GenerateListOfActionToBeDone generateMethod = 93 new GenerateListOfActionToBeDone(); 94 95 try { 96 for (int i = 0; i < DatabaseImpl.actionArray.length; i++) { 97 generateMethod.registerMethod( 99 DatabaseImpl.actionArray[i], 100 DatabaseImpl.actionWeightArray[i][DatabaseImpl.READ], 101 DatabaseImpl.actionWeightArray[i][DatabaseImpl.WRITE]); 102 } 103 this.methodsList = 105 generateMethod.mergeWriteReadMethodList( 106 Integer.getInteger(NBOFWRITE, 1).intValue(), 107 Integer.getInteger(NBOFREAD, 3).intValue()); 108 } catch (Exception e) { 109 e.printStackTrace(); 110 } 111 112 PMHolder pmHolder = new PMHolder(getPMF()); 113 try { 114 synchronized (JEEDO_LOG_NAME) { 115 if (!TestJ2eedoApplication.dataReset) { 116 TestJ2eedoApplication.dataReset = true; 117 logger.log( 118 BasicLevel.INFO, 119 "Resetting initial data for the new test..."); 120 DatabaseImpl.initTestData(pmHolder); 121 logger.log( 122 BasicLevel.INFO, 123 "Initial test data have been created."); 124 } 125 } 126 } catch (JDOException e) { 127 e.printStackTrace(System.out); 128 fail("Setup of initial test data throws an JDO Exception" + e); 129 } catch (Exception e) { 130 e.printStackTrace(System.out); 131 fail("Setup of initial test data throws an Exception" + e); 132 } 133 } 134 137 protected void tearDown() { 138 } 140 141 149 public TestJ2eedoApplication(String s) { 150 super(s); 151 this.simpleTestOnly = Boolean.getBoolean(SIMPLETEST); 152 this.nbThread = Integer.getInteger(THREAD, 1).intValue(); 153 this.nbTx = Integer.getInteger(LOOP, 1).intValue(); 154 this.timeout = Long.getLong(TIMEOUT, 3600000).longValue(); 155 this.nbOfRead = Integer.getInteger(NBOFREAD, 3).intValue(); 156 this.nbOfWrite = Integer.getInteger(NBOFWRITE, 1).intValue(); 157 158 System.out.println(SIMPLETEST + "=" + simpleTestOnly); 159 System.out.println(THREAD + "=" + nbThread); 160 System.out.println(LOOP + "=" + nbTx); 161 System.out.println(TIMEOUT + "=" + timeout); 162 System.out.println(NBOFREAD + "=" + nbOfRead); 163 System.out.println(NBOFWRITE + "=" + nbOfWrite); 164 165 loggerFactory = Monolog.monologFactory; 166 logger = loggerFactory.getLogger(getLoggerName()); 167 168 this.methodsList = null; 169 } 170 178 public class GenerateListOfActionToBeDone { 179 183 public final static int MAX_WEIGHT = 5; 184 188 public final static int MIN_WEIGHT = 1; 189 190 private int totalWriteWeight = 0; 191 private int totalReadWeight = 0; 192 193 private List readAndWriteActionList = null; 194 private List writeOnlyActionList = null; 195 private List readOnlyActionList = null; 196 HashMap readAndWriteAction4ReadMap = null; 197 HashMap readAndWriteAction4WriteMap = null; 198 HashMap readOnlyActionMap = null; 199 HashMap writeOnlyActionMap = null; 200 201 213 private int computeList(HashMap map, List list) { 214 if (null == map || 0 == map.size()) 215 return 0; 216 217 Iterator listOfMethod = map.keySet().iterator(); 218 int totalWeight = 0; 219 int nbEntries = 0; 220 while (listOfMethod.hasNext()) { 221 String method = (String ) listOfMethod.next(); 222 int weight = ((Integer ) map.get(method)).intValue(); 223 int nbOfEntry = Math.round(MAX_WEIGHT * MAX_WEIGHT / weight); 224 for (int i = 0; i < nbOfEntry; i++) { 225 list.add(method); 226 nbEntries++; 227 totalWeight += weight; 228 } 229 } 230 logger.log(BasicLevel.DEBUG, nbEntries + " entries added"); 231 return totalWeight; 232 } 233 234 240 private void computeReadMethodList() throws Exception { 241 try { 242 this.readOnlyActionList = new ArrayList (); 243 this.totalReadWeight = 244 computeList( 245 this.readOnlyActionMap, 246 this.readOnlyActionList); 247 } catch (Exception e) { 248 throw new Exception ("Can not compute Write Method List", e); 249 } 250 } 251 252 258 private void computeReadWriteMethodList() throws Exception { 259 try { 260 this.readAndWriteActionList = new ArrayList (); 261 262 int nbRead = 263 computeList( 264 this.readAndWriteAction4ReadMap, 265 this.readAndWriteActionList); 266 267 int nbWrite = 268 computeList( 269 this.readAndWriteAction4WriteMap, 270 this.readAndWriteActionList); 271 272 this.totalWriteWeight = nbWrite; 273 this.totalReadWeight = nbRead; 274 275 } catch (Exception e) { 276 throw new Exception ("Can not compute Write Method List", e); 277 } 278 } 279 280 286 private void computeWriteMethodList() throws Exception { 287 try { 288 this.writeOnlyActionList = new ArrayList (); 289 this.totalWriteWeight = 290 computeList( 291 this.writeOnlyActionMap, 292 this.writeOnlyActionList); 293 } catch (Exception e) { 294 throw new Exception ("Can not compute Write Method List", e); 295 } 296 } 297 298 309 public List mergeWriteReadMethodList(int nbOfWrite, int nbOfRead) 310 throws Exception { 311 if (0 >= (nbOfWrite + nbOfRead) || 0 > (nbOfWrite * nbOfRead)) 312 throw new Exception ( 313 "Parameters nbOfRead (" 314 + nbOfRead 315 + ") and nbOfWrite (" 316 + nbOfWrite 317 + ") are not correct."); 318 319 logger.log( 320 BasicLevel.DEBUG, 321 "Generate the actions list according registered actions read/write weight"); 322 List list1 = new ArrayList (); 323 324 this.computeReadWriteMethodList(); 325 list1.addAll(this.readAndWriteActionList); 326 327 this.computeReadMethodList(); 328 this.computeWriteMethodList(); 329 330 list1.addAll(this.writeOnlyActionList); 331 332 if (logger.isLoggable(BasicLevel.DEBUG)) { 333 Iterator iter = null; 334 int nbActions = 0; 335 iter = this.readOnlyActionList.iterator(); 336 for (nbActions = 0; iter.hasNext(); nbActions++) 337 iter.next(); 338 logger.log( 339 BasicLevel.DEBUG, 340 nbActions 341 + " read only actions (total weight:" 342 + this.totalReadWeight 343 + ")"); 344 iter = this.writeOnlyActionList.iterator(); 345 for (nbActions = 0; iter.hasNext(); nbActions++) 346 iter.next(); 347 logger.log( 348 BasicLevel.DEBUG, 349 nbActions 350 + " write only actions (total weight:" 351 + this.totalWriteWeight 352 + ")"); 353 iter = this.readAndWriteActionList.iterator(); 354 for (nbActions = 0; iter.hasNext(); nbActions++) 355 iter.next(); 356 logger.log( 357 BasicLevel.DEBUG, 358 nbActions + " read & write only actions"); 359 } 360 361 Iterator iter = list1.iterator(); 362 int weightRead = 0; 363 int weightWrite = 0; 364 String method; 365 while (iter.hasNext()) { 366 method = (String ) iter.next(); 367 if (this.readOnlyActionMap.containsKey(method)) 368 weightRead 369 += ((Integer ) this.readOnlyActionMap.get(method)) 370 .intValue(); 371 else if (this.writeOnlyActionMap.containsKey(method)) 372 weightWrite 373 += ((Integer ) this.writeOnlyActionMap.get(method)) 374 .intValue(); 375 else { 376 weightRead 377 += ((Integer ) this.readAndWriteAction4ReadMap.get(method)) 378 .intValue(); 379 weightWrite 380 += ((Integer ) this 381 .readAndWriteAction4WriteMap 382 .get(method)) 383 .intValue(); 384 } 385 } 386 387 List list = new ArrayList (); 388 if (0 == nbOfWrite) { 389 list.addAll(this.readOnlyActionList); 390 } else if (0 == nbOfRead) { 391 list.addAll(this.writeOnlyActionList); 392 } else { 393 int nbRead2BeAdd = 394 nbOfRead * weightWrite / nbOfWrite - weightRead; 395 if (0 >= nbRead2BeAdd) 396 nbRead2BeAdd = 1; 397 logger.log( 398 BasicLevel.DEBUG, 399 "Before merge Read only methods : \nnbRead " 400 + weightRead 401 + "\nnbWrite " 402 + weightWrite 403 + "\nnbRead2BeAdd " 404 + nbRead2BeAdd 405 + "\nAddList:" 406 + (float) nbRead2BeAdd / (float) this.totalReadWeight 407 + "\t#:" 408 + Math.round( 409 (float) nbRead2BeAdd / (float) totalReadWeight) 410 + " *(" 411 + this.totalReadWeight 412 + ")"); 413 414 if (nbRead2BeAdd < this.totalReadWeight) { 415 for (int j = 0; 416 j 417 < Math.round( 418 (float) totalReadWeight / (float) nbRead2BeAdd); 419 j++) 420 list.addAll(list1); 421 list.addAll(this.readOnlyActionList); 422 } else { 423 list.addAll(list1); 424 for (int j = 0; 425 j 426 < Math.round( 427 (float) nbRead2BeAdd / (float) totalReadWeight); 428 j++) 429 list.addAll(this.readOnlyActionList); 430 } 431 } 432 if (logger.isLoggable(BasicLevel.DEBUG)) { 433 weightRead = 0; 434 weightWrite = 0; 435 int nbCalls = 0; 436 iter = list.iterator(); 437 while (iter.hasNext()) { 438 method = (String ) iter.next(); 439 nbCalls++; 440 if (this.readOnlyActionMap.containsKey(method)) 441 weightRead 442 += ((Integer ) this.readOnlyActionMap.get(method)) 443 .intValue(); 444 else if (this.writeOnlyActionMap.containsKey(method)) 445 weightWrite 446 += ((Integer ) this.writeOnlyActionMap.get(method)) 447 .intValue(); 448 else { 449 weightRead 450 += ((Integer ) this 451 .readAndWriteAction4ReadMap 452 .get(method)) 453 .intValue(); 454 weightWrite 455 += ((Integer ) this 456 .readAndWriteAction4WriteMap 457 .get(method)) 458 .intValue(); 459 } 460 } 461 logger.log( 462 BasicLevel.DEBUG, 463 "The action list is set : \nnbRead " 464 + weightRead 465 + "\nnbWrite " 466 + weightWrite 467 + "\n\tGoal rate : " 468 + nbOfRead 469 + "/" 470 + nbOfWrite 471 + "=" 472 + ((nbOfWrite != 0) 473 ? Float.toString( 474 (float) nbOfRead / (float) nbOfWrite) 475 : "NaN") 476 + "\n\tRate:" 477 + ((weightWrite != 0) 478 ? Float.toString( 479 (float) weightRead / (float) weightWrite) 480 : "NaN") 481 + " in " 482 + nbCalls 483 + " calls"); 484 } 485 486 return list; 487 } 488 489 507 public void registerMethod( 508 String name, 509 int readWeight, 510 int writeWeight) 511 throws Exception { 512 if (name.equals(DatabaseImpl.PARAMETER_PING)) 513 return; 514 if (0 == readWeight) 515 this.registerMethodWrite(name, writeWeight); 516 else if (0 == writeWeight) 517 this.registerMethodRead(name, readWeight); 518 else 519 registerMethodReadWrite(name, readWeight, writeWeight); 520 } 521 522 534 private void registerMethodReadWrite( 535 String name, 536 int readWeight, 537 int writeWeight) 538 throws Exception { 539 if (null == this.readAndWriteAction4ReadMap) 540 this.readAndWriteAction4ReadMap = new HashMap (); 541 if (null == this.readAndWriteAction4WriteMap) 542 this.readAndWriteAction4WriteMap = new HashMap (); 543 544 if (readWeight > GenerateListOfActionToBeDone.MAX_WEIGHT 545 || readWeight < GenerateListOfActionToBeDone.MIN_WEIGHT 546 || writeWeight > GenerateListOfActionToBeDone.MAX_WEIGHT 547 || writeWeight < GenerateListOfActionToBeDone.MIN_WEIGHT) 548 throw new Exception ( 549 "Can not register this method : the weight must be defined between " 550 + GenerateListOfActionToBeDone.MIN_WEIGHT 551 + " and " 552 + GenerateListOfActionToBeDone.MAX_WEIGHT); 553 this.readAndWriteAction4ReadMap.put(name, new Integer (readWeight)); 554 this.readAndWriteAction4WriteMap.put( 555 name, 556 new Integer (writeWeight)); 557 } 558 559 567 private void registerMethodRead(String name, int weight) 568 throws Exception { 569 if (null == this.readOnlyActionMap) 570 this.readOnlyActionMap = new HashMap (); 571 572 if (weight > GenerateListOfActionToBeDone.MAX_WEIGHT 573 || weight < GenerateListOfActionToBeDone.MIN_WEIGHT) 574 throw new Exception ( 575 "Can not register this method : the weight must be defined between " 576 + GenerateListOfActionToBeDone.MIN_WEIGHT 577 + " and " 578 + GenerateListOfActionToBeDone.MAX_WEIGHT); 579 this.readOnlyActionMap.put(name, new Integer (weight)); 580 } 581 582 590 private void registerMethodWrite(String name, int weight) 591 throws Exception { 592 if (null == this.writeOnlyActionMap) 593 this.writeOnlyActionMap = new HashMap (); 594 595 this.totalWriteWeight += weight; 596 597 if (weight > GenerateListOfActionToBeDone.MAX_WEIGHT 598 || weight < GenerateListOfActionToBeDone.MIN_WEIGHT) 599 throw new Exception ( 600 "Can not register this method : the weight must be defined between " 601 + GenerateListOfActionToBeDone.MIN_WEIGHT 602 + " and " 603 + GenerateListOfActionToBeDone.MAX_WEIGHT); 604 this.writeOnlyActionMap.put(name, new Integer (weight)); 605 } 606 607 610 public GenerateListOfActionToBeDone() { 611 this.readOnlyActionList = null; 612 this.writeOnlyActionList = null; 613 this.readAndWriteAction4ReadMap = null; 614 this.readAndWriteAction4WriteMap = null; 615 this.readOnlyActionMap = null; 616 this.writeOnlyActionMap = null; 617 this.totalWriteWeight = 0; 618 this.totalReadWeight = 0; 619 } 620 621 } 622 623 628 protected String getLoggerName() { 629 return JEEDO_LOG_NAME; 630 } 631 632 private final static Hashtable needTransactionArray = new Hashtable (); 633 634 protected String performMethod(String action) 635 throws Exception , JDOException, JDOFatalException { 636 PMHolder pmHolder = new PMHolder(getPMF()); 637 DatabaseImpl databaseImpl = new DatabaseImpl(pmHolder); 638 639 String returnStr = null; 640 boolean needTrans; 641 PersistenceManager pm = null; 642 643 if (!needTransactionArray.containsKey(action)) { 644 int k = 0; 645 for (; 646 !DatabaseImpl.actionArray[k].equals(action) 647 && k < DatabaseImpl.actionWeightArray.length; 648 k++); 649 650 if (0 == DatabaseImpl.actionWeightArray[k][DatabaseImpl.WRITE]) 651 needTransactionArray.put(action, new Boolean (false)); 652 else 653 needTransactionArray.put(action, new Boolean (true)); 654 } 655 needTrans = ((Boolean ) needTransactionArray.get(action)).booleanValue(); 656 needTrans = true; 657 if (needTrans) { 658 pm = pmHolder.getPersistenceManager(); 659 pm.currentTransaction().begin(); 660 } 661 try { 662 returnStr = databaseImpl.doAction(action); 663 } catch (JDOFatalException e) { 664 if (pm != null && !pm.isClosed() && pm.currentTransaction().isActive()) { 665 pm.currentTransaction().rollback(); 666 } 667 throw e; 668 } finally { 669 if (pm != null && !pm.isClosed() && pm.currentTransaction().isActive()) { 670 pm.currentTransaction().commit(); 671 } 672 if (needTrans) { 673 pmHolder.closePersistenceManager(); 674 } 675 } 676 return returnStr; 677 } 678 679 protected void perform() { 680 final int _nbTx = this.nbTx; 681 final List _methodsList = this.methodsList; 682 this.displayTestParameters(); 683 684 Thread [] ts = new Thread [nbThread]; 686 687 for (int thread = 0; thread < nbThread; thread++) { 688 ts[thread] = new Thread (new Runnable () { 689 public void run() { 690 TraceTime traceTime = new TraceTime(); 691 String action = null; 692 Iterator iter = null; 693 694 for (int j = 0, i = 0; i < _nbTx; i++) { 695 traceTime.startTask(Thread.currentThread().getName() + ".loop." + i); 696 logger.log(BasicLevel.INFO, "Start loop " + i); 697 Collections.shuffle(_methodsList); 698 iter = _methodsList.iterator(); 699 boolean deadLock = false; 700 String returnStr; 701 while (iter.hasNext()) { 702 if (0 == (j++ % 100.0)) { 703 logger.log(BasicLevel.INFO, j + " actions called..."); 704 } 705 action = (String ) iter.next(); 706 logger.log(BasicLevel.DEBUG, "Calls method:" + action); 708 deadLock = true; 709 while (deadLock) { 710 deadLock = false; 711 try { 712 returnStr = performMethod(action); 713 logger.log(BasicLevel.DEBUG, 714 "The method " + action + " returns:\n" 715 + returnStr); 716 } catch (JDOFatalException e) { 717 logger.log( BasicLevel.INFO, "The method " 718 + action 719 + " throws a JDO Fatal Exception"); 720 deadLock = true; 721 } catch (Exception e) { 722 logger.log(BasicLevel.ERROR, 723 "The method " + action 724 + " throws an exception ", e); 725 fail("The method " + action 726 + " throws JDO an exception " 727 + e.getMessage()); 728 } 729 } 730 } 731 } 732 traceTime.endTask(); 733 logger.log(BasicLevel.INFO, "End of thread loops : " + traceTime.report()); 734 } 735 }); 736 } 737 738 for (int thread = 0; thread < nbThread; thread++) { 740 ts[thread].start(); 741 } 742 743 try { 744 for (int thread = 0; thread < nbThread; thread++) { 746 ts[thread].join(timeout); 747 if (ts[thread].isAlive()) { 748 logger.log( 749 BasicLevel.WARN, 750 "Thread " 751 + ts[thread].getName() 752 + " is not finished after the delay, it could be blocked"); 753 ts[thread].interrupt(); 754 fail("Thread " + ts[thread] + " is blocked!"); 755 } 756 } 757 } catch (InterruptedException e) { 758 fail(e.getMessage()); 759 } 760 try { 762 PMHolder pmHolder = new PMHolder(getPMF()); 763 DatabaseImpl databaseImpl = new DatabaseImpl(pmHolder); 764 String str = databaseImpl.doAction(""); 765 logger.log(BasicLevel.DEBUG, str); 766 } catch (Exception e) { 767 logger.log(BasicLevel.ERROR, "Error occurs : ", e); 768 } 769 770 } 771 772 776 protected void displayTestParameters() { 777 if (!logger.isLoggable(BasicLevel.INFO)) 778 return; 779 Throwable t = new Throwable (); 781 StringWriter sw = new StringWriter (); 782 PrintWriter pw = new PrintWriter (sw); 783 t.printStackTrace(pw); 784 String input = sw.getBuffer().toString(); 785 StringReader sr = new StringReader (input); 786 BufferedReader br = new BufferedReader (sr); 787 try { 788 String line; 789 br.readLine(); while (true) { 791 line = br.readLine(); 792 int paren = line.indexOf('('); 793 line = line.substring(0, paren); 794 int period = line.lastIndexOf('.'); 795 line = line.substring(period + 1); 796 if (line.indexOf("test") != 0) 797 continue; 798 break; 799 } 800 logger.log(BasicLevel.INFO, "The test is : " + line); 801 } catch (Exception e) { 802 } 803 804 logger.log( 805 BasicLevel.INFO, 806 "The test is launch with the parameters : \nNumber of threads: " 807 + this.nbThread 808 + "\nNumber of actions list loop: " 809 + this.nbTx 810 + "\ntime out (ms): " 811 + this.timeout 812 + "\nnb of read proportion: " 813 + this.nbOfRead 814 + "\nnb of write proportion: " 815 + this.nbOfWrite); 816 817 int nbCalls = 0; 818 String method; 819 HashMap actionsWeight = new HashMap (); 820 Iterator iter = this.methodsList.iterator(); 821 int count = -1; 822 while (iter.hasNext()) { 823 method = (String ) iter.next(); 824 nbCalls++; 825 if (actionsWeight.containsKey(method)) { 826 count = ((Integer ) actionsWeight.get(method)).intValue() + 1; 827 actionsWeight.remove(method); 828 actionsWeight.put(method, new Integer (count)); 829 } else { 830 actionsWeight.put(method, new Integer (1)); 831 } 832 } 833 logger.log( 834 BasicLevel.INFO, 835 "Action list {action1=count, action2=count ...}: " 836 + actionsWeight 837 + "\nTotal number of calls: " 838 + nbCalls); 839 } 840 841 849 public void testSimple() { 850 this.perform(); 851 } 852 853 856 public void _testReadOnly() { 857 if (this.simpleTestOnly) 858 return; 859 GenerateListOfActionToBeDone generateMethod = 861 new GenerateListOfActionToBeDone(); 862 863 try { 864 for (int i = 0; i < DatabaseImpl.actionArray.length; i++) { 865 if (0 == DatabaseImpl.actionWeightArray[i][DatabaseImpl.WRITE]) 866 generateMethod.registerMethod( 867 DatabaseImpl.actionArray[i], 868 DatabaseImpl.actionWeightArray[i][DatabaseImpl.READ], 869 DatabaseImpl.actionWeightArray[i][DatabaseImpl.WRITE]); 870 } 871 this.nbOfRead = 1; 872 this.nbOfWrite = 0; 873 this.methodsList = 874 generateMethod.mergeWriteReadMethodList( 875 this.nbOfWrite, 876 this.nbOfRead); 877 } catch (Exception e) { 878 e.printStackTrace(); 879 } 880 this.perform(); 881 } 882 883 886 public void _testIncreaseDatabaseSize() { 887 if (this.simpleTestOnly) 888 return; 889 GenerateListOfActionToBeDone generateMethod = 891 new GenerateListOfActionToBeDone(); 892 893 try { 894 for (int i = 0; i < DatabaseImpl.actionArray.length; i++) { 895 if (!(DatabaseImpl 896 .actionArray[i] 897 .equalsIgnoreCase(DatabaseImpl.PARAMETER_MERGE_DEPARTMENT)) 898 && !(DatabaseImpl 899 .actionArray[i] 900 .equalsIgnoreCase(DatabaseImpl.PARAMETER_REM_PROJECT)) 901 && !(DatabaseImpl 902 .actionArray[i] 903 .equalsIgnoreCase(DatabaseImpl.PARAMETER_REM_EMPLOYEE))) 904 generateMethod.registerMethod( 905 DatabaseImpl.actionArray[i], 906 DatabaseImpl.actionWeightArray[i][DatabaseImpl.READ], 907 DatabaseImpl.actionWeightArray[i][DatabaseImpl.WRITE]); 908 } 909 this.methodsList = 910 generateMethod.mergeWriteReadMethodList( 911 this.nbOfWrite, 912 this.nbOfRead); 913 } catch (Exception e) { 914 e.printStackTrace(); 915 } 916 this.perform(); 917 } 918 } 919 | Popular Tags |