/** * This method is not invoked across a cluster, it is always locally invoked. * The passed message will be pushed to the subscribers in the passed set, conditionally depending * upon the execution of their selector expressions. * * @param subscriberIds The set of subscribers to push the message to. * * @param message The <code>Message</code> to push. * * @param evalSelector <code>true</code> to evaluate each subscriber's selector before pushing * the message to them; <code>false</code> to skip selector evaluation. */ public void pushMessageToClients(Set subscriberIds, Message message, boolean evalSelector) { MessageDestination destination = (MessageDestination)getDestination(message); pushMessageToClients(destination, subscriberIds, message, evalSelector); }
/** * This method is not invoked across a cluster, it is always locally invoked. * The passed message will be pushed to the subscribers in the passed set, conditionally depending * upon the execution of their selector expressions. * * @param subscriberIds The set of subscribers to push the message to. * * @param message The <code>Message</code> to push. * * @param evalSelector <code>true</code> to evaluate each subscriber's selector before pushing * the message to them; <code>false</code> to skip selector evaluation. */ public void pushMessageToClients(Set subscriberIds, Message message, boolean evalSelector) { MessageDestination destination = (MessageDestination)getDestination(message); pushMessageToClients(destination, subscriberIds, message, evalSelector); }
/** * This method is not invoked across a cluster, it is always locally invoked. * The passed message will be pushed to the subscribers in the passed set, conditionally depending * upon the execution of their selector expressions. * * @param subscriberIds The set of subscribers to push the message to. * * @param message The <code>Message</code> to push. * * @param evalSelector <code>true</code> to evaluate each subscriber's selector before pushing * the message to them; <code>false</code> to skip selector evaluation. */ public void pushMessageToClients(Set subscriberIds, Message message, boolean evalSelector) { MessageDestination destination = (MessageDestination)getDestination(message); pushMessageToClients(destination, subscriberIds, message, evalSelector); }
/** * Handle a data message intended for this adapter. */ public Object invoke(Message message) { MessageService msgService = (MessageService)getDestination().getService(); msgService.pushMessageToClients(message, true); msgService.sendPushMessageFromPeer(message, true); return null; }
/** * Handle a data message intended for this adapter. */ public Object invoke(Message message) { MessageDestination destination = (MessageDestination)getDestination(); MessageService msgService = (MessageService)destination.getService(); SubscriptionManager subscriptionManager = destination.getSubscriptionManager(); Set subscriberIds = subscriptionManager.getSubscriberIds(message, true /*evalSelector*/); if (subscriberIds != null && !subscriberIds.isEmpty()) { /* We have already filtered based on the selector and so pass false below */ msgService.pushMessageToClients(destination, subscriberIds, message, false); } msgService.sendPushMessageFromPeer(message, destination, true); return null; }
/** * Pushes a message to all clients that are subscribed to the destination targeted by this message. * * @param message The <code>Message</code> to push to the destination's subscribers. * * @param evalSelector <code>true</code> to evaluate each subscriber's selector before pushing * the message to them; <code>false</code> to skip selector evaluation. */ public void pushMessageToClients(Message message, boolean evalSelector) { MessageDestination destination = (MessageDestination)getDestination(message); SubscriptionManager subscriptionManager = destination.getSubscriptionManager(); Set subscriberIds = subscriptionManager.getSubscriberIds(message, evalSelector); if (debug) Log.getLogger(LOG_CATEGORY).debug("Sending message: " + message + StringUtils.NEWLINE + " to subscribed clientIds: " + subscriberIds); if ((subscriberIds != null) && !subscriberIds.isEmpty()) { /* We have already filtered based on the selector and so pass false below */ pushMessageToClients(destination, subscriberIds, message, false); } }
/** * Handle a data message intended for this adapter. */ public Object invoke(Message message) { MessageDestination destination = (MessageDestination)getDestination(); MessageService msgService = (MessageService)destination.getService(); SubscriptionManager subscriptionManager = destination.getSubscriptionManager(); Set subscriberIds = subscriptionManager.getSubscriberIds(message, true /*evalSelector*/); if (subscriberIds != null && !subscriberIds.isEmpty()) { /* We have already filtered based on the selector and so pass false below */ msgService.pushMessageToClients(destination, subscriberIds, message, false); } msgService.sendPushMessageFromPeer(message, destination, true); return null; }
pushMessageToClients(message, false); sendPushMessageFromPeer(message, false); pushMessageToClients(subscriberIds, message, false);
/** * Pushes a message to all clients that are subscribed to the destination targeted by this message. * * @param message The <code>Message</code> to push to the destination's subscribers. * * @param evalSelector <code>true</code> to evaluate each subscriber's selector before pushing * the message to them; <code>false</code> to skip selector evaluation. */ public void pushMessageToClients(Message message, boolean evalSelector) { MessageDestination destination = (MessageDestination)getDestination(message); SubscriptionManager subscriptionManager = destination.getSubscriptionManager(); Set subscriberIds = subscriptionManager.getSubscriberIds(message, evalSelector); if (debug) Log.getLogger(LOG_CATEGORY).debug("Sending message: " + message + StringUtils.NEWLINE + " to subscribed clientIds: " + subscriberIds); if ((subscriberIds != null) && !subscriberIds.isEmpty()) { /* We have already filtered based on the selector and so pass false below */ pushMessageToClients(destination, subscriberIds, message, false); } }
pushMessageToClients(message, false); sendPushMessageFromPeer(message, false); pushMessageToClients(subscriberIds, message, false);
/** * Pushes the supplied message and then invalidates the MessageClient. * * @param message The message to push to the client before invalidating. * When message is null, MessageClient is invalidated silently. */ public void invalidate(Message message) { if (message != null) { message.setDestination(destination.getId()); message.setClientId(clientId); Set subscriberIds = new TreeSet(); subscriberIds.add(clientId); try { ((MessageService)destination.getService()).pushMessageToClients(destination, subscriberIds, message, false /* don't eval selector */); } catch (MessageException ignore) {} invalidate(true /* attempt to notify remote client */); } else { invalidate(); } }
/** * Pushes the supplied message and then invalidates the MessageClient. * * @param message The message to push to the client before invalidating. * When message is null, MessageClient is invalidated silently. */ public void invalidate(Message message) { if (message != null) { message.setDestination(destination.getId()); message.setClientId(clientId); Set subscriberIds = new TreeSet(); subscriberIds.add(clientId); try { if (destination instanceof MessageDestination) { MessageDestination msgDestination = (MessageDestination)destination; ((MessageService)msgDestination.getService()).pushMessageToClients(msgDestination, subscriberIds, message, false /* don't eval selector */); } } catch (MessageException ignore) {} invalidate(true /* attempt to notify remote client */); } else { invalidate(); } }
/** * Pushes the supplied message and then invalidates the MessageClient. * * @param message The message to push to the client before invalidating. * When message is null, MessageClient is invalidated silently. */ public void invalidate(Message message) { if (message != null) { message.setDestination(destination.getId()); message.setClientId(clientId); Set subscriberIds = new TreeSet(); subscriberIds.add(clientId); try { if (destination instanceof MessageDestination) { MessageDestination msgDestination = (MessageDestination)destination; ((MessageService)msgDestination.getService()).pushMessageToClients(msgDestination, subscriberIds, message, false /* don't eval selector */); } } catch (MessageException ignore) {} invalidate(true /* attempt to notify remote client */); } else { invalidate(); } }
pushMessageToClients(message, false); sendPushMessageFromPeer(message, false); pushMessageToClients(subscriberIds, message, false);
/** * Pushes a message to all clients that are subscribed to the destination targeted by this message. * * @param message The <code>Message</code> to push to the destination's subscribers. * * @param evalSelector <code>true</code> to evaluate each subscriber's selector before pushing * the message to them; <code>false</code> to skip selector evaluation. */ public void pushMessageToClients(Message message, boolean evalSelector) { MessageDestination destination = (MessageDestination)getDestination(message); SubscriptionManager subscriptionManager = destination.getSubscriptionManager(); Set subscriberIds = subscriptionManager.getSubscriberIds(message, evalSelector); if (Log.isDebug()) Log.getLogger(LOG_CATEGORY).debug("Sending message: " + message + StringUtils.NEWLINE + " to subscribed clientIds: " + subscriberIds); if ((subscriberIds != null) && !subscriberIds.isEmpty()) { /* We have already filtered based on the selector and so pass false below */ pushMessageToClients(destination, subscriberIds, message, false); } }
/** * Invoked when a Message is received from a JMS client. */ void handleMessage(Message flexMessage) { flexMessage.setDestination(this.getDestination().getId()); MessageService messageService = (MessageService) getDestination().getService(); messageService.pushMessageToClients(flexMessage, true); messageService.sendPushMessageFromPeer(flexMessage, true); }
/** * @exclude * This method is provided for a cluster peer broadcast, it is not intended to be * invoked locally. */ public void pushMessageFromPeer(AsyncMessage message, Boolean evalSelector) { if (!isStarted()) { Log.getLogger(LOG_CATEGORY).debug("Received message from peer server before server is started - ignoring: " + message + " evalSelector: " + evalSelector); return; } if (Log.isDebug()) Log.getLogger(LOG_CATEGORY).debug("Received message from peer server: " + message + " evalSelector: " + evalSelector); // Update the FlexContext for this thread to indicate we're processing a message from // a server peer. FlexContext.setMessageFromPeer(true); // we are not confirming that replication is enabled again here, so if the remote // peer has replication enabled and therefore broadcast to this peer, then this peer // will complete the operation even if it locally does not have replication enabled pushMessageToClients(message, evalSelector.booleanValue()); // And unset. FlexContext.setMessageFromPeer(false); }
messageService.pushMessageToClients(subscribers, flexMessage, true); } else { messageService.pushMessageToClients(flexMessage, true);
/** * * This method is provided for a cluster peer broadcast, it is not intended to be * invoked locally. */ public void pushMessageFromPeer(AsyncMessage message, Boolean evalSelector) { if (!isStarted()) { Log.getLogger(LOG_CATEGORY).debug("Received message from peer server before server is started - ignoring: " + message + " evalSelector: " + evalSelector); return; } if (debug) Log.getLogger(LOG_CATEGORY).debug("Received message from peer server: " + message + " evalSelector: " + evalSelector); // Update the FlexContext for this thread to indicate we're processing a message from // a server peer. FlexContext.setMessageFromPeer(true); // we are not confirming that replication is enabled again here, so if the remote // peer has replication enabled and therefore broadcast to this peer, then this peer // will complete the operation even if it locally does not have replication enabled pushMessageToClients(message, evalSelector); // And unset. FlexContext.setMessageFromPeer(false); }
/** * * This method is provided for a cluster peer broadcast, it is not intended to be * invoked locally. */ public void pushMessageFromPeer(AsyncMessage message, Boolean evalSelector) { if (!isStarted()) { Log.getLogger(LOG_CATEGORY).debug("Received message from peer server before server is started - ignoring: " + message + " evalSelector: " + evalSelector); return; } if (debug) Log.getLogger(LOG_CATEGORY).debug("Received message from peer server: " + message + " evalSelector: " + evalSelector); // Update the FlexContext for this thread to indicate we're processing a message from // a server peer. FlexContext.setMessageFromPeer(true); // we are not confirming that replication is enabled again here, so if the remote // peer has replication enabled and therefore broadcast to this peer, then this peer // will complete the operation even if it locally does not have replication enabled pushMessageToClients(message, evalSelector); // And unset. FlexContext.setMessageFromPeer(false); }