org.apache.myfaces.lifecycle
Class WindowContextConfig

java.lang.Object
  extended by org.apache.myfaces.lifecycle.WindowContextConfig

public class WindowContextConfig
extends Object

Configuration for the org.apache.myfaces.extensions.cdi.core.api.scope.conversation.WindowContext - it's customizable via the @Alternative or @Specializes mechanism of CDI.


Constructor Summary
protected WindowContextConfig()
           
 
Method Summary
 int getMaxWindowContextCount()
          Restricts the number of active windows.
 int getWindowContextTimeoutInMinutes()
          Specifies the time for the timeout for a window.
 boolean isAddWindowIdToActionUrlsEnabled()
          if set to true CODI will add a windowId=xxx parameter while encoding each action URL.
 boolean isCloseEmptyWindowContextsEnabled()
          Allows to activate the cleanup of empty window contexts to avoid cleanup e.g.
 boolean isCloseWindowContextEventEnabled()
          Specifies if the org.apache.myfaces.extensions.cdi.core.api.scope.conversation.event.CloseWindowContextEvent will be fired.
 boolean isCreateWindowContextEventEnabled()
          Specifies if the org.apache.myfaces.extensions.cdi.core.api.scope.conversation.event.CreateWindowContextEvent will be fired.
 boolean isEagerWindowContextDetectionEnabled()
          Allows to restore the window-context before the component tree gets built.
 boolean isUnknownWindowIdsAllowed()
          Allows to restrict window-ids.
 boolean isUrlParameterSupported()
          Specifies if it is allowed to use URL params for forwarding the current window-id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WindowContextConfig

protected WindowContextConfig()
Method Detail

isUrlParameterSupported

public boolean isUrlParameterSupported()
Specifies if it is allowed to use URL params for forwarding the current window-id. (deactivate it e.g. for higher security - in this case it's required to use a window id provided by a component lib or a server-side window-handler)

Returns:
true if it is allowed to add the window-id as URL parameter

isUnknownWindowIdsAllowed

public boolean isUnknownWindowIdsAllowed()
Allows to restrict window-ids.

With the default window handler (esp. for JSF 1.2), URLs have to contain the window-id. If users bookmark these links, they could open 2-n tabs (with the bookmark) which have the same window-id. It is only possible to prevent it if the ClientSideWindowHandler is used.

ATTENTION: Since CODI-1.0.6 this is set to true as defalt!

This must be enabled to

Returns:
true to allow all windowIds already present in window.name. false to only allow window-ids which are generated by CODI

isAddWindowIdToActionUrlsEnabled

public boolean isAddWindowIdToActionUrlsEnabled()
if set to true CODI will add a windowId=xxx parameter while encoding each action URL.

Returns:
true if the window-id should be added, false otherwise

getWindowContextTimeoutInMinutes

public int getWindowContextTimeoutInMinutes()
Specifies the time for the timeout for a window. After a timeout is detected all beans which are only linked to the window will be destroyed.

Returns:
the time for the timeout for a window

getMaxWindowContextCount

public int getMaxWindowContextCount()
Restricts the number of active windows.

Returns:
limit for active windows

isCloseEmptyWindowContextsEnabled

public boolean isCloseEmptyWindowContextsEnabled()
Allows to activate the cleanup of empty window contexts to avoid cleanup e.g. of the eldest window context instances if the max. count is reached.

Returns:
true for activating it, false otherwise

isEagerWindowContextDetectionEnabled

public boolean isEagerWindowContextDetectionEnabled()
Allows to restore the window-context before the component tree gets built.

Returns:
true for activating it, false otherwise

isCreateWindowContextEventEnabled

public boolean isCreateWindowContextEventEnabled()
Specifies if the org.apache.myfaces.extensions.cdi.core.api.scope.conversation.event.CreateWindowContextEvent will be fired.

Returns:
true if the event should be fired, false otherwise

isCloseWindowContextEventEnabled

public boolean isCloseWindowContextEventEnabled()
Specifies if the org.apache.myfaces.extensions.cdi.core.api.scope.conversation.event.CloseWindowContextEvent will be fired.

Returns:
true if the event should be fired, false otherwise


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.