uCosminexus Application Server, Operation, Monitoring, and Linkage Guide
This section provides an example to set the timeout value and the range of the settings value when using the functionality for monitoring the J2EE application execution time for Web applications and for EJB.
The following sections explain the settings of the timeout value for the Web applications:
The following figure shows the timeout settings for filter, servlet, or JSP invocation:
Figure 5-3 Timeout settings for filter, servlet, or JSP invocation
You need to set the timeout value for each location appropriately after considering the invocation sequence. For example, the timeout value of the doFilter method of the range A in the figure is applied to the monitoring of the process time from start of method until its completion. For this reason, when the process time of B or C reaches the time set in timeout value of A, timeout occurs at that time. As shown in the following example:
Table 5-7 Example of settings 1 for timeout value
Location | Timeout value that has been set |
---|---|
A in the figure (doFilter method of filter) | 240 seconds |
B in the figure (Servlet) | 180 seconds |
C in the figure (JSP) | 120 seconds |
In the extension of processes within the servlets or JSPs performing uploads and downloads, there are times when communication with the client occurs. In such cases, since uploading and downloading are handled as processing of servlets and JSP, the execution time of the method is monitored.
For this reason, you need to set the timeout for the servlets and JSPs performing uploads and downloads after considering the communication delays with the client. Especially for downloads, a dialog is displayed in the browser to confirm the download with the client. In such cases, note that the download is not complete (Servlet or JSP process does not complete) until the user on the client performs operations in the dialog for download confirmation, depending upon the data quantity to be downloaded.
Note that when using a filter, the same precaution is required for the corresponding filter.
During initial access to a servlet, the timeout value set in the service method of the servlet becomes valid.
However, in the case of a servlet or JSP where the <load-on-startup> tag of DD (web.xml) is not set, init method is executed during initial request. At this time, the timeout value set in the service method of corresponding servlet or JSP becomes valid in the init method.
Moreover, even in the destroy method executed when javax.servlet.UnavailableException is thrown, indicating that the servlet or JSP cannot be used in the service method, the timeout value set in the service method of the corresponding servlet or JSP is applied.
The following figure shows the timeout settings for the initial request to a servlet:
Figure 5-4 Timeout settings for the initial request to a servlet
The following figure shows the timeout settings for the initial request of servlets and JSPs passing through a filter:
Figure 5-5 Timeout settings for the initial request of servlets passing through a filter
Figure 5-6 Timeout settings for the initial request of JSPs passing through a filter
In the filter process extensions, the filter timeout value when a servlet or JSP is invoked needs to be set after considering the timeout value of servlet or JSP invoked in filter extension.
For example, in case of Figure 5-6, the timeout value of the filter of range A in the figure is applied to filter process time. For this reason, when the process time of B or C reaches the time set in timeout value of A, timeout occurs at that time. The following example shows the case of figure 5-6:
Table 5-8 Example of settings 2 for timeout value
Location | Timeout value that has been set |
---|---|
A in the figure (filter) | 240 seconds |
B and C in the figure (servlet) | 180 seconds |
Moreover, in the case of servlet or JSP where the <servlet> tag of DD (web.xml) is defined but the <load-on-startup> tag is not set, the init method of servlet or JSP is executed when executing the initial request in the extension of the doFilter method of the filter. The following table shows the timing when the init method is executed.
Table 5-9 Timing when the 'init' method is executed
Target | Definition of <servlet> tag | Definition of <load-on-startup> tag | Timing when the 'init' method is executed |
---|---|---|---|
Servlet | Defined | None | Before the doFilter method is called |
None | None | Extension of the doFilter method | |
JSP | Defined | None | Extension of the doFilter method |
None | None | Extension of the doFilter method |
At this time, one of the following values is applied to the timeout value of the init method:
The following figure shows the timeout settings for business method invocation of Stateless Session Bean. Note that the same settings can also be performed for other Bean types (Stateful Session Bean, Entity Bean, and Message-driven Bean).
Figure 5-7 Timeout settings for business method invocation of Stateless Session Bean
Timeout occurs if the time set in the timeout value of the business method is exceeded.
Further, since the callback invoked in the EJB method invocation extension is a part of the business process, consider the execution time of the callback method when setting the timeout value. For details on the callback invoked in each method, see 5.3.8(2) Setting the timeout value in the method invocation process of the Enterprise Bean.
All Rights Reserved. Copyright (C) 2013, Hitachi, Ltd.