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

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


  consumers = (new HashSet(ConsumerUtil.getAllConsumersNoChildren().values())).iterator();

  int i = 0;
  while (consumers.hasNext()) {
      Consumer oneCon = (Consumer)consumers.next();
      long conID = oneCon.getConsumerUID().longValue();
      String id;

      try  {
          id = Long.toString(conID);
View Full Code Here


       * XXX - should  send specific 'cannot parse consumerID' exception
       */
            handleOperationException(ConsumerOperations.PURGE, e);
  }

  Consumer con = Consumer.getConsumer(cid);

        if (!con.isDurableSubscriber())  {
      logger.log(Logger.INFO,
    "Purge not supported for non durable subscribers.");
      return;
  }

View Full Code Here

        short type = pkt.getType();
        assert ( type ==  ProtocolGlobals.G_DURABLE_ATTACH );
       
        ByteArrayInputStream bis = new ByteArrayInputStream(pkt.getPayload().array());
        DataInputStream dis = new DataInputStream(bis);
        Consumer cs = ClusterConsumerInfo.readConsumer(dis);
        Integer prefetch = (Integer)pkt.getProp(String.valueOf(
                                                cs.getConsumerUID().longValue())+
                                                ":"+Consumer.PREFETCH);
        if (prefetch != null) cs.setRemotePrefetch(prefetch.intValue());
        BrokerAddress from = c.unmarshalBrokerAddress(pkt);
        if (from != null) cs.getConsumerUID().setBrokerAddress(from);
    return cs;
    }
View Full Code Here

  Iterator it = Consumer.getAllConsumers();
  HashMap<ConsumerUID,Consumer> consumersNoChildren
        = new HashMap<ConsumerUID,Consumer>();

  while (it.hasNext()) {
      Consumer oneCon = (Consumer)it.next();
      ConsumerUID cid = oneCon.getConsumerUID();

      if (oneCon.getSubscription() == null)  {
                consumersNoChildren.put(cid, oneCon);
      }
  }

        return (consumersNoChildren);
View Full Code Here

    public static int getNumConsumersNoChildren() {
        return (getAllConsumersNoChildren().size());
    }

    public static boolean isDurable(ConsumerUID cid)  {
  Consumer con = Consumer.getConsumer(cid);

  if (con != null)  {
      return (con.isDurableSubscriber());
  }

  return (false);
    }
View Full Code Here

  return (false);
    }

    public static boolean isWildcard(ConsumerUID cid)  {
  Consumer con = Consumer.getConsumer(cid);

  if (con != null)  {
      return (con.isWildcard());
  }

  return (false);
    }
View Full Code Here

  return (false);
    }

    public static String getNextMessageID(ConsumerUID cid) {
  Consumer con = Consumer.getConsumer(cid);

  if (con != null)  {
      PacketReference r =  con.peekNext();
        if (r != null)
                return r.getSysMessageID().toString();
  }
    return "";
    }
View Full Code Here

    public static boolean isDurableActive(ConsumerUID cid)  {
  if (!isDurable(cid))  {
      return (false);
  }

  Consumer con = Consumer.getConsumer(cid);

  if (con != null)  {
      return (con.isActive());
  }

  return (false);

    }
View Full Code Here

  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 (cxnId);
    }

    public static Destination getDestination(ConsumerUID cid)  {
        Consumer con = Consumer.getConsumer(cid);
        Destination d = null;

  if (con != null)  {
            d = con.getFirstDestination();
  }

  return (d);
    }
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.