PageMixer API - 3.1

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

java.lang.Object
  |
  +--jp.ne.dti.lares.foozy.pagemixer.servlet.ProducerFactory

public class ProducerFactory
extends java.lang.Object

Factory to create "Producer" factory.

With PageServlet(or derived classes from it), this provides customization point to create Producer.Factory in your specific way.

So, this class should be named as "ProducerFactoryFactory", in fact.

This implementation requires servlet 'init-param's shown below (see setup(HttpServlet) for detail):

producer.parser.pageState(optional):
name of class implementing interface PageState to create PageParser.

Since:
PageMixer 3.0

Field Summary
static java.lang.String PARAM_PAGESTATE
          Name of servlet init-param to instanciate "PageState".
 
Constructor Summary
ProducerFactory()
          Constructor.
 
Method Summary
 void cleanup(javax.servlet.http.HttpServlet servlet)
          Finalize.
 Producer.Factory setup(javax.servlet.http.HttpServlet servlet)
          Initialize and create "Producer" factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAM_PAGESTATE

public static final java.lang.String PARAM_PAGESTATE
Name of servlet init-param to instanciate "PageState".

This has value "producer.parser.pageState".

Constructor Detail

ProducerFactory

public ProducerFactory()
Constructor.
Method Detail

setup

public Producer.Factory setup(javax.servlet.http.HttpServlet servlet)
                       throws javax.servlet.ServletException
Initialize and create "Producer" factory.

This method provides chance of specific initialization. For example:

This is invoked from PageServlet.init().

This implementation looks servlet init-param up named as "producer.parser.pageState", and create PageState from it. Otherwise, this creates LoosePageState.

Then, this create PageParser, with above PageState, as Producer.Factory, and returns it

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

PageMixer API - 3.1