|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectflex.management.ManageableComponent
flex.messaging.MessageBroker
public final class MessageBroker
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 decoded messages received by endpoints to services based on the service destination specified in each message. The broker also has a means of pushing messages back through endpoints to clients.
| Field Summary | |
|---|---|
static String |
LOG_CATEGORY
Log category for MessageBroker. |
static String |
LOG_CATEGORY_STARTUP_SERVICE
Log category that captures startup information for broker's destinations. |
| Method Summary | |
|---|---|
void |
addDefaultChannel(String id)
Adds the channel id to the list of default channel ids. |
void |
addFactory(String id,
FlexFactory factory)
Registers a factory with the MessageBroker. |
void |
addService(Service service)
Add a message type -to- service mapping to the broker's collection. |
void |
addServiceValidationListener(String id,
ServiceValidationListener listener)
Add a listener for the describeServices callback. |
Service |
createService(String id,
String className)
Creates a Service instance, sets its id, sets it manageable
if the MessageBroker that created it is manageable,
and sets its MessageBroker to the MessageBroker that
created it. |
int |
decrementAttributeIdRefCount(String attributeId)
Decrements the count of destinations actively using an Application or Session level scoped assembler identified by the passed in attributeId. |
ConfigMap |
describeServices(Endpoint endpoint)
Describe services and the channels used by the services for the client. |
Object |
getAttribute(String name)
Returns the attribute value bound to the MessageBroker under the provided name. |
Iterator |
getAttributeNames()
Returns an Iterator containing the current names that attributes have been bound to the MessageBroker under. |
List |
getChannelIds()
Returns the list of channel ids known to the MessageBroker. |
ClassLoader |
getClassLoader()
This is the class loader used by the system to load user defined classes. |
List |
getDefaultChannels()
Returns the default channel ids of the MessageBroker. |
Map |
getFactories()
Returns the map of FlexFactory instances. |
FlexFactory |
getFactory(String id)
Returns the FlexFactory with the specified id. |
Log |
getLog()
Returns the logger of the MessageBroker. |
static MessageBroker |
getMessageBroker(String id)
Retrieves a message broker with the supplied id. |
SecurityConstraint |
getSecurityConstraint(String ref)
Returns the SecurityConstraint with the indicated
reference id. |
Service |
getService(String id)
Returns the Service with the specified id. |
Map |
getServices()
Returns the Map of Service instances. |
void |
incrementAttributeIdRefCount(String attributeId)
Increments the count of destinations actively using an Application or Session level scoped assembler identified by the passed in attributeId. |
void |
removeAttribute(String name)
Removes the attribute with the given name from the MessageBroker. |
boolean |
removeDefaultChannel(String id)
Removes the channel id from the list of default channel ids. |
FlexFactory |
removeFactory(String id)
Removes the FlexFactory from the list of factories known
by the MessageBroker. |
Server |
removeServer(String id)
Stops and removes the Server from the set of shared servers managed by the MessageBroker. |
Service |
removeService(String id)
Removes the Service from the list of services known
by the MessageBroker. |
void |
removeServiceValidationListener(String id)
Remove a listener from the describeServices callback. |
AcknowledgeMessage |
routeMessageToService(Message message,
Endpoint endpoint)
You can call this method in order to send a message from your code into the message routing system. |
void |
setAttribute(String name,
Object value)
Binds an attribute value to the MessageBroker under the provided name. |
void |
setDefaultChannels(List ids)
Sets the default channel ids of the MessageBroker. |
| Methods inherited from class flex.management.ManageableComponent |
|---|
getControl, getId, getParent, initialize, isManaged, isStarted, isValid, setControl, setId, setManaged, setParent, start, stop |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String LOG_CATEGORY
MessageBroker.
public static final String LOG_CATEGORY_STARTUP_SERVICE
| Method Detail |
|---|
public static MessageBroker getMessageBroker(String id)
id - The id of the message broker to retrieve.
MessageBroker for the supplied id.public Iterator getAttributeNames()
MessageBroker.getAttribute(String) to retrieve an attribute value.
public Object getAttribute(String name)
name - The attribute name.
public void setAttribute(String name,
Object value)
name - The attribute name.value - The attribute value.public void removeAttribute(String name)
name - The attribute name.public Server removeServer(String id)
Server from the set of shared servers managed by the MessageBroker.
id - The id of the Server to remove.
Server that has been removed or null if it doesn't exist.public FlexFactory getFactory(String id)
FlexFactory with the specified id.
id - The id of the FlexFactory.
FlexFactory with the specified id or null if no
factory with the id exists.public Map getFactories()
FlexFactory instances.
FlexFactory instances.
public void addFactory(String id,
FlexFactory factory)
MessageBroker.
id - The id of the factory.factory - FlexFactory instance.public FlexFactory removeFactory(String id)
FlexFactory from the list of factories known
by the MessageBroker.
id - The id of the FlexFactory.
FlexFactory that has been removed.public Service getService(String id)
Service with the specified id.
id - The id of the Service/
Service with the specified id or null if no
Service with the id exists.public Map getServices()
Service instances.
Service instances.public ConfigMap describeServices(Endpoint endpoint)
endpoint - Endpoint used to filter the destinations of the service.
public void addServiceValidationListener(String id,
ServiceValidationListener listener)
id - Identifier of the listener to addlistener - The listener callbackpublic void removeServiceValidationListener(String id)
id - Identifier of the listener to remove
public Service createService(String id,
String className)
Service instance, sets its id, sets it manageable
if the MessageBroker that created it is manageable,
and sets its MessageBroker to the MessageBroker that
created it.
id - The id of the Service.className - The class name of the Service.
Service instanced created.public void addService(Service service)
Service cannot be null, it cannot have a null
id, and it cannot have the same id or type of a Service
already registered with the MessageBroker.
Service needs to be started if the MessageBroker
is already running.
service - The service instance used to handle the messagespublic Service removeService(String id)
Service from the list of services known
by the MessageBroker.
id - The id of the Service.
Service associated with the id.public Log getLog()
MessageBroker.
MessageBroker.public List getChannelIds()
MessageBroker.
public List getDefaultChannels()
public void addDefaultChannel(String id)
id - The id of the channel to add to the list of default channel ids.public void setDefaultChannels(List ids)
ids - Default channel ids of the MessageBroker.public boolean removeDefaultChannel(String id)
id - The id of the channel to remove from the list of default channel ids.
true if the list contained the channel id.public SecurityConstraint getSecurityConstraint(String ref)
SecurityConstraint with the indicated
reference id.
ref - The reference of the SecurityConstraint
SecurityConstraint with the indicated reference id.
public AcknowledgeMessage routeMessageToService(Message message,
Endpoint endpoint)
message - The message to be routed to a serviceendpoint - This can identify the endpoint that is sending the message
but it is currently not used so you may pass in null.
AcknowledgeMessage with result.public ClassLoader getClassLoader()
ClassLoader the system should use to load user definied classes.public void incrementAttributeIdRefCount(String attributeId)
attributeId - Attribute id for the session or application-scoped object.public int decrementAttributeIdRefCount(String attributeId)
attributeId - Attribute id for the session or application-scoped object.
|
||||||||||
| 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/blazeds/1/javadoc/flex/messaging/MessageBroker.html