ServerConfig has static methods and properties that I would like to
invoke.  Seems that setting the xml property is a way to configure
BlazeDS.  Pardon the length of this bit of code - it's an interleaving
of flex/services-config.xml and flex/remoting-config.xml:

ServerConfig.xml = <services-config>
        <services>
        <service id="remoting-service"
            class="flex.messaging.services.RemotingService">

            <adapters>
                <adapter-definition id="java-object"
class="flex.messaging.services.remoting.adapters.JavaAdapter"
default="true"/>
            </adapters>

            <default-channels>
                <channel ref="my-amf"/>
            </default-channels>

            <destination id="echoDestination" channels="my-amf">
                <properties>
                   <source>com.mslinn.echo.Echo</source>
                </properties>
            </destination>
        </service>
        <!--service-include file-path="proxy-config.xml" />
        <service-include file-path="messaging-config.xml" /-->
    </services>

    <security>
        <login-command
class="flex.messaging.security.TomcatLoginCommand" server="Tomcat"/>
    </security>

    <channels>
        <channel-definition id="my-amf"
class="mx.messaging.channels.AMFChannel">
            <endpoint
url="http://localhost:8080/unboundConfig/messagebroker/amf";
class="flex.messaging.endpoints.AMFEndpoint"/>
        </channel-definition>

        <channel-definition id="my-secure-amf"
class="mx.messaging.channels.SecureAMFChannel">
            <endpoint
url="https://localhost:8080/unboundConfig/messagebroker/amfsecure";
class="flex.messaging.endpoints.SecureAMFEndpoint"/>
            <properties>
                <add-no-cache-headers>false</add-no-cache-headers>
            </properties>
        </channel-definition>

        <channel-definition id="my-polling-amf"
class="mx.messaging.channels.AMFChannel">
            <endpoint
url="http://localhost:8080/unboundConfig/messagebroker/amfpolling";
class="flex.messaging.endpoints.AMFEndpoint"/>
            <properties>
                <polling-enabled>true</polling-enabled>
                <polling-interval-seconds>4</polling-interval-seconds>
            </properties>
        </channel-definition>

        <channel-definition id="my-longpolling-amf"
class="mx.messaging.channels.AMFChannel">
          <endpoint
url="http://localhost:8080/unboundConfig/messagebroker/amflongpolling";
class="flex.messaging.endpoints.AMFEndpoint"/>
          <properties>
                 <polling-enabled>true</polling-enabled>
                 <polling-interval-seconds>3</polling-interval-seconds>
                 <wait-interval-millis>60000</wait-interval-millis>
                
<client-wait-interval-millis>1</client-wait-interval-millis>
                
<max-waiting-poll-requests>200</max-waiting-poll-requests>
          </properties>
        </channel-definition>
    </channels>

    <logging>
        <target class="flex.messaging.log.ConsoleTarget" level="Error">
            <properties>
                <prefix>[BlazeDS] </prefix>
                <includeDate>false</includeDate>
                <includeTime>false</includeTime>
                <includeLevel>false</includeLevel>
                <includeCategory>false</includeCategory>
            </properties>
            <filters>
                <pattern>Endpoint.*</pattern>
                <pattern>Service.*</pattern>
                <pattern>Configuration</pattern>
            </filters>
        </target>
    </logging>

    <system>
        <redeploy>
            <enabled>false</enabled>
        </redeploy>
    </system>
</services-config>;

I can get the names of all the defined channels using E4X:
ServerConfig.serverConfigData.channels.elements("channel-definition")....@["id"])

Now for my question.  I want to get the channel objects, not just
their names.  A big fat nothing gets printed out from this:
for each (var channelName:String in
ServerConfig.serverConfigData.channels.elements("channel-definition")....@["id"])
trace(ServerConfig.getChannel(channelName));

What is the correct way to retrieve channel objects from ServerConfig?

Reply via email to