01: /*
02: * Copyright ? 2006 Sun Microsystems, Inc. All rights reserved.
03: *
04: * Sun Microsystems, Inc. has intellectual property rights relating to
05: * technology embodied in the product that is described in this document.
06: * In particular, and without limitation, these intellectual property
07: * rights may include one or more of the U.S. patents listed at
08: * http://www.sun.com/patents and one or more additional patents or
09: * pending patent applications in the U.S. and in other countries.
10: *
11: * U.S. Government Rights - Commercial software. Government users are subject
12: * to the Sun Microsystems, Inc. standard license agreement and applicable
13: * provisions of the FAR and its supplements. Use is subject to license terms.
14: * This distribution may include materials developed by third parties.
15: * Sun, Sun Microsystems, the Sun logo and Java are trademarks or registered
16: * trademarks of Sun Microsystems, Inc. in the U.S. and other countries.
17: */
18: package com.sun.portal.app.blog.env;
19:
20: import java.net.MalformedURLException;
21: import java.net.URL;
22: import javax.servlet.ServletContextEvent;
23: import javax.servlet.ServletContextListener;
24:
25: /**
26: * TODO
27: */
28: public abstract class App implements ServletContextListener {
29: private static App app;
30:
31: public static App getInstance() {
32: if (app == null) {
33: throw new IllegalStateException("app instance is null");
34: }
35:
36: return app;
37: }
38:
39: public static void setInstance(App app) {
40: App.app = app;
41: }
42:
43: public void contextInitialized(ServletContextEvent event) {
44: setInstance(this );
45: }
46:
47: public void contextDestroyed(ServletContextEvent event) {
48: //nothing
49: }
50:
51: public abstract URL getEntriesUrl(URL endpoint, String handle)
52: throws MalformedURLException;
53:
54: public abstract URL getResourcesUrl(URL endpoint, String handle)
55: throws MalformedURLException;
56: }
|