KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > net > axis > server > AxisAdminServlet


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7
8 package org.jboss.net.axis.server;
9
10 import org.jboss.axis.AxisFault;
11 import org.jboss.axis.server.AxisServer;
12 import org.jboss.axis.transport.http.AdminServlet;
13
14 /**
15  * slightly patched admin servlet to contact the right server
16  * @created 9.9.2002
17  * @author jung
18  * @version $Revision: 1.6.6.1 $
19  */

20
21 public class AxisAdminServlet extends AdminServlet
22 {
23
24    /** reference to the server */
25    protected AxisServer server = null;
26
27    /** Creates new AxisServlet */
28    public AxisAdminServlet()
29    {
30    }
31
32    /** override AxisServlet.getEngine() in order to redirect to
33     * the corresponding AxisEngine.
34     */

35    public AxisServer getEngine() throws AxisFault
36    {
37       if (server == null)
38       {
39          // we need to extract the engine from the
40
// rootcontext
41
String JavaDoc installation = getInitParameter(org.jboss.net.axis.Constants.CONFIGURATION_CONTEXT);
42          // call the static service method to find the installed engine
43
try
44          {
45             server = JMXEngineConfigurationFactory.newJMXFactory(installation).getAxisServer();
46          }
47          catch (NullPointerException JavaDoc e)
48          {
49             throw new AxisFault("Could not access JMX configuration factory.", e);
50          }
51       }
52
53       return server;
54    }
55
56 }
57
Popular Tags