Examples of NotificationPacket


Examples of com.akdeniz.googleplaycrawler.gsf.packets.NotificationPacket

      notificationListener.notificationReceived(notification);
        }
    }
    // XXX how to find right last stream id?
    for (int i = lastStreamID; i < lastStreamID + 5; i++) {
        session.write(new NotificationPacket(i));
    }
    synchronized (mutex) {
        lastStreamID += 5;
    }
      }
View Full Code Here

Examples of net.timewalker.ffmq3.transport.packet.NotificationPacket

    public synchronized void addNotification(IntegerID consumerId, AbstractMessage prefetchedMessage, int prefetchCapacity)
    {
        if (traceEnabled)
            log.trace("Sending notification to sessionId="+sessionId+" consumerId="+consumerId+" prefetchedMessage="+prefetchedMessage.getJMSMessageID()+" prefetchCapacity="+prefetchCapacity);

    NotificationPacket notifPacket = new NotificationPacket();
      notifPacket.setSessionId(sessionId);
        notifPacket.setConsumerId(consumerId);
        notifPacket.setMessage(prefetchedMessage);
        notifPacket.setPrefetchCapacity(prefetchCapacity);
       
        notificationBuffer.add(notifPacket);
    }
View Full Code Here

Examples of net.timewalker.ffmq3.transport.packet.NotificationPacket

        if (packet instanceof PingResponse)
          return true;
       
        if (packet instanceof NotificationPacket)
        {
            final NotificationPacket notifPacket = (NotificationPacket)packet;
            final AbstractMessage prefetchedMessage = notifPacket.getMessage();
           
            boolean acceptedByConsumer = false;
               
        AbstractSession session = lookupRegisteredSession(notifPacket.getSessionId());
            if (session != null)
            {                  
                RemoteMessageConsumer consumer = (RemoteMessageConsumer)session.lookupRegisteredConsumer(notifPacket.getConsumerId());
                if (consumer != null)   
                    acceptedByConsumer = consumer.addToPrefetchQueue(prefetchedMessage,notifPacket.getPrefetchCapacity());
                else
                  log.debug("#"+id+" No such consumer : #"+notifPacket.getSessionId()+":"+notifPacket.getConsumerId()); // Consumer was concurrently closed or not yet registered
            }
            else
              log.debug("#"+id+" No such session : #"+notifPacket.getSessionId()); // Session was concurrently closed
           
            // If the consumer was already gone, we need to rollback the prefetched message on the server side
            if (!acceptedByConsumer)
                scheduleRollback(notifPacket.getSessionId(),
                             notifPacket.getConsumerId(),
                             prefetchedMessage);
           
            return true;
        }
       
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.