Ejemplo n.º 1
0
  private long[] routeQueues(Transaction tx, RouteContextList ctx) throws Exception {
    List<org.apache.activemq.artemis.core.server.Queue> durableQueues = ctx.getDurableQueues();
    List<org.apache.activemq.artemis.core.server.Queue> nonDurableQueues =
        ctx.getNonDurableQueues();
    long[] ids = new long[durableQueues.size() + nonDurableQueues.size()];
    int i = 0;

    for (org.apache.activemq.artemis.core.server.Queue q : durableQueues) {
      q.getPageSubscription().notEmpty();
      ids[i++] = q.getID();
    }

    for (org.apache.activemq.artemis.core.server.Queue q : nonDurableQueues) {
      q.getPageSubscription().getCounter().increment(tx, 1);
      q.getPageSubscription().notEmpty();
      ids[i++] = q.getID();
    }
    return ids;
  }
Ejemplo n.º 2
0
 @Override
 public String toManagementString() {
   return this.getClass().getSimpleName()
       + " [name="
       + name
       + ", queue="
       + queue.getName()
       + "/"
       + queue.getID()
       + "]";
 }
  /**
   * @param queue
   * @return
   * @throws Exception
   */
  private PageSubscriptionCounter locateCounter(Queue queue) throws Exception {
    PageSubscription subscription =
        server
            .getPagingManager()
            .getPageStore(new SimpleString("A1"))
            .getCursorProvider()
            .getSubscription(queue.getID());

    PageSubscriptionCounter counter = subscription.getCounter();
    return counter;
  }
Ejemplo n.º 4
0
  @Override
  public long getID() {
    checkStarted();

    clearIO();
    try {
      return queue.getID();
    } finally {
      blockOnIO();
    }
  }