Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

The Cache Filter can be used to cache the response of a WebService. 
We support caching on two different scopes, the ApplicationScope or the SessionScope.
Depending on which scope you would like to use, you need to apply different Data Provider class in the definition node. 
For the SessionScope, use the class:  org.adfemg.datacontrol.xml.provider.filter.cache.SessionScopeCacheFilter 
For the ApplicationScope , use the class:  org.adfemg.datacontrol.xml.provider.filter.cache.ApplicationScopeCacheFilter

Normally you typically use a CacheFilter on reference data that is static for the duration of a session or application. However, in this example we will use the HR example WebService we have been using throughout the Developers Guide.

 

Clone parameter

Both the CacheFilters can take one parameter, the parameter 'clone', this is the parameter that specifies whether the cached XML Element should be cloned before returning it. This is typically used when the CacheFilter is nested in other DataFilter(s) that manipulate the element and you want to make sure the cached element is not altered.

 

Data Control
    <AdapterDataControl id="HrWSData" FactoryClass="oracle.adf.model.adapter.DataControlFactoryImpl"
                        ImplDef="org.adfemg.datacontrol.xml.DataControlDefinition" SupportsTransactions="false"
                        SupportsSortCollection="false" SupportsResetState="false" SupportsRangesize="false"
                        SupportsFindMode="false" SupportsUpdates="false"
                        Definition="org.adfemg.xmldc.demo.view.HrWSData" BeanClass="org.adfemg.xmldc.demo.view.HrWSData"
                        xmlns="http://xmlns.oracle.com/adfm/datacontrol">
        <Source>
            <definition xmlns="http://adfemg.org/adfm/datacontrol/configuration"
                        schema="http://xmldc-sample.appspot.com/HR.xsd" schema-root="ListAllDepartmentsResponse"
                        dc-operation="getDepartments">
                <data-provider class="org.adfemg.datacontrol.xml.provider.filter.cache.ApplicationScopeCacheFilter">
                    <parameters>
                        <parameter name="clone" value="false"/>
                    </parameters>
                    <data-provider class="org.adfemg.datacontrol.xml.provider.data.WSDataProvider">
                        <parameters>
                            <parameter name="endPointUrl"
                                       value="http://xmldc-sample.appspot.com/HumanResourcesService"/>
                            <xml-parameter name="requestElement">
                                <![CDATA[
                              <hr:ListAllDepartmentsRequest xmlns:hr="http://adfemg.org/HR"/>
                            ]]>
                            </xml-parameter>
                        </parameters>
                    </data-provider>
                </data-provider>
            </definition>
        </Source>
    </AdapterDataControl>



 

  • No labels

0 Comments

You are not logged in. Any changes you make will be marked as anonymous. You may want to Log In if you already have an account.