org.aselect.server
Class ASelectServer

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.aselect.system.servlet.ASelectHttpServlet
              extended by org.aselect.server.ASelectServer
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class ASelectServer
extends ASelectHttpServlet

This is the A-Select Server main class. It is responsible for init()ializing and destroy()ing all A-Select Server components, and it serves as the entry point for incoming requests (via the service() method).
Requests are processed as follows:



Concurrency issues: All methods invoked from the service() methods must be thread-safe. Most request handling methods instantiate a new request-handling object per incoming request to avoid concurrency issues.

Author:
Alfa & Ariss
See Also:
Serialized Form

Field Summary
static java.lang.String MODULE
          The module name.
 
Constructor Summary
ASelectServer()
           
 
Method Summary
 void destroy()
          Free resources, stop worker threads, and generally shutdown the A-Select Server.
 void init(javax.servlet.ServletConfig oServletConfig)
          Initialize the A-Select Server.
protected  boolean isRestartableServlet()
          The A-Select server is restartable.
protected  void service(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Entry point for all incoming requests (GET and POST).
 
Methods inherited from class org.aselect.system.servlet.ASelectHttpServlet
getModuleName, getWorkingDir, handleRestartRequest, isReinit, isRestartInProgress, restartServlets, setDisableCachingHttpHeaders, showErrorPage
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
 
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MODULE

public static final java.lang.String MODULE
The module name.

See Also:
Constant Field Values
Constructor Detail

ASelectServer

public ASelectServer()
Method Detail

init

public void init(javax.servlet.ServletConfig oServletConfig)
          throws javax.servlet.ServletException
Initialize the A-Select Server. This method is invoked: The second case is actually a re-initialization, i.e. the servlet is no longer in its initial state and care must be taken not to allocate resources twice.

Specified by:
init in interface javax.servlet.Servlet
Overrides:
init in class ASelectHttpServlet
Parameters:
oServletConfig -
Throws:
javax.servlet.ServletException
See Also:
Servlet.init(javax.servlet.ServletConfig)

destroy

public void destroy()
Free resources, stop worker threads, and generally shutdown the A-Select Server. This method is invoked by Tomcat when the servlet is removed or Tomcat itself shuts down.

Specified by:
destroy in interface javax.servlet.Servlet
Overrides:
destroy in class javax.servlet.GenericServlet
See Also:
Servlet.destroy()

service

protected void service(javax.servlet.http.HttpServletRequest request,
                       javax.servlet.http.HttpServletResponse response)
                throws javax.servlet.ServletException,
                       java.io.IOException
Entry point for all incoming requests (GET and POST).

Description:
This method is responsible for the initial processing of all incoming requests. In most cases the RequestHandlerFactory is called to create the appropriate requesthandler. (see the requesthandler package for more information).

Overrides:
service in class ASelectHttpServlet
Parameters:
request - The HttpServletRequest object
response - The HttpServletResponse object
Throws:
javax.servlet.ServletException - if processing went wrong
java.io.IOException - if no error could be sent to the HttpServletResponse
See Also:
HttpServlet.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

isRestartableServlet

protected boolean isRestartableServlet()
The A-Select server is restartable.

Specified by:
isRestartableServlet in class ASelectHttpServlet
Returns:
true if the Servlet is restartable, otherwise false.
See Also:
ASelectHttpServlet.isRestartableServlet()


Copyright © 2008 SURFnet BV. All Rights Reserved.