Package jmt.engine.NetStrategies

Examples of jmt.engine.NetStrategies.QueuePutStrategy


      return;
    }

    JobInfoList list = new LinkedJobInfoList(3, true);

    QueuePutStrategy putStrategy_H = new HeadStrategy();
    QueuePutStrategy putStrategy_T = new TailStrategy();
    QueuePutStrategy putStrategy_HP = new HeadStrategyPriority();
    QueuePutStrategy putStrategy_TP = new TailStrategyPriority();

    QueuePutStrategy putStrategy = null;

    switch (strategy) {
      case STRATEGY_HEAD:
        putStrategy = putStrategy_H;
        break;
      case STRATEGY_TAIL:
        putStrategy = putStrategy_T;
        break;
      case STRATEGY_HEAD_PRIORITY:
        putStrategy = putStrategy_HP;
        break;
      case STRATEGY_TAIL_PRIORITY:
        putStrategy = putStrategy_TP;
        break;
    }

    Job[] jobs = new Job[10];

    jobs[0] = new Job(class1);
    jobs[1] = new Job(class3);
    jobs[2] = new Job(class2);
    jobs[3] = new Job(class2);
    jobs[4] = new Job(class1);
    jobs[5] = new Job(class1);
    jobs[6] = new Job(class1);
    jobs[7] = new Job(class2);
    jobs[8] = new Job(class3);
    jobs[9] = new Job(class3);

    byte b = 0x01;

    for (Job job : jobs) {
      try {
        putStrategy.put(job, list, b, null, null);
      } catch (NetException ne) {
        ne.printStackTrace();
        return;
      }
    }
View Full Code Here

TOP

Related Classes of jmt.engine.NetStrategies.QueuePutStrategy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.