|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
thinkmap.server.DataSourceServlet
public class DataSourceServlet
This servlet implements the server side of the RemoteDataSource. This class instantiates datasources by looking for xml files (typically ending with the extension .tas) that define how the datasource should be configured.
Each datasource is wrapped in a DataSourceWrapper, that is also configured by the ".tas" file. that it uses in two ways. First, it can deserialize a datasource from a file specified using the "datasource" initialization parameter. Alternatively, it can instatiate a class using Class.forName(). The class that is instantiated is specified using the "class" initialization parameter.
The stream format to use for parsing the incoming stream is normally determined dynamically by reading the "Stream-Format-Class" HTTP header which the remote datasource sends with every request. if no stream format header is sent, the DataSourceServlet will fall back to the default format, which can be specified using the "default-format" initialization parameter. By default, there is no default format set, and the server will produce an error if no stream format class is sent with the request.
This servlet will only serve Thinkmap clients via the HTTP POST method. If accessed via the GET method, it will return a short xml document describing the current status of the server.
RemoteDataSource,
IStreamFormat,
Serialized Form| Field Summary | |
|---|---|
static String |
CHECK_INTERVAL
|
static String |
DEFAULT_STREAM_FORMAT
|
static String |
STARTUP_URIS
|
protected static String |
STREAM_FORMAT_CLASS
|
| Constructor Summary | |
|---|---|
DataSourceServlet()
|
|
| Method Summary | |
|---|---|
void |
destroy()
|
static DataSourceServlet |
get(ServletContext context)
|
DataSourceContext |
getDataSource(String uri)
Get a reference to a DataSourceContext with the given URI. |
String[] |
getDataSourceURIs()
Get the URI's of all the contexts that have been loaded by the Datasource Servlet. |
MessageLog |
getErrorLog()
|
protected static IStreamFormat |
getFormat(String format,
IStreamFormat myDefault)
|
protected String |
getInitParameter(String name,
String def)
|
thinkmap.server.auth.License |
getLicense()
|
File |
getLicenseFile()
|
ResourceMonitor |
getResourceMonitor()
|
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 |
reloadDataSource(String uri)
|
void |
reloadLicense()
|
void |
removeDataSource(String uri)
Removes the datasource at the given URI. |
void |
service(HttpServletRequest request,
HttpServletResponse response)
|
protected void |
startDefaultURIs()
|
| 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 |
|---|
public static final String DEFAULT_STREAM_FORMAT
public static final String CHECK_INTERVAL
public static final String STARTUP_URIS
protected static final String STREAM_FORMAT_CLASS
| Constructor Detail |
|---|
public DataSourceServlet()
| Method Detail |
|---|
public static DataSourceServlet get(ServletContext context)
public void init(ServletConfig config)
throws ServletException
init in interface Servletinit in class GenericServletServletExceptionprotected void startDefaultURIs()
public void removeDataSource(String uri)
uri - the URI of the datasource to remove.
public DataSourceContext getDataSource(String uri)
throws IOException,
Exception
uri - the URI of the DataSourceContext to obtain.
IOException - if the file the URI does not exist, or cannot be read.
Exception
public void log(int level,
String message,
Throwable e)
level - logging level: see MemoryErrorLog for allowed values.message - the message to log (may be null)e - the exception to log (may be null)public MessageLog getErrorLog()
public String[] getDataSourceURIs()
public void reloadDataSource(String uri)
throws Exception
Exceptionpublic void destroy()
destroy in interface Servletdestroy in class GenericServlet
public void service(HttpServletRequest request,
HttpServletResponse response)
throws ServletException,
IOException
service in class HttpServletServletException
IOException
protected static IStreamFormat getFormat(String format,
IStreamFormat myDefault)
throws InstantiationException,
IllegalAccessException,
ClassNotFoundException
InstantiationException
IllegalAccessException
ClassNotFoundException
protected String getInitParameter(String name,
String def)
public ResourceMonitor getResourceMonitor()
public File getLicenseFile()
public thinkmap.server.auth.License getLicense()
public void reloadLicense()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||