thinkmap.server
Class StatusServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by thinkmap.server.StatusServlet
All Implemented Interfaces:
Serializable, Servlet, ServletConfig

public class StatusServlet
extends HttpServlet

This servlet serves status information about all the Thinkmap Data Sources loaded by the server.

Version:
$Revision $
See Also:
Serialized Form

Field Summary
static String CUSTOM_ACTIONS
           
 
Constructor Summary
StatusServlet()
           
 
Method Summary
protected  IAction getAction(String id)
          Get an action by name
protected  List<IDataSourceAction> getActions(DataSourceContext context)
           
protected  Map<String,Object> getDataSources(DataSourceServlet dsServlet)
          Add information to a parent node
protected  List<IServerAction> getServerActions()
           
protected  Object getServerProperties(DataSourceServlet dsServlet)
          Get basic information about the server and add it to a parent node
protected  Object getStatus(HttpServletRequest request, ServletContext context)
           
 void init()
          Initialize
 void init(ServletConfig config)
           
 void log(int level, String message, Throwable e)
          Log a message to the servlet log and to the memroy error log.
 void registerAction(IAction action)
          Register an action
protected  void service(HttpServletRequest req, HttpServletResponse resp)
          Service a request
protected  JSONWriter writer(HttpServletResponse resp)
           
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CUSTOM_ACTIONS

public static final String CUSTOM_ACTIONS
See Also:
Constant Field Values
Constructor Detail

StatusServlet

public StatusServlet()
Method Detail

init

public void init(ServletConfig config)
          throws ServletException
Specified by:
init in interface Servlet
Overrides:
init in class GenericServlet
Throws:
ServletException

init

public void init()
          throws ServletException
Initialize

Overrides:
init in class GenericServlet
Throws:
ServletException

service

protected void service(HttpServletRequest req,
                       HttpServletResponse resp)
                throws ServletException,
                       IOException
Service a request

Overrides:
service in class HttpServlet
Throws:
ServletException
IOException

writer

protected JSONWriter writer(HttpServletResponse resp)
                     throws IOException
Throws:
IOException

getStatus

protected Object getStatus(HttpServletRequest request,
                           ServletContext context)
                    throws Exception
Throws:
Exception

getServerProperties

protected Object getServerProperties(DataSourceServlet dsServlet)
Get basic information about the server and add it to a parent node


getDataSources

protected Map<String,Object> getDataSources(DataSourceServlet dsServlet)
                                     throws Exception
Add information to a parent node

Throws:
Exception

getServerActions

protected List<IServerAction> getServerActions()

getActions

protected List<IDataSourceAction> getActions(DataSourceContext context)

registerAction

public void registerAction(IAction action)
Register an action


getAction

protected IAction getAction(String id)
Get an action by name


log

public void log(int level,
                String message,
                Throwable e)
Log a message to the servlet log and to the memroy error log.

Parameters:
level - logging level: see MemoryErrorLog for allowed values.
message - the message to log (may be null)
e - the exception to log (may be null)


Copyright © 2013 Thinkmap, Inc. All Rights Reserved.