Package com.sun.messaging.jmq.jmsserver.core

Examples of com.sun.messaging.jmq.jmsserver.core.Consumer


  return (false);

    }

    public static ConnectionUID getConnectionUID(ConsumerUID cid)  {
  Consumer con = Consumer.getConsumer(cid);
  ConnectionUID cxnId = null;

  if (isDurable(cid))  {
      if (!isDurableActive(cid))  {
    /*
     * Return null if this is an inactive durable
     */
    return (null);
      }
  }

  /*
  if (con instanceof Subscription)  {
      List l = ((Subscription)con).getChildConsumers();
      Consumer c = (Consumer)l.get(0);
      System.err.println("Consumer from child list: " + c);

      cid = c.getConnectionUID();
  } else  {
      cid = con.getConnectionUID();
  }
  */

  if (con != null)  {
      cxnId = con.getConnectionUID();
  }

  return (cxnId);
    }
View Full Code Here


        return (new Boolean(isDurableActive(cid)));
    }

    private static String getDurableName(ConsumerUID cid)  {
  Consumer con;
  Subscription sub;

  if (!getDurable(cid).booleanValue())  {
      return (null);
  }

  con = Consumer.getConsumer(cid);
  if (con == null)  {
      return (null);
  }

  if (con instanceof Subscription)  {
            return (((Subscription)con).getDurableName());
  } else  {
      sub = con.getSubscription();

      if (sub != null)  {
                return (sub.getDurableName());
      } else  {
                return (null);
View Full Code Here

      }
  }
    }

    private static Boolean getFlowPaused(ConsumerUID cid)  {
  Consumer con = Consumer.getConsumer(cid);

  if (con == null)  {
      return (null);
  }

        return (new Boolean(con.getIsFlowPaused()));
    }
View Full Code Here

  return (host);
    }

    private static Long getLastAckTime(ConsumerUID cid)  {
  Consumer con = Consumer.getConsumer(cid);

  if (con == null)  {
      return (null);
  }

  return (new Long(con.getLastAckTime()));
    }
View Full Code Here

  return (new Long(con.getLastAckTime()));
    }

    private static Long getNumMsgs(ConsumerUID cid)  {
  Consumer con = Consumer.getConsumer(cid);

  if (con == null)  {
      return (null);
  }

        return (new Long(con.totalMsgsDelivered()));
    }
View Full Code Here

        return (new Long(con.totalMsgsDelivered()));
    }

    private static Long getNumMsgsPendingAcks(ConsumerUID cid)  {
  Consumer con = Consumer.getConsumer(cid);

  if (con == null)  {
      return (null);
  }

        return (new Long(con.numPendingAcks()));
    }
View Full Code Here

        return (new Long(con.numPendingAcks()));
    }

    private static String getSelector(ConsumerUID cid)  {
  Consumer con = Consumer.getConsumer(cid);

  if (con == null)  {
      return (null);
  }

        return (con.getSelectorStr());
    }
View Full Code Here

            try {
                int i = 0;
                Iterator itr = consumers.iterator();
                while (itr.hasNext()) {
                    i++;
                    Consumer c = (Consumer) itr.next();
                    gp.putProp(String.valueOf(c.getConsumerUID().longValue())+":"
                                              +Consumer.PREFETCH,
                               new Integer(c.getPrefetch()));
                    writeConsumer(c, dos);
                    if (!(c instanceof Subscription)) {
                        continue;
                    }
                    ChangeRecordInfo cri =
                        ((Subscription)c).getCurrentChangeRecordInfo(
                                          ProtocolGlobals.G_NEW_INTEREST);
                    if (cri == null) {
                        continue;
                    }
                    gp.putProp("shareccSeq"+i, cri.getSeq());
                    gp.putProp("shareccUUID"+i, cri.getUUID());
                    gp.putProp("shareccResetUUID"+i, cri.getResetUUID());
                }
                dos.flush();
                bos.flush();
            }
            catch (IOException e) { /* Ignore */ }

            gp.setPayload(ByteBuffer.wrap(bos.toByteArray()));
            break;

            case ProtocolGlobals.G_INTEREST_UPDATE:

            gp.putProp("T", new Integer(subtype));
            try {
                Iterator itr = consumers.iterator();
                while (itr.hasNext()) {
                    Consumer c = (Consumer)itr.next();
                    writeConsumerUID(c.getConsumerUID(), dos);
                }
                dos.flush();
                bos.flush();
            }
            catch (IOException e) { /* Ignore */ }
View Full Code Here

                              clientID, selstr, dest, noLocalDelivery, id );
                    if (sub != null)
                        sub.setMaxNumActiveConsumers(sharedcnt);
                    return sub;
                } else {
                    Consumer c = Consumer.newConsumer(dest, selstr, noLocalDelivery, id);
                    c.setLockPosition(position);
                    return c;
                }
            }
         } catch (SelectorFormatException ex) {
             logger.log(Logger.INFO,"Internal Error: Got bad selector["+selstr + "] " , ex);
View Full Code Here

    /**
     * Caller must catch RuntimeException and getCause
     */
    public Object next() throws RuntimeException {
        try {
        Consumer c =  ClusterConsumerInfo.readConsumer(dis);
        Integer prefetch = (Integer)gp.getProp(String.valueOf(
                                               c.getConsumerUID().longValue())+
                                                          ":"+Consumer.PREFETCH);
        if (prefetch != null) c.setRemotePrefetch(prefetch.intValue());
        if (from != null) c.getConsumerUID().setBrokerAddress(from);
        count_read++;
        return c;
        } catch (IOException e) {
        Throwable ex = e.getCause();
        if (ex instanceof ConsumerAlreadyAddedException) {
View Full Code Here

TOP

Related Classes of com.sun.messaging.jmq.jmsserver.core.Consumer

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.