|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.myfaces.extensions.cdi.jsf.impl.util.ConversationUtils
@Typed public abstract class ConversationUtils
internal! utils
Field Summary | |
---|---|
static String |
EXISTING_WINDOW_ID_SET_KEY
|
Method Summary | |
---|---|
static void |
addWindowContextIdHolderComponent()
Needed for server-side window-handler and client-side window handler for supporting postbacks |
static boolean |
cacheWindowId(javax.faces.context.ExternalContext externalContext,
String id,
boolean allowUnknownWindowIds)
|
static boolean |
cleanupInactiveWindowContexts(EditableWindowContextManager windowContextManager)
Allows to cleanup empty or inactive WindowContext s which saves memory |
static Class<? extends Annotation> |
convertToScope(javax.enterprise.inject.spi.BeanManager beanManager,
Class conversationGroupKey,
Annotation... qualifiers)
Maps the given conversation-group-key to a scope-annotation |
static Class<?> |
convertToSubGroup(Class<?> conversationGroupKey)
|
static Class |
getConversationGroup(javax.enterprise.inject.spi.Bean<?> bean)
Calculates the conversation-group for a given Bean . |
static Set<String> |
getExistingWindowIdSet(javax.faces.context.ExternalContext externalContext)
Exposes an unmodifiable representation of the active window-ids which have been generated and stored for the current user |
static String |
getNewViewId()
Exposes the next view-id. |
static String |
getOldViewId()
Exposes the prev. view-id. |
static WindowContextIdHolderComponent |
getWindowContextIdHolderComponent(javax.faces.context.FacesContext facesContext)
Resolves WindowContextIdHolderComponent which is responsible for storing the window-id in case of a
server-side window-handler. |
static WindowContextManager |
getWindowContextManager()
Resolves the current WindowContextManager |
static WindowHandler |
getWindowHandler()
Resolves the current WindowHandler |
static boolean |
isWindowActive(EditableWindowContextManager windowContextManager,
String windowId)
alternative to getExistingWindowIdSet(javax.faces.context.ExternalContext) because it might be deactivated... |
static void |
postRenderCleanup(javax.faces.context.FacesContext facesContext)
Performs the cleanup of inactive and empty WindowContext s (if permitted) and resets caches |
static boolean |
removeExistingWindowId(javax.faces.context.ExternalContext externalContext,
String windowContextId)
Allows to remove a window-id which has been created for a user(-session) |
static String |
resolveWindowContextId(WindowHandler windowHandler,
boolean requestParameterSupported,
boolean allowUnknownWindowIds)
Tries to resolve the window-id via WindowHandler , request-parameters, request-map, component |
static void |
sendRedirect(javax.faces.context.ExternalContext externalContext,
String url,
WindowHandler windowHandler)
Triggers a redirect via the ExternalContext or the current WindowHandler , resets caches and
prevents FacesMessage s |
static void |
storeCreatedWindowContextId(javax.faces.context.ExternalContext externalContext,
String windowContextId)
Allows to store the given window-id as active window-id |
static void |
storeCurrentViewIdAsNewViewId(javax.faces.context.FacesContext facesContext)
Stores the view-id of the current FacesContext as next view-id e.g. after a navigation occurred |
static void |
storeCurrentViewIdAsNewViewId(javax.faces.context.FacesContext facesContext,
WindowContext windowContext)
Stores the view-id of the current FacesContext as next view-id e.g. after a navigation occurred |
static void |
storeCurrentViewIdAsOldViewId(javax.faces.context.FacesContext facesContext)
Stores the view-id of the current FacesContext as prev. view-id e.g. before a navigation occurs |
static void |
storeCurrentViewIdAsOldViewId(javax.faces.context.FacesContext facesContext,
WindowContextManager windowContextManager)
Stores the view-id of the current FacesContext as prev. view-id e.g. before a navigation occurs |
static void |
storeViewIdAsNewViewId(WindowContext windowContext,
String newViewId)
Stores the given view-id as next view-id e.g. after a navigation occurred |
static void |
tryToRestoreTheWindowIdEagerly(javax.faces.context.FacesContext facesContext,
EditableWindowContextManager windowContextManager,
WindowHandler windowHandler,
WindowContextConfig windowContextConfig)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String EXISTING_WINDOW_ID_SET_KEY
Method Detail |
---|
public static Class getConversationGroup(javax.enterprise.inject.spi.Bean<?> bean)
Bean
.
Conversation-groups are only supported in combination with
ConversationScoped
bean
- current bean
public static String resolveWindowContextId(WindowHandler windowHandler, boolean requestParameterSupported, boolean allowUnknownWindowIds)
WindowHandler
, request-parameters, request-map, component
windowHandler
- current window-handlerrequestParameterSupported
- flag which indicates if it is allowed to restore the id from the request-paramsallowUnknownWindowIds
- flag which indicates if it is allowed to use id's which haven't been created for
the current user
public static boolean cacheWindowId(javax.faces.context.ExternalContext externalContext, String id, boolean allowUnknownWindowIds)
externalContext
- externalContextid
- windowIdallowUnknownWindowIds
- true to force the usage of the given id
public static void storeCurrentViewIdAsOldViewId(javax.faces.context.FacesContext facesContext)
FacesContext
as prev. view-id e.g. before a navigation occurs
facesContext
- current faces-contextpublic static void storeCurrentViewIdAsOldViewId(javax.faces.context.FacesContext facesContext, WindowContextManager windowContextManager)
FacesContext
as prev. view-id e.g. before a navigation occurs
facesContext
- current faces-contextwindowContextManager
- current window-context-managerpublic static void storeCurrentViewIdAsNewViewId(javax.faces.context.FacesContext facesContext)
FacesContext
as next view-id e.g. after a navigation occurred
facesContext
- current faces-contextpublic static void storeCurrentViewIdAsNewViewId(javax.faces.context.FacesContext facesContext, WindowContext windowContext)
FacesContext
as next view-id e.g. after a navigation occurred
facesContext
- current faces-contextwindowContext
- current window-contextpublic static void storeViewIdAsNewViewId(WindowContext windowContext, String newViewId)
windowContext
- current window-contextnewViewId
- next view-idpublic static String getOldViewId()
public static String getNewViewId()
public static WindowContextIdHolderComponent getWindowContextIdHolderComponent(javax.faces.context.FacesContext facesContext)
WindowContextIdHolderComponent
which is responsible for storing the window-id in case of a
server-side window-handler.
facesContext
- current faces-context
public static void addWindowContextIdHolderComponent()
public static void sendRedirect(javax.faces.context.ExternalContext externalContext, String url, WindowHandler windowHandler) throws IOException
ExternalContext
or the current WindowHandler
, resets caches and
prevents FacesMessage
s
externalContext
- current external-contexturl
- target URLwindowHandler
- current window-handler
IOException
- in case of a failed redirectpublic static WindowHandler getWindowHandler()
WindowHandler
public static WindowContextManager getWindowContextManager()
WindowContextManager
public static boolean removeExistingWindowId(javax.faces.context.ExternalContext externalContext, String windowContextId)
externalContext
- current external-contextwindowContextId
- window-id to remove
public static Set<String> getExistingWindowIdSet(javax.faces.context.ExternalContext externalContext)
externalContext
- current external-context
public static void storeCreatedWindowContextId(javax.faces.context.ExternalContext externalContext, String windowContextId)
externalContext
- current external-contextwindowContextId
- window-idpublic static boolean cleanupInactiveWindowContexts(EditableWindowContextManager windowContextManager)
WindowContext
s which saves memory
windowContextManager
- current window-context-manager
public static Class<? extends Annotation> convertToScope(javax.enterprise.inject.spi.BeanManager beanManager, Class conversationGroupKey, Annotation... qualifiers)
beanManager
- current bean-managerconversationGroupKey
- current conversation-group keyqualifiers
- current qualifiers
public static boolean isWindowActive(EditableWindowContextManager windowContextManager, String windowId)
getExistingWindowIdSet(javax.faces.context.ExternalContext)
because it might be deactivated...
windowContextManager
- current windowContextManagerwindowId
- windowId in question
public static void postRenderCleanup(javax.faces.context.FacesContext facesContext)
WindowContext
s (if permitted) and resets caches
facesContext
- current faces-contextpublic static void tryToRestoreTheWindowIdEagerly(javax.faces.context.FacesContext facesContext, EditableWindowContextManager windowContextManager, WindowHandler windowHandler, WindowContextConfig windowContextConfig)
public static Class<?> convertToSubGroup(Class<?> conversationGroupKey)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |