Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

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).

Note
titlev0.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.

...

Hint for Weld v1.1.1-v1.1.3

In case of those versions of Weld you have to use the alternative-implementation module

Note
titleHint for Weld v1.1.4+

In case of Weld v1.1.4+ you can use @Specializes again and you don't need alternative-implementation module

Example

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

CodiCoreConfig

...

  • isAdvancedQualifierRequiredForDependencyInjection
  • isConfigurationLoggingEnabled
  • isInvalidBeanCreationEventEnabled

WindowContextConfig

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

...

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

JsfModuleConfig

  • isInitialRedirectDisabled
  • isUseViewConfigsAsNavigationCasesEnabled
  • isInvalidValueAwareMessageInterpolatorEnabled
  • isAlwaysKeepMessages

JSF Module SPI

  • ConversationFactory (and EditableConversation and ConversationKey)
  • WindowContextFactory (and EditableWindowContext and JsfModuleConfig)
  • WindowContextManagerFactory (and EditableWindowContextManager and JsfModuleConfig)
  • WindowContextQuotaHandler
  • WindowHandler
  • LifecycleAwareWindowHandler
  • RenderKitWrapperFactory
  • ViewConfigExtractor (and EditableViewConfigDescriptor and LifecycleAwarePageBeanDescriptor and RequestLifecycleCallbackEntry)

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.

LifecycleAwareWindowHandler

A WindowHandler that is aware of the JSF lifecycle.

RenderKitWrapperFactory

Component libs like Trinidad use very special renderkits. This factory allows support-modules to customize the default behavior of CODI.

ViewConfigExtractor

A ViewConfigExtractor creates all view-config meta-data for a given ViewConfig class and returns the result as EditableViewConfigDescriptor . It also uses LifecycleAwarePageBeanDescriptor which is an extended PageBeanDescriptor . This descriptor exposes all supported view-controller methods as well as RequestLifecycleCallbackEntry for a given JSF PhaseId which provides the before- and after-callbacks.

With a custom implementation it's possible to customize e.g. the naming convention of the pages. If the custom implementation is annotated with @Advanced it's possible to wrap the default implementation for delegating to it. The only requirement is a field called defaultViewConfigExtractor . Furthermore, because this artifact is used during the bootstrapping process of CDI it's required to configure it for the environment - see Environment-Config Options