PageMixer API - 3.1

jp.ne.dti.lares.foozy.pagemixer.servlet
Class LocaleFactory

java.lang.Object
  |
  +--jp.ne.dti.lares.foozy.pagemixer.servlet.LocaleFactory
Direct Known Subclasses:
StrutsLocaleFactory

public class LocaleFactory
extends java.lang.Object

Factory to create "Locale".

With PageServlet(or derived classes from it), this provides customization point to create Locale to render response page in your specific way.

Since:
PageMixer 3.0

Constructor Summary
LocaleFactory()
          Constructor.
 
Method Summary
 void cleanup(javax.servlet.http.HttpServlet servlet)
          Finalize.
 java.util.Locale create(ConsumerContext context)
          Create Locale.
 void setup(javax.servlet.http.HttpServlet servlet)
          Initialize.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocaleFactory

public LocaleFactory()
Constructor.
Method Detail

setup

public void setup(javax.servlet.http.HttpServlet servlet)
           throws javax.servlet.ServletException
Initialize.

This method provides chance of specific initialization. For example:

This is invoked from PageServlet.init().

This implementation does nothing

Parameters:
servlet - with which this object works
Throws:
javax.servlet.ServletException - if initialization fails
See Also:
cleanup(HttpServlet)

cleanup

public void cleanup(javax.servlet.http.HttpServlet servlet)
Finalize.

You should release all resources which you allocate in setup(HttpServlet) in this method.

This is invoked from PageServlet.destroy().

This implementation does nothing

Parameters:
servlet - with which this object works

create

public java.util.Locale create(ConsumerContext context)
Create Locale.

This is invoked from PageServlet#doAction() per request.

This implementation expects that specified context is instance of ServletConsumerContext or its derived class, and returns ServletRequest#getLocale.

Parameters:
context - of request
Returns:
locale of response renderring

PageMixer API - 3.1