com.webmethods.caf.faces.data.csp
Class CSPRefreshableContentBaseProvider

java.lang.Object
  extended by com.webmethods.caf.faces.bean.BaseFacesBean
      extended by com.webmethods.caf.faces.bean.BaseFacesSessionBean
          extended by com.webmethods.caf.faces.data.csp.CSPBaseProvider
              extended by com.webmethods.caf.faces.data.csp.CSPRefreshableContentBaseProvider
All Implemented Interfaces:
IPageFlowScopeAdapter, IRefreshable, Serializable
Direct Known Subclasses:
CSPEFormTemplateProvider, CSPPreviewImageProvider

public abstract class CSPRefreshableContentBaseProvider
extends CSPBaseProvider
implements IRefreshable

Base class for CSP providers that need refresh support and work based on content id.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.webmethods.caf.faces.data.csp.CSPBaseProvider
fRetrievalModule, fSession
 
Fields inherited from class com.webmethods.caf.faces.bean.BaseFacesSessionBean
fExpireWithPageFlow
 
Fields inherited from class com.webmethods.caf.faces.bean.BaseFacesBean
DATA_BINDING_CLIENTS, OUTCOME_ERROR, OUTCOME_OK, resourcesProviders
 
Constructor Summary
CSPRefreshableContentBaseProvider()
           
 
Method Summary
 boolean getNeedRefresh()
          Returns true when IRefreshable.isAutoRefresh() is on and the result properties need to be refreshed from the data source by executing IRefreshable.refresh() method.
 boolean isAutoRefresh()
          Returns true if the provider is currenlty in auto-refresh mode
 void setAutoRefresh(boolean autorefresh)
          Sets auto refresh mode on.
 void setNeedRefresh(boolean needRefresh)
          Tells the provider that the input parameters have changed and the output results need to be refreshed the next time any output property is requested via IContentProvider.getValue(Object).
 boolean supportsAutoRefresh()
          Returns true if this content provider supports auto refresh feature.
 
Methods inherited from class com.webmethods.caf.faces.data.csp.CSPBaseProvider
checkState, getSession, release, setSession
 
Methods inherited from class com.webmethods.caf.faces.bean.BaseFacesSessionBean
getExpireWithPageFlow, setExpireWithPageFlow, valueBound, valueUnbound
 
Methods inherited from class com.webmethods.caf.faces.bean.BaseFacesBean
createMethodBinding, createValueBinding, error, error, error, error, error, getBean, getFacesContext, getLocale, getResourceInputStream, getResources, getResourcesProvider, getRootCause, getStackTrace, getTreeAttribute, isUserInRole, log, log, log, putTreeAttribute, resetDataBindingClients, resolveDataBinding, resolveDataBinding, resolveExpression, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.webmethods.caf.faces.data.IRefreshable
refresh
 

Constructor Detail

CSPRefreshableContentBaseProvider

public CSPRefreshableContentBaseProvider()
Method Detail

supportsAutoRefresh

public boolean supportsAutoRefresh()
Description copied from interface: IRefreshable
Returns true if this content provider supports auto refresh feature.

Specified by:
supportsAutoRefresh in interface IRefreshable
Returns:
true when auto refresh is supported
See Also:
IRefreshable.setAutoRefresh(boolean)

setAutoRefresh

public void setAutoRefresh(boolean autorefresh)
                    throws ContentProviderException
Description copied from interface: IRefreshable

Sets auto refresh mode on. When auto refresh mode is on, the provider calls IRefreshable.getNeedRefresh() to determine whether the refresh needs to be done before returning any result properties. If it returns true, the provider calls IRefreshable.refresh() method to updated the result properties.

Specified by:
setAutoRefresh in interface IRefreshable
Parameters:
autorefresh - true to turn it on
Throws:
ContentProviderException - if auto refresh mode is not supported
See Also:
IRefreshable.supportsAutoRefresh(), IRefreshable.getNeedRefresh(), IRefreshable.setNeedRefresh(boolean)

isAutoRefresh

public boolean isAutoRefresh()
Description copied from interface: IRefreshable
Returns true if the provider is currenlty in auto-refresh mode

Specified by:
isAutoRefresh in interface IRefreshable
Returns:
false if auto-refresh mode is off or not supported

getNeedRefresh

public boolean getNeedRefresh()
Description copied from interface: IRefreshable

Returns true when IRefreshable.isAutoRefresh() is on and the result properties need to be refreshed from the data source by executing IRefreshable.refresh() method.

Implementations may return an accurate value from this method if they can track the changes to the input parameter properties or they may require the clients to call IRefreshable.setNeedRefresh(boolean) explicitely.

Specified by:
getNeedRefresh in interface IRefreshable
Returns:
true when the output properties are not up-to-date with the current input parameters, i.e. IRefreshable.refresh() needs to be executed manually or automatically.

setNeedRefresh

public void setNeedRefresh(boolean needRefresh)
Description copied from interface: IRefreshable
Tells the provider that the input parameters have changed and the output results need to be refreshed the next time any output property is requested via IContentProvider.getValue(Object).

Specified by:
setNeedRefresh in interface IRefreshable
Parameters:
needRefresh - true if the input parameters have changed