flex.messaging
Class MessageBroker

java.lang.Object
  extended byflex.management.ManageableComponent
      extended byflex.messaging.MessageBroker
All Implemented Interfaces:
Manageable

public final class MessageBroker
extends ManageableComponent

The MessageBroker is the hub of message traffic in the Flex system. It has a number of endpoints which send and receive messages over the network, and it has a number of services that are message destinations. The broker routes messages to endpoints based on the content type of those messages, and routes decoded messages to services based on message type. The broker also has a means of calling back into the endpoints in order to push messages back through them. Example: A RemoteObject message arrives over the RTMP endpoint. The endpoint decodes the message and sends it to the Message Broker, and the broker then passes it on to the RemotingService which will perform the RemoteObject invocation.


Field Summary
static String LOG_CATEGORY
           
 
Method Summary
 String getId()
          Returns the Id for the MessageBroker.
 flex.messaging.log.Log getLog()
           
static MessageBroker getMessageBroker(String messageBrokerId)
          Retrieves a message broker with the supplied messageBrokerId.
 flex.messaging.messages.AcknowledgeMessage routeMessageToService(Message message, flex.messaging.endpoints.Endpoint endpoint)
          You can call this method in order to send a message from your code into the message routing system.
protected  void setConnectionMetrics(int connectionCount, int currentConnectionCountMax)
          Needed by SessionMetricsTracker to pass connectionCount and currentConnectionCountMax to the MessageBrokerController
 void stopEndpoints()
          Stop all of the broker's endpoints.
 
Methods inherited from class flex.management.ManageableComponent
getControl, isManaged, setControl, setManaged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG_CATEGORY

public static final String LOG_CATEGORY
See Also:
Constant Field Values
Method Detail

getId

public String getId()
Returns the Id for the MessageBroker.

Returns:
The Id for the MessageBroker.

getMessageBroker

public static MessageBroker getMessageBroker(String messageBrokerId)
Retrieves a message broker with the supplied messageBrokerId. This is defined via the servlet init parameter messageBrokerId. If no messageBrokerId is supplied, pass in a null value for the mbid parameter.


getLog

public flex.messaging.log.Log getLog()

stopEndpoints

public void stopEndpoints()
Stop all of the broker's endpoints.


routeMessageToService

public flex.messaging.messages.AcknowledgeMessage routeMessageToService(Message message,
                                                                        flex.messaging.endpoints.Endpoint endpoint)
You can call this method in order to send a message from your code into the message routing system. The message is routed to a service that is defined to handle messages of this type. Once the service is identified, the destination property of the message is used to find a destination configured for that service. The adapter defined for that destination is used to handle the message.

Parameters:
message - The message to be routed to a service
endpoint - This can identify the endpoint that is sending the message but it is currently not used so you may pass in null.

setConnectionMetrics

protected void setConnectionMetrics(int connectionCount,
                                    int currentConnectionCountMax)
Needed by SessionMetricsTracker to pass connectionCount and currentConnectionCountMax to the MessageBrokerController



Copyright © 2006 Adobe Systems Inc. All Rights Reserved. (Updated August 2, 2006)

Take a survey