Online documentation - Websydian v6.0

Users Guide | Patterns Reference | WebsydianExpress | Search

 

Websydian J2EE Architecture Parts

In the Websydian J2EE architecture the Websydian components (EventDispatcher, EventHandler, and PageGenerator) are deployed as a servlet in the J2EE web container. In order to do this the J2eeProxy servlet and the J2eeEventDispatcher must be used.

J2eeProxy Servlet

The J2eeProxy servlet is a run-time servlet found in the Websydian Java run-time (WsydDwa21.jar).

The J2eeProxy works as a bridge between the servlet interface and the Websydian application. When launched it will transfer all information about the request to the Websydian EventDispatcher function. As the EventDispatcher function is a Plex generated function the J2eeProxy calls the EventDispatcher as such. As input the EventDispatcher takes a key to an internal object store where the J2eeProxy stores information about the request.

An EventDispatcher is J2EE enabled simply by letting it inherit from the J2eeEventDispatcher function.

Invoking J2eeEventDispatcher

Several approaches are viable for letting the J2eeProxy invoke the J2eeEventDispatcher. Each of the methods as well as pros and cons are described in more detail below.

Standard

The servlet uses the ObRun.ObUtils.ObUserApi.callFunction() method to launch the Plex part of the Websydian application. This method is described in more detail in the Plex documentation.

When using this method a new Plex run-time is initialized for each request. This also means that the connection to the database or EJB Proxy is re-established for each request.

This method is configured by adding the following line to the J2eeProxy servlet property file:

servlet.plex.callmethod: Standard

Single runtime

This method requires that the Plex 5.1 fix #12310667 is installed.

Using this method the Plex run-time is initialized when the servlet is initialized. Each request then uses the same run-time to execute the Plex part of the Websydian application. That implies that the same database connection is used for all requests.

As the same run-time is used for all requests this call method can not be used with transactions or when using the BlockFetch function to fetch more than one block of data.

If the EJB Proxy is used the EJB Proxy have to be deployed as a stateless bean.

This method is configured by adding the following line to the J2eeProxy servlet property file:

servlet.plex.callmethod: SingleRuntime

Multiple runtimes

This method requires that the Plex 5.1 fix #12310667 is installed.

This option is only available with a Websydian Pro or Enterprise license.

Most web containers (and servlet engines) maintain a pool of Thread objects to service the requests from the client browser. This means that a Thread object can be reused to service requests thereby avoiding the overhead of creating a new Thread object for each request. The size of the pool and how it should grow on demand can be configured in the web container.

Websydian can make use of the above optimization by assigning a Plex run-time object to each Thread object in the thread pool. This means that each Thread object will maintain connection and other related information between requests.

If the web container does not use a thread pool then this option should not be used.

To verify that the web container uses a thread pool then set the log level to TRACE in the J2eeProxy servlet property file and search the log file for the entry "Plex run-time pool size: <size>". If the size increases for each request then the web container does not use a thread pool and this setting should not be used.

This method is configured by adding the following line to the J2eeProxy servlet property file:

servlet.plex.callmethod: MultipleRuntimes

J2eeEventDispatcher

The J2eeEventDispatcher is launched by the J2eeProxy. Besides that it works like a standard EventDispatcher function.

More information on the J2eeEventDispatcher can be found here.

J2eeSoapProcessor

The J2eeSoapProcessor is launched by the J2eeProxy. Besides that it works like a standard SoapProcessor function.

More information on the J2eeSoapProcessor can be found here.