(Adobe® Flex™ Data Services 2 only)
Packagemx.messaging.config
Classpublic class ServerConfig
InheritanceServerConfig Inheritance Object

This class provides access to the server messaging configuration information. This class encapsulates information from the services-config.xml file on the client and is used by the messaging system to provide configured ChannelSets and Channels to the messaging framework.

The XML source is provided during the compilation process. However, there is currently no internal restriction preventing the acquisition of this XML data by other means, such as network, local file system, or shared object at runtime.



Public Properties
 PropertyDefined by
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
  xml : XML
[static] The XML configuration; this value must contain the relevant portions of the <services> tag from the services-config.xml file.
ServerConfig
Public Methods
 MethodDefined by
  
getChannel(id:String, clustered:Boolean = false):Channel
[static] Returns a shared instance of the configured Channel.
ServerConfig
  
getChannelSet(destinationId:String, message:IMessage, serverMessageType:String = null):ChannelSet
[static] Returns a shared ChannelSet for use with the specified destination belonging to the service that handles the specified message type.
ServerConfig
  
getProperties(destinationId:String, serviceId:String = null):XMLList
[static] Returns the property information for the specified destination
ServerConfig
  
[static] Returns the id for the first service found that will service the specified message.
ServerConfig
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
Property detail
xmlproperty
xml:XML  [read-write]

The XML configuration; this value must contain the relevant portions of the <services> tag from the services-config.xml file.

Implementation
    public static function get xml():XML
    public function set xml(value:XML):void
Method detail
getChannel()method
public static function getChannel(id:String, clustered:Boolean = false):Channel

Returns a shared instance of the configured Channel.

Parameters
id:String — The id of the desired Channel.
 
clustered:Boolean (default = false) — True if the Channel will be used in a clustered fashion; otherwise false.

Returns
Channel — The Channel instance.

Throws
InvalidChannelError — If no Channel has the specified id.
getChannelSet()method 
public static function getChannelSet(destinationId:String, message:IMessage, serverMessageType:String = null):ChannelSet

Returns a shared ChannelSet for use with the specified destination belonging to the service that handles the specified message type.

If identical destinations are defined for multiple services that handle this message type, the first match is used and the others are ignored.

Parameters
destinationId:String — The target destination id.
 
message:IMessage — A message to send. Services correlate to message types, so the message disambiguates identically named destinations belonging to different services.
 
serverMessageType:String (default = null) — If specified, this value is used to disambiguate identically named destinations belonging to different services, rather than using the registered server class alias of the message argument. When this argument is provided the message argument can be passed as null because it will not be used.

Returns
ChannelSet — The ChannelSet.

Throws
InvalidDestinationError — If the specified destination is not defined or does not service messages of this type.
getProperties()method 
public static function getProperties(destinationId:String, serviceId:String = null):XMLList

Returns the property information for the specified destination

Parameters
destinationId:String — The id of the desired destination.
 
serviceId:String (default = null) — The id of the service the destination belongs to.

Returns
XMLList — XMLList containing the <property> tag information.

Throws
InvalidDestinationError — If the specified destination is not found.
getServiceIdForMessage()method 
public static function getServiceIdForMessage(message:IMessage):String

Returns the id for the first service found that will service the specified message.

Parameters
message:IMessage — The message to locate the corresponding service for.

Returns
String — The service id.

Throws
MessagingError — If no service is found that will process the message.




 

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

Current page: http://livedocs.adobe.com/flex/2/langref/mx/messaging/config/ServerConfig.html