Package jmt.engine.QueueNet

Examples of jmt.engine.QueueNet.LinkedJobInfoList


    } 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


  }

  @Override
  protected void nodeLinked(NetNode node) {
    // Sets netnode dependent properties
    waitingRequests = new LinkedJobInfoList(getJobClasses().size(), true);
    //TODO: togliere??
    //if (jobsList == null)
    //  jobsList = new JobInfoList(getJobClasses().size(), true);
  }
View Full Code Here

  @Override
  protected void nodeLinked(NetNode node) {
    // Sets netnode dependent properties

    //if (jobsList == null)
    jobsList = new LinkedJobInfoList(getJobClasses().size(), true);

    jobsList_node = this.getOwnerNode().getJobInfoList();

    //copies drop properties from blocking region
    //and initializes dropped jobs
View Full Code Here

  }

  @Override
  protected void nodeLinked(NetNode node) {
    // Sets netnode dependent properties
    waitingRequests = new LinkedJobInfoList(getJobClasses().size(), true);
    if (putStrategy == null) {
      putStrategy = new QueuePutStrategy[getJobClasses().size()];
      for (int i = 0; i < getJobClasses().size(); i++) {
        putStrategy[i] = new TailStrategy();
      }
    }

    // TODO the following line its not clean. The correct behavior should be implemented without this hack.
    try {
      if (getOwnerNode().getSection(SERVICE) instanceof PSServer) {
        jobsList = new PSJobInfoList(getJobClasses().size(), true);
        queueJobInfoList = ((PSJobInfoList) jobsList).getInternalList();
      }
    } catch (NetException ex) {
      logger.error(ex);
    }
    if (jobsList == null) {
      jobsList = new LinkedJobInfoList(getJobClasses().size(), true);
    }
    if (queueJobInfoList == null) {
      queueJobInfoList = jobsList;
    }
View Full Code Here

TOP

Related Classes of jmt.engine.QueueNet.LinkedJobInfoList

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.