org.aselect.server.request.handler.aselect
Class ASelectRestartRequestHandler

java.lang.Object
  extended by org.aselect.server.request.handler.AbstractRequestHandler
      extended by org.aselect.server.request.handler.aselect.ASelectRestartRequestHandler
All Implemented Interfaces:
IRequestHandler

public class ASelectRestartRequestHandler
extends AbstractRequestHandler

Handles the A-Select restart request.

Description:
This class handles restart requests. It restarts the A-Select servlet that will proceed to reread its configuration without having to restart the servlet container (e.g. Tomcat).

Author:
Alfa & Ariss

Field Summary
 
Fields inherited from class org.aselect.server.request.handler.AbstractRequestHandler
_configManager, _oServletConfig, _oSessionManager, _systemLogger
 
Constructor Summary
ASelectRestartRequestHandler()
           
 
Method Summary
 void destroy()
          Removes class variables from memory.
 void init(javax.servlet.ServletConfig oServletConfig, java.lang.Object oConfig)
          Initializes the Restart request handler.
 RequestState process(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Description:
This method should be called if a sub class receives a restart request.
 
Methods inherited from class org.aselect.server.request.handler.AbstractRequestHandler
getID, getPattern
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ASelectRestartRequestHandler

public ASelectRestartRequestHandler()
Method Detail

init

public void init(javax.servlet.ServletConfig oServletConfig,
                 java.lang.Object oConfig)
          throws ASelectException
Initializes the Restart request handler.

Description:
Reads the following configuration:

<handler>
<shared_secret>[shared_secret]</shared_secret>
</handler>


Specified by:
init in interface IRequestHandler
Overrides:
init in class AbstractRequestHandler
Parameters:
oServletConfig - Servlet Config of the Parent servlet
oConfig - Object containing the RequestHandler configuration
Throws:
ASelectException - if initalization fails
See Also:
AbstractRequestHandler.init(javax.servlet.ServletConfig, java.lang.Object)

process

public RequestState process(javax.servlet.http.HttpServletRequest request,
                            javax.servlet.http.HttpServletResponse response)
                     throws ASelectException
Description:
This method should be called if a sub class receives a restart request. This methods calls restartServlets() which restarts all restartable servlets in the servlet context.

Note: The restart request should be handled by one Servlet in the context.

Concurrency issues:
This method should be called serial.

Preconditions:
Postconditions:
All restartable servlets in the context are restarted.


Parameters:
request - HttpServletRequest containing the request
response - HttpServletResponse containing the response
Returns:
RequestState containing the request handling state
Throws:
ASelectException - if the request couldn't be processed
See Also:
IRequestHandler.process(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

destroy

public void destroy()
Removes class variables from memory.

See Also:
IRequestHandler.destroy()


Copyright © 2008 SURFnet BV. All Rights Reserved.