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

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


      size = dis.readInt();
      iidsToReturn = new ConsumerUID[size];
      statesToReturn = new int[size];

      for (int i = 0; i < size; i++) {
    iidsToReturn[i] = new ConsumerUID(dis.readLong());
    statesToReturn[i] = dis.readInt();
      }
      dis.close();
      bis.close();
  }
View Full Code Here


            : 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;
        boolean isLastAck = false;
        TransactionAcknowledgement txAck = new TransactionAcknowledgement(mid, cid, cid);
         fileStore.storeTransactionAck(txid, txAck, false);
//        fileStore.updateInterestState(duid, mid, cid, Store.INTEREST_STATE_ACKNOWLEDGED,
View Full Code Here

            pstmt = conn.prepareStatement( selectStatesByMsgSQL );
            pstmt.setString( 1, id );
            rs = pstmt.executeQuery();
            while ( rs.next() ) {
                ConsumerUID cUID = new ConsumerUID( rs.getLong( 1 ) );
                int state = rs.getInt( 2 );
                map.put( cUID, Integer.valueOf( state ) );
            }
        } catch ( Exception e ) {
            myex = e;
View Full Code Here

            pstmt = conn.prepareStatement( selectConsumerIDsByMsgSQL );
            pstmt.setString( 1, id );
            rs = pstmt.executeQuery();
            while ( rs.next() ) {
                ConsumerUID cUID = new ConsumerUID( rs.getLong( 1 ) );
                list.add( cUID );
            }
        } catch ( Exception e ) {
            myex = e;
            try {
View Full Code Here

            pstmt = conn.prepareStatement( selectTransactionAcksSQL );
            pstmt.setLong( 1, txnUID.longValue() );
            rs = pstmt.executeQuery();

            while ( rs.next() ) {
                ConsumerUID conID = new ConsumerUID( rs.getLong( 1 ) );
                try {
                    SysMessageID msgID = SysMessageID.get( rs.getString( 2 ) );
                    data.add( new TransactionAcknowledgement( msgID, conID, conID ) );
                } catch ( Exception e ) {
                    // fail to parse one object; just log it
View Full Code Here

            pstmt = conn.prepareStatement( selectAllTransactionAcksSQL );
            rs = pstmt.executeQuery();

            while ( rs.next() ) {
                TransactionUID txnUID = new TransactionUID( rs.getLong( 1 ) );
                ConsumerUID conID = new ConsumerUID( rs.getLong( 2 ) );
                try {
                    SysMessageID msgID = SysMessageID.get( rs.getString( 3 ) );

                    List ackList = (List)data.get( txnUID );
                    if ( ackList == null ) {
View Full Code Here

    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

      } else {
        DestinationUID destUID = packRef.getDestination()
            .getDestinationUID();
        if (consumers != null) {
          for (int i = 0; i < consumers.size(); i++) {
            ConsumerUID cid = consumers.get(i);
            ConsumerUID storedcid = (ConsumerUID) cuidToStored
                .get(cid);
            if (storedcid == null) {
              if (ToTxnLogConverter.DEBUG) {
                String msg = getPrefix()
                    + " storedcid=null for " + cid;
View Full Code Here

         * Set this up as an AsyncListener
         */
        public void setAsyncListener(com.sun.messaging.jmq.jmsserver.core.Consumer brokerC,
                    Consumer target)
        {
            ConsumerUID cuid;

      /*
       * Target passed in may be null
       * This is to indicate that the consumer has unregistered itself as an async
       * consumer - may go into sync mode.
View Full Code Here

                if (session.isBusy() && !stopped) {
                       // cool, we have something to do
                       Packet p = new Packet();

                       // retrieve the next packet and its ConsumerUID
                       ConsumerUID uid = session.fillNextPacket(p);

                       if (uid == null) {
                           // weird, something went wrong, try again
                           continue;
                       }

                       // Get the consumer object
                       Consumer con = (Consumer)consumers.get(uid);
                       try {
         JMSAck ack = null;

                           // call the deliver method
                           ack = con.deliver(p);

         if (ack != null)  {
             long transactionId = ack.getTransactionId(),
             consumerId = ack.getConsumerId();
             SysMessageID sysMsgId = ack.getSysMessageID();
                         TransactionUID txnUID = null;
                         ConsumerUID conUID = null;

                   if (transactionId != 0)  {
                             txnUID = new TransactionUID(transactionId);
                   }

                   if (consumerId != 0)  {
                             conUID = new ConsumerUID(consumerId);
                   }

                               IMQConnection cxn = parent.checkConnectionId(ack.getConnectionId(), "Listener Thread");

                               SysMessageID ids[] = new SysMessageID[1];
                               //ids[0] = sysMsgId;
                               //ids[0] = ((Packet)p).getSysMessageID();
                               ids[0] = sysMsgId;
                               ConsumerUID cids[] = new ConsumerUID[1];
                               cids[0] = conUID;
                               Globals.getProtocol().acknowledge(cxn, txnUID, false, AckHandler.ACKNOWLEDGE_REQUEST, null, null, 0, ids, cids);
         }
                       } catch (Exception ex) {
                           // I have no idea what the exception might mean so just
View Full Code Here

TOP

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

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.