|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectflex.management.ManageableComponent
flex.messaging.services.AbstractService
flex.messaging.services.MessageService
public class MessageService
The MessageService class is the Service implementation that manages point-to-point and publish-subscribe messaging.
| Field Summary | |
|---|---|
static String |
LOG_CATEGORY
Log category for MessageService. |
static String |
TIMING_LOG_CATEGORY
Log category for MessageService that captures message timing. |
| Fields inherited from class flex.messaging.services.AbstractService |
|---|
LOG_CATEGORY_STARTUP_DESTINATION |
| Fields inherited from interface flex.messaging.services.messaging.MessagingConstants |
|---|
ALLOW_SUBTOPICS_ELEMENT, BATCH_WRITE_SIZE_ELEMENT, CLUSTER_MESSAGE_ROUTING, DEFAULT_DURABLE_STORE, DEFAULT_MAX_CACHE_SIZE, DEFAULT_SUBTOPIC_SEPARATOR, DURABLE_STORE_TYPE_ELEMENT, IS_DURABLE_ELEMENT, MAX_CACHE_SIZE_ELEMENT, SUBTOPIC_SEPARATOR_ELEMENT, TIME_TO_LIVE_ELEMENT |
| Constructor Summary | |
|---|---|
MessageService()
Constructs an unmanaged MessageService. |
|
MessageService(boolean enableManagement)
Constructs an MessageService with the indicated management. |
|
| Method Summary | |
|---|---|
void |
addDestination(Destination destination)
Casts the Destination into MessageDestination
and calls super.addDestination |
Destination |
createDestination(String id)
Creates a MessageDestination instance, sets its id, sets it manageable
if the AbstractService that created it is manageable,
and sets its Service to the AbstractService that
created it. |
Set |
getSubscriberIds(Message message,
boolean evalSelector)
Returns a Set of clientIds of the clients subscribed to receive this message. |
void |
initRemoteSubscriptions(String destinationId)
Issue messages to request the remote subscription table from each server in the cluster (except this one). |
void |
pushMessageToClients(Message message,
boolean evalSelector)
Pushes a message to all clients that are subscribed to the destination targeted by this message. |
void |
pushMessageToClients(Set subscriberIds,
Message message,
boolean evalSelector)
This method is not invoked across a cluster, it is always locally invoked. |
void |
sendPushMessageFromPeer(Message message,
boolean evalSelector)
This method sends the passed message to clients connected to other server peer nodes in the cluster. |
Object |
serviceMessage(Message message)
Processes messages by invoking the requested destination's adapter. |
void |
serviceMessageFromAdapter(Message message,
boolean sendToAllSubscribers)
This method is called from a messaging adapter to handle the delivery of messages to one or more clients. |
void |
start()
Starts the service if its associated MessageBroker is started. |
void |
subscribeFromPeer(String destinationId,
Boolean subscribe,
String selector,
String subtopic,
Object remoteAddress)
This is called remotely from other cluster members when a new remote subscription is identified. |
| Methods inherited from class flex.messaging.services.AbstractService |
|---|
addDefaultChannel, describeService, getDefaultAdapter, getDefaultChannels, getDestination, getDestination, getDestinations, getMessageBroker, getRegisteredAdapters, registerAdapter, removeDefaultChannel, removeDestination, serviceCommand, setDefaultAdapter, setDefaultChannels, setId, setMessageBroker, stop, unregisterAdapter |
| Methods inherited from class flex.management.ManageableComponent |
|---|
getControl, getId, getParent, initialize, isManaged, isStarted, isValid, setControl, setManaged, setParent |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface flex.messaging.services.Service |
|---|
getId |
| Methods inherited from interface flex.management.Manageable |
|---|
getControl, isManaged, setControl, setManaged |
| Methods inherited from interface flex.messaging.FlexComponent |
|---|
isStarted |
| Methods inherited from interface flex.messaging.FlexConfigurable |
|---|
initialize |
| Field Detail |
|---|
public static final String LOG_CATEGORY
MessageService.
public static final String TIMING_LOG_CATEGORY
MessageService that captures message timing.
| Constructor Detail |
|---|
public MessageService()
MessageService.
public MessageService(boolean enableManagement)
MessageService with the indicated management.
enableManagement - true if the MessageService
is manageable; otherwise false.| Method Detail |
|---|
public void start()
AbstractServiceMessageBroker is started.
and if the service is not already running. The default implementation of
this method starts all of the destinations of the service.
If subclasses override, they must call super.start().
start in interface FlexComponentstart in class AbstractServicepublic Destination createDestination(String id)
MessageDestination instance, sets its id, sets it manageable
if the AbstractService that created it is manageable,
and sets its Service to the AbstractService that
created it.
createDestination in interface ServicecreateDestination in class AbstractServiceid - The id of the MessageDestination.
Destination instanced created.public void addDestination(Destination destination)
Destination into MessageDestination
and calls super.addDestination
addDestination in interface ServiceaddDestination in class AbstractServicedestination - The Destination instance to be added.public Object serviceMessage(Message message)
AbstractService
serviceMessage in interface ServiceserviceMessage in class AbstractServicemessage - The message sent by the MessageBroker
public void serviceMessageFromAdapter(Message message,
boolean sendToAllSubscribers)
sendToAllSubscribers parameter as true, the message is
routed to all clients who are subscribed to receive messages
from this destination. When you use this method, the selector expressions
for all subscribing clients are not evaluated. If you want the selector
expressions to be evaluated, use a combination of the pushMessageToClients
method and the sendPushMessageFromPeer methods.
message - The Message to send.sendToAllSubscribers - If true, send this message to all clients
subscribed to the destination of this message. If false, send the message
only to the clientId specified in the message.
public void sendPushMessageFromPeer(Message message,
boolean evalSelector)
message - The Message to push to peer server nodes in the cluster.evalSelector - true to evaluate each remote subscriber's selector before pushing
the message to them; false to skip selector evaluation.
public void pushMessageToClients(Message message,
boolean evalSelector)
message - The Message to push to the destination's subscribers.evalSelector - true to evaluate each subscriber's selector before pushing
the message to them; false to skip selector evaluation.
public Set getSubscriberIds(Message message,
boolean evalSelector)
In normal usage, you can use the pushMessageToClients(message, evalSelector) method to both find the subscribers and send the message. You use this method only if you want to do additional processing to the subscribers list - for example, merging it into another list of subscribers or logging the ids of the subscribers who should receive the message. Once this method returns, you can use the pushMessageToClients variant which takes the set of subscriber ids to deliver these messages.
This method only returns subscriptions maintained by the current server instance. It does not return any information for subscribers that might be connected to remote instances. To send the message to remotely connected servers, use the sendPushMessageFromPeer method.
message - The Messsage
Typically
public void pushMessageToClients(Set subscriberIds,
Message message,
boolean evalSelector)
subscriberIds - The set of subscribers to push the message to.message - The Message to push.evalSelector - true to evaluate each subscriber's selector before pushing
the message to them; false to skip selector evaluation.public void initRemoteSubscriptions(String destinationId)
public void subscribeFromPeer(String destinationId,
Boolean subscribe,
String selector,
String subtopic,
Object remoteAddress)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/livecycle/es/sdkHelp/programmer/lcdsjavadoc/flex/messaging/services/MessageService.html