An Action is an adapter between the contents of an incoming HTTP request and the corresponding business logic that should be executed to process this request. The controller (RequestProcessor) will select an appropriate Action for each request, create an instance (if necessary), and call the execute
method.
Actions must be programmed in a thread-safe manner, because the controller will share the same instance for multiple simultaneous requests. This means you should design with the following items in mind:
When an Action
instance is first created, the controller will call setServlet
with a non-null argument to identify the servlet instance to which this Action is attached. When the servlet is to be shut down (or restarted), the setServlet
method will be called with a null
argument, which can be used to clean up any allocated resources in use by this Action.
|
|
|
|
|
|