Package jmt.engine.QueueNet

Examples of jmt.engine.QueueNet.JobInfoList


    } catch (NetException ne) {
      ne.printStackTrace();
      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;
      }
    }

    //print
    ListIterator iterator = list.getJobList().listIterator();
    JobInfo current = null;
    String className;
    int classPr, jobID;

    String strategyType = "";
View Full Code Here


       
     
        sendBackward(NetEvent.EVENT_ACK, message.getJob(), 0.0);
       
        //remove job from node list
        JobInfoList local = getOwnerNode().getJobInfoList();
        local.remove(local.lookFor(job));
        //remove job from station list
        jobsList.remove(jobsList.lookFor(job));
        GlobalJobInfoList global = getOwnerNode().getQueueNet().getJobInfoList();
        global.performJobClassSwitch(job, getJobClasses().get(jobClassOut));
        sendForward(message.getEvent(), job, 0.0);
View Full Code Here

        numOut = output.size() * jobsPerLink;
        // Resets ack count
        ackCount = 0;

        // Removes job from global node list
        JobInfoList info = getOwnerNode().getJobInfoList();
        JobInfo jobData = info.lookFor(job);
        if (jobData != null) {
          info.remove(jobData);
        }

        // Gets global jobInfoList
        GlobalJobInfoList global = getOwnerNode().getQueueNet().getJobInfoList();

View Full Code Here

        if (job instanceof ForkJob) {
          ForkJob fJob = (ForkJob) job;

          // Removes job from global node list
          JobInfoList info = getOwnerNode().getJobInfoList();
          JobInfo jobData = info.lookFor(job);
          if (jobData != null) {
            info.remove(jobData);
          }

          // Removes job from system list
          GlobalJobInfoList global = getOwnerNode().getQueueNet().getJobInfoList();
          global.removeForkedJob(fJob);

          // Needed pieces
          int needed;
          if (jobs.containsKey(fJob.getForkedJob())) {
            needed = jobs.get(fJob.getForkedJob()).intValue();
          } else {
            needed = fJob.getForkedNumber();
            // As we are waiting for other fragments, adds merged job to global and local info list
            JobInfo merged = new JobInfo(fJob.getForkedJob());
            info.add(merged);
            jobsList.add(merged);
          }
          // Decrement needed as we received this job
          needed--;
View Full Code Here

TOP

Related Classes of jmt.engine.QueueNet.JobInfoList

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.