Every server application component has an internationalization type setting that indicates whether the invocation internationalization context is to be managed by the component or by the hosting J2EE container.
Server application components can be deployed to use one of two types of internationalization context management:
A server component may be deployed as AMI or CMI, but not both; CMI is the default. The setting applies to the entire component on every invocation. Entity beans use CMI and cannot be configured otherwise. EJB client applications do not have an internationalization type setting; they implicitly use AMI.
Use the Application Assembly Tool to configure
the internationalization type for servlets, session beans, and message-driven
beans.
Application-managed internationalization (AMI)
Under the AMI deployment policy, component developers assume complete control over the invocation internationalization context. AMI components can use the internationalization context API to programmatically set invocation context elements.
AMI components are expected to manage invocation context. Invocations of AMI components implicitly run under the default locale and time zone of the hosting JVM. Invocation context elements not set using the API default to the corresponding elements of the JVM when accessed through the API or when exported on business methods. To export context elements other than the JVM defaults, AMI servlets, AMI enterprise beans, and EJB client applications must set (overwrite) invocation elements using the internationalization context API. Moreover, the container logically suspends caller context imported on AMI servlet lifecycle method and AMI EJB business method invocations. To continue propagating the context of the calling process, AMI servlets and enterprise beans must use the API to transfer caller context elements to the invocation context.
Specify AMI for server components that have internationalization context management requirements not supported by container-managed internationalization (CMI).
Container-managed internationalization (CMI)
CMI is the preferred internationalization context management policy for server application components; it is also the default policy. Under CMI, the internationalization service collaborates with the Web and EJB containers to set the invocation internationalization context for servlets and enterprise beans. The service sets invocation context according to the container internationalization attribute of the policy associated with a servlet (service method) or an EJB business method.
A CMI policy contains a container internationalization attribute that indicates which internationalization context the container is to scope to an invocation. For details, see topic Container internationalization attributes. By default, invocations of CMI components run under the caller's internationalization context; or rather, they adhere to the implicit policy [CMI,RunasCaller] whenever the servlet or business is not associated with an attribute in the deployment descriptor. For complete details, see the topic Internationalization context: Management policies.
Methods within CMI components can obtain elements of the invocation context using the internationalization context API, but cannot set them. Any attempt to set invocation context elements within CMI components results in a java.lang.IllegalStateException.
Specify container-managed internationalization for server application components requiring standard internationalization context management, then specify the container internationalization attributes for CMI servlets and for business methods of CMI enterprise beans that should not run under the caller's internationalization context.