/** * Calculates the conversation-group for a given {@link Bean}. * Conversation-groups are only supported in combination with * {@link org.apache.myfaces.extensions.cdi.core.api.scope.conversation.ConversationScoped} * @param bean current bean * @return class which represents the conversation-group */ public static Class getConversationGroup(Bean<?> bean) { Class<? extends Annotation> scopeType = bean.getScope(); if(ViewAccessScoped.class.isAssignableFrom(scopeType)) { return bean.getBeanClass(); } if(WindowScoped.class.isAssignableFrom(scopeType)) { return WindowScoped.class; } //don't cache it (due to the support of different producers) ConversationGroup conversationGroupAnnotation = findConversationGroupAnnotation(bean); if(conversationGroupAnnotation == null) { return bean.getBeanClass(); } return conversationGroupAnnotation.value(); }
/** * Calculates the conversation-group for a given {@link Bean}. * Conversation-groups are only supported in combination with * {@link org.apache.myfaces.extensions.cdi.core.api.scope.conversation.ConversationScoped} * @param bean current bean * @return class which represents the conversation-group */ public static Class getConversationGroup(Bean<?> bean) { Class<? extends Annotation> scopeType = bean.getScope(); if(ViewAccessScoped.class.isAssignableFrom(scopeType)) { return bean.getBeanClass(); } if(WindowScoped.class.isAssignableFrom(scopeType)) { return WindowScoped.class; } //don't cache it (due to the support of different producers) ConversationGroup conversationGroupAnnotation = findConversationGroupAnnotation(bean); if(conversationGroupAnnotation == null) { return bean.getBeanClass(); } return conversationGroupAnnotation.value(); }
/** * Calculates the conversation-group for a given {@link Bean}. * Conversation-groups are only supported in combination with * {@link org.apache.myfaces.extensions.cdi.core.api.scope.conversation.ConversationScoped} * @param bean current bean * @return class which represents the conversation-group */ public static Class getConversationGroup(Bean<?> bean) { Class<? extends Annotation> scopeType = bean.getScope(); if(ViewAccessScoped.class.isAssignableFrom(scopeType)) { return bean.getBeanClass(); } if(WindowScoped.class.isAssignableFrom(scopeType)) { return WindowScoped.class; } //don't cache it (due to the support of different producers) ConversationGroup conversationGroupAnnotation = findConversationGroupAnnotation(bean); if(conversationGroupAnnotation == null) { return bean.getBeanClass(); } return conversationGroupAnnotation.value(); }