OracleJavaScript API Reference for Oracle ADF Faces

 

SUMMARY: FIELD | CONSTR | METHOD    DETAIL: FIELD | CONSTR | METHOD

oracle.adfinternal.view.js.laf.dhtml.rich
Class AdfUserInactivityTimeoutHelper

Warning:

org.ecmascript.object.Object
   |
   +--oracle.adf.view.js.base.AdfObject
         |
         +--oracle.adfinternal.view.js.laf.dhtml.rich.AdfUserInactivityTimeoutHelper

public class AdfUserInactivityTimeoutHelper
extends AdfObject
This class is used to support user inactivity timeout for active components, like af:poll and Active Data Service (ADS). If a user has been inactive for a period of user inactivity timeout, it stops active components instacting with server to allow application's session to time out so that server resources can be released timely. This class provides functions to check whetehr the feature is enabled, start/restart user inactivity timeout timer, calculate the timeout value, stop active component sending any request to server when user is inactive and inactivity times out, and resume active components if user interacts again before session times out. The timeout value is specified in web.xml file as a servlet context paramter, "oracle.adf.view.rich.poll.TIMEOUT". Its default value is 10 minutes. The feature is disabled if its value is -1. af:poll component's timeout property overrides the value defined in web.xml. An instance of this class in a page should only be created if there is af:poll component or the page supports ADS. If it is enabled, a user inactivity timeout timer starts when the page is loaded. When it times out, it stops active components and starts session timeout warning timer. If user is active again before session times out, it resumes active components and a new timer is started.



Field Summary

private Object
_componentIDsArray
private Object
_defaultTimeoutInterval
private Object
_globalTimeoutInterval
private Object
_hasTimedOut
private Object
_maxComponentTimeoutInterval


Fields inherited from oracle.adf.view.js.base.AdfObject

constructor, superclass


Fields inherited from org.ecmascript.object.Object

prototype


Constructor Summary

public
AdfUserInactivityTimeoutHelper(Object userInactivityTimeout)
This class is used to support user inactivity timeout for active components, like af:poll and Active Data Service (ADS).


Method Summary

private Object
_applyPollTimeoutStyle()
Callback function to apply the "poll timeout" style to all components that were updated by the LAST poll, before the <af:poll> component timed out, due to user inactivity.
private Object
_calculatePollingTimeoutInterval(Object interval)
Calculates the global "timeout interval" for the af:poll components.
private HTMLElement
_createPollingTimeoutLayerElement(HTMLElement element)
Helper function which creates a (simple) layer/DIV element to be placed ontop of those components that are no longer being updated, once the <af:poll> component has been "timed out".
private Object
_forceADSStop()
Forces ADS to stop sending polling/reconnecting requests down to the server due to user inactivity timeout.
private Object
_forceComponentStop()
Callback function which forces all <af:poll> components and ADS to stop interacting with server since client timed out due to user inactivity.
private Object
_forcePollingComponentStop()
Forces all <af:poll> components to stop sending polling requests down to the server due to user inactivity timeout.
public boolean
hasTimedOut()
Helper method to request the "state" of the user inactivity timeout
protected Object
Init()
Create an instance of an AdfUserInactivityTimeoutHelper
protected static Object
InitClass()
Initializes the AdfUserInactivityTimeoutHelper class
public Object
initializeTimeout(Object interval)
Called when a page is loaded or on PPR to calculate the global timeout interval of the embedding PAGE and schedules the timeout callback, if needed.
public boolean
isTimeoutEnabled()
Check whether user inactivity timeout is enabled
public Object
registerPollComponent(Object component)
Hook for the PollPeer to register its component to keep track of its ID and timeout value.
private Object
_removePollingTimeoutLayer()
Removes the "polling timeout layer" HTML elements and removes the "polling timeout" styles from those components that are no longer updated, once the polling times out.
private Object
_rescheduleOrScheduleTimerIfNeeded()
Helper function to cancel and reschedule the timer callback.
Object
__resetTimeoutHandler(Object event)
This function is called by _redistribute().
public Object
unregisterPollComponent(Object component)
Called by the ComponentRemoved of the Poll Peer to trigger the unregister of the removed component.


Methods inherited from oracle.adf.view.js.base.AdfObject

adopt, clone, createCallback, createInitializedObject, createSubclass, ensureClassInitialization, equals, exportPrototypeSymbol, getClass, GetLazyArrayProperty, GetLazyMapProperty, getTypeName, toDebugString, toString


Field Detail


_componentIDsArray

private Object _componentIDsArray

_defaultTimeoutInterval

private Object _defaultTimeoutInterval

_globalTimeoutInterval

private Object _globalTimeoutInterval

_hasTimedOut

private Object _hasTimedOut

_maxComponentTimeoutInterval

private Object _maxComponentTimeoutInterval

Constructor Detail


AdfUserInactivityTimeoutHelper

public AdfUserInactivityTimeoutHelper(Object userInactivityTimeout)

This class is used to support user inactivity timeout for active components, like af:poll and Active Data Service (ADS). If a user has been inactive for a period of user inactivity timeout, it stops active components instacting with server to allow application's session to time out so that server resources can be released timely. This class provides functions to check whetehr the feature is enabled, start/restart user inactivity timeout timer, calculate the timeout value, stop active component sending any request to server when user is inactive and inactivity times out, and resume active components if user interacts again before session times out. The timeout value is specified in web.xml file as a servlet context paramter, "oracle.adf.view.rich.poll.TIMEOUT". Its default value is 10 minutes. The feature is disabled if its value is -1. af:poll component's timeout property overrides the value defined in web.xml. An instance of this class in a page should only be created if there is af:poll component or the page supports ADS. If it is enabled, a user inactivity timeout timer starts when the page is loaded. When it times out, it stops active components and starts session timeout warning timer. If user is active again before session times out, it resumes active components and a new timer is started.

Parameters:
userInactivityTimeout    

Method Detail


_applyPollTimeoutStyle

private Object _applyPollTimeoutStyle()

Callback function to apply the "poll timeout" style to all components that were updated by the LAST poll, before the <af:poll> component timed out, due to user inactivity.

Return:
Object

_calculatePollingTimeoutInterval

private Object _calculatePollingTimeoutInterval(Object interval)

Calculates the global "timeout interval" for the af:poll components. If timeout is spcified in af:poll components, the maximum value is returned to overrides the timeout specified in web.xml. Otherwise, the input value is returned.

Parameters:
interval  -  the amount of time (in ms) after which client should time out, as specified in web.xml file.
Return:
Object - timeoutInterval the timeout should be used for user inactivity on this page

_createPollingTimeoutLayerElement

private HTMLElement _createPollingTimeoutLayerElement(HTMLElement element)

Helper function which creates a (simple) layer/DIV element to be placed ontop of those components that are no longer being updated, once the <af:poll> component has been "timed out".

Parameters:
element  -  Root DOM Element of the ADF component, which needs a layer on top.
Return:
HTMLElement - Returns the newly created HTML (layer) element.

_forceADSStop

private Object _forceADSStop()

Forces ADS to stop sending polling/reconnecting requests down to the server due to user inactivity timeout.

Return:
Object

_forceComponentStop

private Object _forceComponentStop()

Callback function which forces all <af:poll> components and ADS to stop interacting with server since client timed out due to user inactivity.

Return:
Object

_forcePollingComponentStop

private Object _forcePollingComponentStop()

Forces all <af:poll> components to stop sending polling requests down to the server due to user inactivity timeout.

Return:
Object

hasTimedOut

public boolean hasTimedOut()

Helper method to request the "state" of the user inactivity timeout

Return:
boolean - true if the user inactivity has timed out

Init

protected Object Init()

Create an instance of an AdfUserInactivityTimeoutHelper

Return:
Object
Overrides:
AdfObject.Init()

InitClass

protected static Object InitClass()

Initializes the AdfUserInactivityTimeoutHelper class

Return:
Object

initializeTimeout

public Object initializeTimeout(Object interval)

Called when a page is loaded or on PPR to calculate the global timeout interval of the embedding PAGE and schedules the timeout callback, if needed.

Parameters:
interval    
Return:
Object

isTimeoutEnabled

public boolean isTimeoutEnabled()

Check whether user inactivity timeout is enabled

Return:
boolean - true if the user inactivity is enabled, false otherwise

registerPollComponent

public Object registerPollComponent(Object component)

Hook for the PollPeer to register its component to keep track of its ID and timeout value. This method also computes the max timeout interval among all the registered af:poll components.

Parameters:
component    
Return:
Object

_removePollingTimeoutLayer

private Object _removePollingTimeoutLayer()

Removes the "polling timeout layer" HTML elements and removes the "polling timeout" styles from those components that are no longer updated, once the polling times out.

Return:
Object

_rescheduleOrScheduleTimerIfNeeded

private Object _rescheduleOrScheduleTimerIfNeeded()

Helper function to cancel and reschedule the timer callback.

Return:
Object

__resetTimeoutHandler

Object __resetTimeoutHandler(Object event)

This function is called by _redistribute(). If needed it resets the user inactivity timeout timer.

Parameters:
event    
Return:
Object

unregisterPollComponent

public Object unregisterPollComponent(Object component)

Called by the ComponentRemoved of the Poll Peer to trigger the unregister of the removed component. We remove the clientID and regenerate the 'per page' valid timeout interval

Parameters:
component    
Return:
Object

SUMMARY: FIELD | CONSTR | METHOD    DETAIL: FIELD | CONSTR | METHOD

 

Generated on 2014.03.27 12:59 UTC
Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.