flex.messaging.client
Class FlexClientOutboundQueueProcessor

java.lang.Object
  extended by flex.messaging.client.FlexClientOutboundQueueProcessor

public class FlexClientOutboundQueueProcessor
extends Object

The base FlexClientOutboundQueueProcessor implementation used if a custom implementation is not specified. Its behavior is very simple. It adds all new messages in order to the tail of the outbound queue and flushes all queued messages to the network as quickly as possible.


Constructor Summary
FlexClientOutboundQueueProcessor()
           
 
Method Summary
 void add(List outboundQueue, Message message)
          Always adds a new message to the tail of the queue.
 FlushResult flush(List outboundQueue)
          Always empties the queue and returns all messages to be sent to the client.
 FlushResult flush(MessageClient client, List outboundQueue)
          Removes all messages in the queue targeted to this specific MessageClient subscription(s) and returns them to be sent to the client.
 String getEndpointId()
          Returns the Id for the outbound queue's endpoint.
 FlexClient getFlexClient()
          Returns the associated FlexClient.
 void initialize(ConfigMap properties)
          No-op; this default implementation doesn't require custom initialization.
 boolean isMessageExpired(Message message)
          Utility method to test whether a message has expired or not.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FlexClientOutboundQueueProcessor

public FlexClientOutboundQueueProcessor()
Method Detail

getEndpointId

public String getEndpointId()
Returns the Id for the outbound queue's endpoint.

Returns:
The Id for the outbound queue's endpoint.

getFlexClient

public FlexClient getFlexClient()
Returns the associated FlexClient.

Returns:
The associated FlexClient.

initialize

public void initialize(ConfigMap properties)
No-op; this default implementation doesn't require custom initialization. Subclasses may override to process any custom initialization properties that have been defined in the server configuration.

Parameters:
properties - A ConfigMap containing any custom initialization properties.

add

public void add(List outboundQueue,
                Message message)
Always adds a new message to the tail of the queue.

Parameters:
outboundQueue - The queue of outbound messages.
message - The new message to add to the queue.

flush

public FlushResult flush(List outboundQueue)
Always empties the queue and returns all messages to be sent to the client.

Parameters:
outboundQueue - The queue of outbound messages.
Returns:
A FlushResult containing the messages that have been removed from the outbound queue to be written to the network and a wait time for the next flush of the outbound queue that is the default for the underlying Channel/Endpoint.

flush

public FlushResult flush(MessageClient client,
                         List outboundQueue)
Removes all messages in the queue targeted to this specific MessageClient subscription(s) and returns them to be sent to the client. Overrides should be careful to only return messages for the specified MessageClient.

Parameters:
client - The specific MessageClient to return messages for.
outboundQueue - The queue of outbound messages.
Returns:
A FlushResult containing the messages that have been removed from the outbound queue to be written to the network for this MessageClient.

isMessageExpired

public boolean isMessageExpired(Message message)
Utility method to test whether a message has expired or not. Messages with a timeToLive value that is shorter than the timespan from the message's timestamp up to the current system time will cause this method to return true. If there are expired messages in the outbound queue, flush implementations should use this helper method to only process and return messages that have not yet expired.

Parameters:
message - The message to test for expiration.
Returns:
true if the message has a timeToLive value that has expired; otherwise false.


Copyright © 2008 Adobe Systems Inc. All Rights Reserved.

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/blazeds/1/javadoc/flex/messaging/client/FlexClientOutboundQueueProcessor.html