org.aselect.server
Class ASelectServer
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.aselect.system.servlet.ASelectHttpServlet
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:
- If the server is currently restarting, a HTTP SERVICE
UNAVAILABLE error is sent back to the client and no further
processing is performed.
- If a
request=restart
is present, it is handled and
further processing is halted.
- Otherwise, the A-Select Server uses a
RequestHandlerFactory
to determine the type and origin (application, authsp, remote a-select server,
or the user) of the request and delegates further processing to
the appropriate IRequestHandler implementation.
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. |
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 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 |
MODULE
public static final java.lang.String MODULE
- The module name.
- See Also:
- Constant Field Values
ASelectServer
public ASelectServer()
init
public void init(javax.servlet.ServletConfig oServletConfig)
throws javax.servlet.ServletException
- Initialize the A-Select Server. This method is invoked:
- by Tomcat when the servlet is instantiated, or
- by the A-Select Server itself when it restarts in response to
a
request=restart
.
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
objectresponse
- 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.