Interview Questions

What is the standard way to create threads, do initialization, etc. within the application server?

BEA WebLogic Questions and Answers


(Continued from previous question...)

What is the standard way to create threads, do initialization, etc. within the application server?

Threads should generally not be created by the user directly is because things may not work correctly. User-created threads do not have some of the thread-local variables pre-set by WebLogic when it creates it's own execute threads, the associated transaction context, or the environment such as the proper class loader. The WebLogic-specific way of doing this is with a startup class or using the WebLogic Time Services. The portable way to do this is to define a load-on-startup servlet, doing the initialization in the init() method and the cleanup in the destroy() method. The servlet itself does nothing. This approach also allows for undeploy/redeploy of the application without restarting the server, including proper cleanup/initialization each time. It also providers more dynamic management of the dependent classes without restarting the server.

(Continued on next question...)

Other Interview Questions