Project

General

Profile

WebApps » History » Version 7

Gregg -, 09/10/2009 11:31 AM
servlet - database communication

1 1 Gregg -
2 7 Gregg -
h1. Web Application Architecture
3
4
5 1 Gregg -
Mulgara is designed to work as an embedded component.  The standard distribution includes a variety of build configurations, including a web services application.
6
7 7 Gregg -
See "this message":http://mulgara.org/pipermail/mulgara-general/2009-September/000935.html for info on how the default app is structured.
8 1 Gregg -
9 7 Gregg -
The basic idea is that [[EmbeddedMulgaraServer]] is the ringmaster, glue code that creates and launches service providers.
10 1 Gregg -
11
In directory src/jar/server/java/org/mulgara/server:
12 3 Gregg -
13 7 Gregg -
* org.mulgara.server.EmbeddedMulgaraServer
14
** "main" - entry point for default server?
15
*** sets up configuration, options parsing, etc.
16
*** creates instance of [[EmbeddedMulgaraServer]], whose constuctor 
17
**** creates a Mulgara Server instance (a "ServerMBean", which is an RMI server)
18
**** creates an [[HttpServices]] intance, passing itself, hostname, and [[MulgaraConfig]] as args
19
*** launches its services (i.e. Mulgara and webserver) via "startServices", which
20
<pre>
21
<pre>
22
** implements [[SessionFactoryProvider]] (in src/jar/query/java/org/mulgara/server/?)
23
** reads config parms using [[MulgaraConfig]] object
24 3 Gregg -
25 7 Gregg -
* org.mulgara.server.HttpServices
26
** no inheritance
27
** retains reference to Mulgara Server instance
28
** creates two Jetty "Http Servlet server" instances
29
** adds services using getContextServices
30
*** this is what creates the servlets (e.g. [[SparqlServlet]]), using 
31
**** addWebServicesWebAppContext
32
**** addServletContext
33
**** addWebQueryContext
34
<pre>
35
* org.mulgara.server.AbstractServer implements [[ServerMBean]] (?)
36 1 Gregg -
37 7 Gregg -
<pre>
38 4 Gregg -
39 3 Gregg -
In directory src/jar/querylang/java/org/mulgara/protocol/http:
40 1 Gregg -
41 7 Gregg -
* javax.servlet.http.HttpServlet
42
** org.mulgara.protocol.http.MulgaraServlet
43
*** org.mulgara.protocol.http.ProtocolServlet
44
**** org.mulgara.protocol.http.SparqlServlet
45
**** org.mulgara.protocol.http.TqlServlet
46 1 Gregg -
47 7 Gregg -
48
h4. Interaction of servlet and database
49
50 6 Gregg -
How does a servlet talk to a database?
51
52 7 Gregg -
<pre>
53 6 Gregg -
54
In src/jar/server/java/org/mulgara/server/:
55
56 7 Gregg -
* [[ServerMBean]] - handrolled mgmt interface for org.mulgara.server.SessionFactory
57
** init, start, stop, config stuff, etc.
58
* [[AbstractServer]] implements [[ServerMBean]]
59 1 Gregg -