1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package net.wotonomy.web;
20
21 import net.wotonomy.foundation.internal.NetworkClassLoader;
22
23 /***
24 * A pure java implementation that corresponds
25 * to the abstract class WORequestHandler.
26 *
27 * @author michael@mpowers.net
28 * @author $Author: cgruber $
29 * @version $Revision: 905 $
30 */
31 public abstract class WORequestHandler
32 {
33 private NetworkClassLoader loader;
34
35 /***
36 * Default constructor.
37 */
38 public WORequestHandler()
39 {
40 loader = new NetworkClassLoader( WOApplication.application().getClass().getClassLoader() );
41 }
42
43 /***
44 * Dispatches the request and returns the response.
45 */
46 abstract public WOResponse handleRequest (WORequest aRequest);
47
48 /***
49 * Gets the specified class, loading it if it has not already been
50 * loaded or if it has been modified. Returns null if not found.
51 * Because this method is not in the specification, it has only
52 * package access.
53 */
54 Class loadClass( String aName )
55 {
56 try
57 {
58 return loader.loadClass( aName, true );
59 }
60 catch ( ClassNotFoundException cnfe )
61 {
62 return null;
63 }
64 }
65
66
67
68 }