You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

JSF Module Configuration

CODI provides default values via CDI beans. Therefore, it's possible to provide an alternative bean (via the std. @Specializes or @Alternative mechanism provided by CDI). Furthermore, there are add-ons e.g. for using the web.xml for the configuration (see External Resources).

v0.9.2+

With CODI v0.9.2+ we made it easier for users to customize just single values. The default implementations are already available in the API modules (instead of the interfaces). So you have to use extends instead of implements and only the customized values are required.

Example (CODI v0.9.2+)

Custom config which overrides the default value
@Specializes
@ApplicationScoped
public class CustomConversationConfig extends ConversationConfig
{
    @Override
    public int getConversationTimeoutInMinutes()
    {
        return 45;
    }
}

CodiCoreConfig (since 0.9.2)

  • isAdvancedQualifierRequiredForDependencyInjection

WindowContextConfig

  • isUrlParameterSupported
  • isUnknownWindowIdsAllowed
  • getWindowContextTimeoutInMinutes
  • getMaxWindowContextCount
  • isCloseEmptyWindowContextsEnabled
  • isEagerWindowContextDetectionEnabled
  • isCreateWindowContextEventEnabled
  • isCloseWindowContextEventEnabled

ConversationConfig

  • getConversationTimeoutInMinutes
  • isScopeBeanEventEnabled
  • isAccessBeanEventEnabled
  • isUnscopeBeanEventEnabled
  • isStartConversationEventEnabled
  • isCloseConversationEventEnabled
  • isRestartConversationEventEnabled

JsfModuleConfig

  • isInitialRedirectDisabled

JSF Module SPI

  • ConversationFactory (and EditableConversation and ConversationKey)
  • WindowContextFactory (and EditableWindowContext and JsfModuleConfig)
  • WindowContextManagerFactory (and EditableWindowContextManager and JsfModuleConfig)
  • WindowContextQuotaHandler
  • WindowHandler

ConversationFactory

A ConversationFactory is responsible for creating new Conversation instances (btw. EditableConversation) based on a given ConversationKey and ConversationConfig.

The default implementation is a bean - so it's possible to use the @Alternative mechanism of CDI for replacing it.

WindowContextFactory

A WindowContextFactory is responsible for creating new WindowContext instances (btw. EditableWindowContext) based on a given id and JsfModuleConfig.

There is no default implementation. So it's just required to implement a CDI bean which implements the interface.

WindowContextManagerFactory

A WindowContextManagerFactory is responsible for creating new WindowContextManager instances (btw. EditableWindowContextManager based on a given JsfModuleConfig.

There is no default implementation. So it's just required to implement a CDI bean which implements the interface.

WindowContextQuotaHandler

A WindowContextQuotaHandler is responsible for checking the max. count of WindowContext instances and handling a possible violation (e.g. cleaning up the eldest WindowContext).

The default implementation is a bean - so it's possible to use the @Alternative mechanism of CDI for replacing it.

WindowHandler

A WindowHandler is responsible for creating and restoring the id for/of the current window. If a component library already supports window id's it's possible to provide an adapter which uses the window-id provided by the component library. Furthermore, it's responsible for encoding URLs and for sending redirects based on the current window-id.

The default implementation is a bean - so it's possible to use the @Alternative mechanism of CDI for replacing it.

  • No labels