KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ashkelon > pages > AdminPage


1 package org.ashkelon.pages;
2
3 import org.ashkelon.db.*;
4 import org.ashkelon.util.*;
5
6 import java.util.*;
7 import java.sql.*;
8
9
10 /**
11  * @author Eitan Suez
12  */

13 public class AdminPage extends Page
14 {
15    DBMgr dbmgr;
16    
17    public AdminPage()
18    {
19       super();
20       dbmgr = DBMgr.getInstance();
21    }
22    
23    public String JavaDoc handleRequest() throws SQLException
24    {
25       String JavaDoc command = ServletUtils.getRequestParam(request, "command");
26       if ("resetconns".equals(command))
27       {
28          dbmgr.resetConnections();
29       }
30       else if ("resetcache".equals(command))
31       {
32          Enumeration attributes = app.getAttributeNames();
33          while (attributes.hasMoreElements())
34          {
35             app.removeAttribute((String JavaDoc) attributes.nextElement());
36          }
37       }
38       return null;
39    }
40 }
41
Popular Tags