Package flex.messaging

Examples of flex.messaging.MessageRoutedNotifier


    }
   
    // add event listener and route the message to the queue
    public void add(List outboundQueue, Message message)
    {
        MessageRoutedNotifier notifier = FlexContext.getMessageRoutedNotifier();
       
        if(notifier != null)
        {
            notifier.addMessageRoutedListener(this);
            System.out.println("======== MessageRoutedListener added");
            message.setBody("The original message has been removed");
        }
       
        super.add(outboundQueue, message);      
View Full Code Here


        if (subscriberIds != null)
        {
            try
            {
                // Place notifier in thread-local scope.
                MessageRoutedNotifier routingNotifier = new MessageRoutedNotifier(message);
                FlexContext.setMessageRoutedNotifier(routingNotifier);

                // Throttle outgoing at the destination level
                ThrottleResult throttleResult = destination.getThrottleManager().throttleOutgoingMessage(message, null);
                int throttleResultCode = throttleResult.getResultCode();
                MessageException me = throttleResult.getException();
                if (throttleResultCode == ThrottleResult.RESULT_ERROR)
                {
                    throw me;
                }
                else if (throttleResultCode == ThrottleResult.RESULT_IGNORE)
                {
                    if (Log.isDebug())
                        Log.getLogger(LOG_CATEGORY).debug(me.getMessage(), me);
                }
                else
                {
                    SubscriptionManager subscriptionManager = destination.getSubscriptionManager();

                    for (Iterator clientIter = subscriberIds.iterator(); clientIter.hasNext();)
                    {
                        Object clientId = clientIter.next();
                        MessageClient client = (MessageClient)subscriptionManager.getSubscriber(clientId);

                        // Skip if the client is null or invalidated.
                        if (client == null || !client.isValid())
                        {
                            if (Log.isDebug())
                                Log.getLogger(MessageService.LOG_CATEGORY).debug("Warning: could not find MessageClient for clientId in pushMessageToClients: " + clientId + " for destination: " + destination.getId());

                            continue;
                        }

                        pushMessageToClient(client, destination, message, evalSelector, throttleResult);
                    }
                }

                // Done with the push, notify any listeners.
                routingNotifier.notifyMessageRouted();
            }
            finally
            {
                // Unset the notifier for this message.
                FlexContext.setMessageRoutedNotifier(null);
View Full Code Here

TOP

Related Classes of flex.messaging.MessageRoutedNotifier

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.