The internationalization policy of every CMI servlet and EJB business method has a container internationalization attribute that specifies which internationalization context the container is to scope to its invocation.
The container internationalization attribute has three main fields:
As a convenience, you can create named container internationalization attributes and associate them to the following:
Run-as field
The Run-as field specifies one of three types of invocation context that a container can scope to a method. For servlet service and EJB business methods, the container constructs the invocation internationalization context according to the Run as field setting and associates this context to the current thread before delegating to the method's implementation.
By default, invocations of servlet service methods and EJB business methods implicitly run as caller (RunAsCaller) unless the Run as field of a policy's attribute specifies otherwise. EJB client applications and AMI server components always run as server (RunAsServer).
Invocation context types specifiable with the Run as field are:
Note: JMS messages do not contain internationalization context. Although container-managed message-driven beans can be configured to run as caller, the container associates the default elements of the server process when invoking the onMessage() method of any message-driven bean configured as [CMI, RunAsCaller].
With
the Application Assembly Tool, the Run as field is configurable for
any CMI servlet and business method of a CMI enterprise bean.
You
can also configure the Run as field for Web service business methods.
Locales field
The Locales field specifies an ordered list of locales that the container scopes to an invocation. A locale represents a specific geographical, cultural, or political region and contains three fields:
A valid locale must specify at least a language code or a country code; the variant is always optional. The first locale of the list is returned when accessing invocation context using the internationalization context API method getLocale().
With the Application
Assembly Tool, the Locales field is configurable for CMI servlets and
for business methods of supported enterprise beans that run as specified.
Time zone ID field
The Time zone ID field specifies a shorthand identifier for a time zone that the container scopes to an invocation.
With the Application
Assembly Tool, the Time zone ID field is configurable for CMI servlets
and for CMI EJB business methods that run as specified.
You
can also configure the Time zone ID field for Web service business
methods.
A time zone represents a temporal offset and computes daylight savings information. A valid ID indicates any time zone supported by the SDK type, java.util.TimeZone. Specifically, a valid ID is any of the IDs appearing in the list of time zone IDs returned by method java.util.TimeZone.getAvailableIds(), or a custom ID having the form GMT[+|-]hh[[:]mm]; for example, America/Los_Angeles, GMT-08:00 are valid time zone IDs.