<?xml version="1.0" encoding="UTF-8"?>
<service id="data-service" 
    class="flex.data.DataService" 
    messageTypes="flex.data.messages.DataMessage">

    <adapters>
        <adapter-definition id="actionscript" class="flex.data.adapters.ASObjectAdapter" default="true"/>
        <adapter-definition id="java-dao" class="flex.data.adapters.JavaAdapter"/>
    </adapters>

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

    <!-- These destinations are defined for use in Flex 3: Data and Communications -->
    <destination id="sandwich">
        <adapter ref="java-dao" />
        <properties>
            <source>dms.SandwichAssembler</source>
            <scope>application</scope>
            <metadata>
                <identity property="sandwichId"/>
            </metadata>
            <server>
                <fill-method>
                    <name>loadSandwiches</name>
                </fill-method>
                <fill-method>
                    <name>loadSandwiches</name>
                    <params>java.lang.String</params>
                </fill-method>
                <sync-method>
                    <name>syncSandwiches</name>
                </sync-method>
            </server>
        </properties>
    </destination>
    
    <destination id="photo">

        <adapter ref="java-dao" />

        <properties>

            <source>fstop.PhotoAssembler</source>
            <scope>application</scope>

            <metadata>
                <identity property="photoId"/>
            </metadata>

            <network>
                <session-timeout>20</session-timeout>
                <paging enabled="false" pageSize="10" />
                <throttle-inbound policy="ERROR" max-frequency="500"/>
                <throttle-outbound policy="REPLACE" max-frequency="500"/>                
            </network>

            <server>
                <fill-method>
                    <name>loadPhotos</name>
                </fill-method>

                <fill-method>
                    <name>loadPhotos</name>
                    <params>java.lang.Integer</params>
                </fill-method>

                <sync-method>
                    <name>syncPhotos</name>
                </sync-method>

            </server>
        </properties>
    </destination>

</service>
