KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > axis > management > jmx > ServiceAdministrator


1 /*
2  * Copyright 2003,2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.axis.management.jmx;
17
18 import org.apache.axis.AxisFault;
19 import org.apache.axis.ConfigurationException;
20 import org.apache.axis.Version;
21 import org.apache.axis.management.ServiceAdmin;
22
23 /**
24  * The ServiceAdmininstrator MBean exposes the
25  * org.apache.axis.management.ServiceAdmin object
26  *
27  * @author bdillon
28  * @version 1.0
29  */

30 public class ServiceAdministrator implements ServiceAdministratorMBean {
31     /**
32      * CTR
33      */

34     public ServiceAdministrator() {
35     }
36
37     /**
38      * start the server
39      */

40     public void start() {
41         ServiceAdmin.start();
42     }
43
44     /**
45      * stop the server
46      */

47     public void stop() {
48         ServiceAdmin.stop();
49     }
50
51     /**
52      * restart the server
53      */

54     public void restart() {
55         ServiceAdmin.restart();
56     }
57
58     /**
59      * Start the Service
60      *
61      * @param serviceName
62      * @throws AxisFault ConfigurationException
63      */

64     public void startService(String JavaDoc serviceName)
65             throws AxisFault, ConfigurationException {
66         org.apache.axis.management.ServiceAdmin.startService(serviceName);
67     }
68
69     /**
70      * Stop the Service
71      *
72      * @param serviceName
73      * @throws AxisFault ConfigurationException
74      */

75     public void stopService(String JavaDoc serviceName)
76             throws AxisFault, ConfigurationException {
77         org.apache.axis.management.ServiceAdmin.stopService(serviceName);
78     }
79
80     /**
81      * get the axis version
82      *
83      * @return
84      */

85     public String JavaDoc getVersion() {
86         return Version.getVersionText();
87     }
88 }
Popular Tags