Perform this task to access elements of the invocation internationalization context.
An application component must first resolve a reference to the InvocationInternationalization object and then bind it to the InvocationInternationalization interface of the internationalization context API.
Every remote invocation of a servlet service or Enterprise JavaBeans™ (EJB) business method has an invocation internationalization context associated with the thread that is running that invocation. Invocation context is the internationalization context under which servlet and business method implementations run; it is propagated on subsequent invocations by the internationalization service and middleware. This task also applies to Web service client programs.
... //-------------------------------------------------------------------- // Set the invocation context under which the business method or // servlet will run and propagate on subsequent remote business // method invocations. //-------------------------------------------------------------------- try { invocationI18n.setLocale(new Locale("en", "GB")); invocationI18n.setTimeZone(SimpleTimeZone.getTimeZone("GMT")); } catch (IllegalStateException ise) { // Is the component CMI; is the service started and enabled? } myEjb.myBusinessMethod();
Within CMI application components, the Internationalization and InvocationInternationalization interfaces are semantically equivalent. You can use either of these interfaces to obtain the context associated with the thread on which that component is running. For instance, both interfaces can be used to obtain the list of locales propagated to the servlet doPost service method.
In this information ...Related concepts
Related tasks
| IBM Redbooks, demos, education, and more(Index) |