Examples of NetException


Examples of com.firefly.net.exception.NetException

    // Clean up the stale messages in the write buffer.
    synchronized (session.getWriteLock()) {
      Object obj = session.getCurrentWrite();
      if (obj != null) {
        cause = new NetException("cleanUpWriteBuffer error");
        session.getCurrentWriteBuffer().release();
        session.resetCurrentWriteAndWriteBuffer();
        fireExceptionCaught = true;
      }

      Queue<Object> writeBuffer = session.getWriteBuffer();
      if (!writeBuffer.isEmpty()) {
        // Create the exception only once to avoid the excessive
        // overhead
        // caused by fillStackTrace.
        if (cause == null) {
          cause = new NetException("cleanUpWriteBuffer error");
        }

        while (true) {
          obj = writeBuffer.poll();
          if (obj == null) {
View Full Code Here

Examples of com.firefly.net.exception.NetException

  }

  @Override
  public void start(String host, int port) {
    if (config == null)
      throw new NetException("server config is null");
    log.debug(config.toString());
    listen(bind(host, port));
  }
View Full Code Here

Examples of com.firefly.net.exception.NetException

      selector = Selector.open();
      start = true;
      new Thread(this, "firefly-tcp-worker: " + workerId).start();
    } catch (IOException e) {
      log.error("worker init error", e);
      throw new NetException("worker init error");
    }
  }
View Full Code Here

Examples of com.firefly.net.exception.NetException

    boolean fireExceptionCaught = false;

    // Clean up the stale messages in the write buffer.
    Object obj = session.currentWrite;
    if (obj != null) {
      cause = new NetException("cleanUpWriteBuffer error");
      session.currentWriteBuffer.release();
      session.resetCurrentWriteAndWriteBuffer();
      fireExceptionCaught = true;
    }

    Queue<Object> writeBuffer = session.writeBuffer;
    if (!writeBuffer.isEmpty()) {
      // Create the exception only once to avoid the excessive
      // overhead
      // caused by fillStackTrace.
      if (cause == null) {
        cause = new NetException("cleanUpWriteBuffer error");
      }

      while (true) {
        obj = writeBuffer.poll();
        if (obj == null) {
View Full Code Here

Examples of jmt.common.exception.NetException

          //have redirecting queue behaviour turned on
          NodeSection input = innerNode.getSection(NodeSection.INPUT);
          if (input instanceof Queue) {
            ((Queue) input).redirectionTurnON(br);
          } else {
            throw new NetException("Error in creating blocking region: " + "inner station " + innerNode.getName()
                + " has a not compliant input section.");
          }

          //nodes which sends jobs outside the region must have border router behaviour
          NodeSection output = innerNode.getSection(NodeSection.OUTPUT);
          if (output instanceof Router) {
            ((Router) output).borderRouterTurnON(br);
          } else {
            throw new NetException("Error in creating blocking region: " + "inner station " + innerNode.getName()
                + " has a not compliant output section.");
          }
        }
        if (regionMeasures.size() > 0) {
          //adds measures in blocking region input station
View Full Code Here

Examples of jmt.common.exception.NetException

      //end NEW

      NetSystem.terminate();
    } else {
      throw new NetException("Simulation has not been initialized");
    }
  }
View Full Code Here

Examples of jmt.common.exception.NetException

   * @throws jmt.common.exception.NetException if network il null
   */
  public static double checkProgress(QueueNetwork network) throws jmt.common.exception.NetException {

    if (network == null) {
      throw new NetException("Can't measure progress of a network which does not exist.");
    }
    // We extimate on the slowest not completed measure
    ListIterator<Measure> measures;
    double slowest = 1;
    Measure measure;
View Full Code Here

Examples of jmt.common.exception.NetException

  }

  public static double getTempMeasures(QueueNetwork network) throws jmt.common.exception.NetException {

    if (network == null) {
      throw new NetException("Can't get measures of a network which does not exist.");
    }

    ListIterator<Measure> measures;
    int count = 0;
    Measure measure;
View Full Code Here

Examples of jmt.common.exception.NetException

        default:
          return MSG_NOT_PROCESSED;
      }
      return MSG_PROCESSED;
    } catch (IOException ex) {
      throw new NetException("Error while writing to the log file: " + ex.getMessage());
    }
  }
View Full Code Here

Examples of jmt.common.exception.NetException

      }

      return item.distribution.nextRand(item.parameter);

    } catch (NetException e) {
      throw new NetException("Error in LoadDependentStrategy: Cannot get number of jobs into current station");
    } catch (IncorrectDistributionParameterException ex) {
      throw new NetException(ex.getMessage());
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.