Listeners

1. Servlet Context Listener

The PresentationServer Servlet Context Listener allows configuring one processor to be called when the Servlet context is initialized, and one to be called when the Servlet context is destroyed. These processors are looked up in the following locations, in this order:

  1. properties.xml, for example:

      <properties>
      <property type="string" name="oxf.context-initialized-processor.uri" value="oxf/processor/pipeline"/>
      <property type="string" name="oxf.context-initialized-processor.input.config" value="oxf:/config/init.xpl"/>
      <property type="string" name="oxf.context-destroyed-processor.uri" value="oxf/processor/pipeline"/>
      <property type="string" name="oxf.context-destroyed-processor.input.config" value="oxf:/config/destroy.xpl"/>
      </properties>

  2. The context parameters in web.xml, for example:

      <context-param>
      <param-name>oxf.context-initialized-processor.uri</param-name>
      <param-value>oxf/processor/pipeline</param-value>
      </context-param>
      <context-param>
      <param-name>oxf.context-initialized-processor.input.config</param-name>
      <param-value>oxf:/config/init.xpl</param-value>
      </context-param>
      <context-param>
      <param-name>oxf.context-destroyed-processor.uri</param-name>
      <param-value>oxf/processor/pipeline</param-value>
      </context-param>
      <context-param>
      <param-name>oxf.context-destroyed-processor.input.config</param-name>
      <param-value>oxf:/config/destroy.xpl</param-value>
      </context-param>

Not every processor can be run from those pipelines, because the execution context is limited. In particular, you can't call processors like the Request generator, or any HTTP serializers. You have access to the Application context.

For the PresentationServer Servlet Context Listener to be called, you need to configure the following listener in your web.xml:

  <listener>
  <listener-class>org.orbeon.oxf.webapp.OXFServletContextListener</listener-class>
  </listener>

Note
There are no default processors. If no processor is specified, no processor is run on context initialization or destruction. This allows configuring a listener with only an initialization pipeline, only a destruction pipeline, both, or none.

2. Session Listener

The PresentationServer Session Listener allows configuring one processor to be called when the Session is created, and one to be called when the Session is destroyed. These processors are looked up in the following locations, in this order:

  1. properties.xml, for example:

      <properties>
      <property type="string" name="oxf.session-created-processor.uri" value="oxf/processor/pipeline"/>
      <property type="string" name="oxf.session-created-processor.input.config" value="oxf:/config/session-created.xpl"/>
      <property type="string" name="oxf.session-destroyed-processor.uri" value="oxf/processor/pipeline"/>
      <property type="string" name="oxf.session-destroyed-processor.input.config" value="oxf:/config/session-destroyed.xpl"/>
      </properties>

  2. The context parameters in web.xml, for example:

      <context-param>
      <param-name>oxf.session-created-processor.uri</param-name>
      <param-value>oxf/processor/pipeline</param-value>
      </context-param>
      <context-param>
      <param-name>oxf.session-created-processor.input.config</param-name>
      <param-value>oxf:/config/session-created.xpl</param-value>
      </context-param>
      <context-param>
      <param-name>oxf.session-destroyed-processor.uri</param-name>
      <param-value>oxf/processor/pipeline</param-value>
      </context-param>
      <context-param>
      <param-name>oxf.session-destroyed-processor.input.config</param-name>
      <param-value>oxf:/config/session-destroyed.xpl</param-value>
      </context-param>

Not every processor can be run from those pipelines, because the execution context is limited. In particular, you can't call processors like the Request generator, or any HTTP serializers. You have access to the Application and Session contexts.

For the PresentationServer Session Listener to be called, you need to configure the following listener in your web.xml:

  <listener>
  <listener-class>org.orbeon.oxf.webapp.OXFSessionListener</listener-class>
  </listener>

Note
There are no default processors. If no processor is specified, no processor is run on session creation or destruction. This allows configuring a listener with only a creation pipeline, only a destruction pipeline, both, or none.