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

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


        throws IOException, BrokerException {

        int ackCount = dis.readInt(); // Number of acks
        for (int i = 0; i < ackCount; i++) {
            String name = dis.readUTF(); // Destination ID
            DestinationUID did = new DestinationUID(name);
            SysMessageID mid = new SysMessageID();
            mid.readID(dis); // SysMessageID
            ConsumerUID iid = new ConsumerUID(dis.readLong()); // ConsumerUID

            // Make sure dst exists; autocreate if possible
            Destination dst = Destination.getDestination(
                did.getName(),
                did.isQueue() ? DestType.DEST_TYPE_QUEUE
                : DestType.DEST_TYPE_TOPIC, true, true);

            // Load all msgs inorder to update consumer states
            if (!dstLoadedSet.contains(dst)) {
                dst.load();
View Full Code Here


    ByteArrayInputStream bais = new ByteArrayInputStream(data);
    DataInputStream dis = new DataInputStream(bais);

    dis.skip(2);
    String dest = dis.readUTF();
    destUID = new DestinationUID(dest);
    sysMessageID = new SysMessageID();
    sysMessageID.readID(dis);
 
    dis.close();
    bais.close();
View Full Code Here

        String dname = pkt.getDestination();
        int dtype = (pkt.getIsQueue() ? DestType.DEST_TYPE_QUEUE : DestType.DEST_TYPE_TOPIC);

        List dlist = Destination.findMatchingIDs(DestinationUID.getUID(dname, dtype));

        DestinationUID did = null;
        Iterator itr = dlist.iterator();
        while (itr.hasNext()) {
           
        did = (DestinationUID)itr.next();
    Destination dst = Destination.getDestination(did, dtype, true, true);
View Full Code Here

  private void replayAcknowledgedMessage(
      TransactionWorkMessageAck messageAck, Set dstLoadedSet)
      throws IOException, BrokerException {

 
    DestinationUID did = messageAck.getDestUID();
    SysMessageID mid = messageAck.getSysMessageID();
    ConsumerUID iid = messageAck.getConsumerID();
    if (Store.getDEBUG()) {
      String msg = getPrefix() + " replaying acknowledged message "
          + messageAck;
      logger.log(Logger.INFO, msg);
    }
    // Make sure dst exists; autocreate if possible
    Destination dst = Destination.getDestination(did.getName(), did
        .isQueue() ? DestType.DEST_TYPE_QUEUE
        : DestType.DEST_TYPE_TOPIC, true, true);

    // Load all msgs inorder to update consumer states
    if (!dstLoadedSet.contains(dst)) {
View Full Code Here

 
 

  public void replayMessageRemoval(MsgRemovalEvent event,
      Set dstLoadedSet) throws IOException, BrokerException {
    DestinationUID did = event.destUID;
    SysMessageID mid = event.sysMessageID;
   
    // Make sure dst exists; autocreate if possible
    Destination dst = Destination.getDestination(did.getName(), did
        .isQueue() ? DestType.DEST_TYPE_QUEUE
        : DestType.DEST_TYPE_TOPIC, true, true);

    // Load all msgs inorder to update consumer states
    if (!dstLoadedSet.contains(dst)) {
View Full Code Here

      String msg = getPrefix() + " replayRemoteAcks ";
      logger.log(Logger.INFO, msg);
    }
    for (int i = 0; i < txnAcks.length; i++) {
      TransactionAcknowledgement txnAck = txnAcks[i];
      DestinationUID destId = destIds[i];
      SysMessageID mid = txnAck.getSysMessageID();
      ConsumerUID iid = txnAck.getStoredConsumerUID();
     
      //Destination dest = Destination.getDestination(destId);
      // make sure it is loaded
     
      int type = (destId.isQueue() ? DestType.DEST_TYPE_QUEUE
          : DestType.DEST_TYPE_TOPIC);
      Destination dest = Destination.getDestination(destId.getName(),
          type, true, true);
      dest.load();

      PacketReference pr = dest.getMessage(mid);
      if (pr == null) {
View Full Code Here

      while (sentIter.hasNext()) {
        TransactionWorkMessage msg = sentIter.next();
        if (DEBUG) {
          logger.log(Logger.DEBUG, getPrefix() + " convert sent msg "+msg);
        }
        DestinationUID duid = msg.getDestUID();
        int type = (duid.isQueue() ? DestType.DEST_TYPE_QUEUE
            : DestType.DEST_TYPE_TOPIC);

        // make sure destination exists
        // ( it may have been removed on load if it just contained
        // messages in a transaction)
        Destination dest = Destination.getDestination(duid.getName(),
            type, true, true);

        Packet message = msg.getMessage();
        ConsumerUID[] iids = msg.getStoredInterests();
        //if (iids != null)
        if(false){
          int[] states = new int[iids.length];
          for (int i = 0; i < iids.length; i++) {
            states[i] = 0;
          }

          fileStore.storeMessage(duid, message, iids, states, true);
        } else {
          fileStore.storeMessage(duid, message, true);
        }
      }

      List<TransactionWorkMessageAck> consumedMsgs = work
          .getMessageAcknowledgments();
      Iterator<TransactionWorkMessageAck> consumedIter = consumedMsgs
          .iterator();
      while (consumedIter.hasNext()) {
        TransactionWorkMessageAck msgAck = consumedIter.next();
        if (DEBUG) {
          logger.log(Logger.DEBUG, getPrefix() + " convert consumed msg "+msgAck);
        }
        DestinationUID duid = msgAck.getDestUID();
        int type = (duid.isQueue() ? DestType.DEST_TYPE_QUEUE
            : DestType.DEST_TYPE_TOPIC);
        Destination dest = Destination.getDestination(duid.getName(),
            type, true, true);
        dest.load();
        SysMessageID mid = msgAck.getSysMessageID();
        ConsumerUID cid = msgAck.getConsumerID();
        boolean sync = true;
View Full Code Here

    while (oldmsgstore.hasMoreMessages()) {
        Packet msg = oldmsgstore.nextMessage();
        ConsumerUID[] iids = oldmsgstore.nextCUIDs();
        int[] states = oldmsgstore.nextStates();

        DestinationUID dst = DestinationUID.getUID(
            msg.getDestination(),
            msg.getIsQueue());
        this.storeMessage(dst, msg, iids, states, false);

        if (deleteold) {
View Full Code Here

  }
 
  public void readWork(DataInputStream dis) throws IOException,
      BrokerException {
    String dest = dis.readUTF();
    destUID = new DestinationUID(dest);
    sysMessageID = new SysMessageID();
    sysMessageID.readID(dis);
    long cid = dis.readLong();
    consumerID = new ConsumerUID(cid);
  }
View Full Code Here

            + " convertLocalToTxnLogFormat: can not find packet for sent msg "
            + mid + " in txn " + txnInfo;
        logger.log(Logger.WARNING, msg);
      } else {

        DestinationUID destUID = packRef.getDestination()
            .getDestinationUID();
        ConsumerUID[] interests = store.getConsumerUIDs(destUID, mid);
        TransactionWorkMessage twm = new TransactionWorkMessage();
        twm.setStoredInterests(interests);
        twm.setPacketReference(packRef);
View Full Code Here

TOP

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

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.