FileDocCategorySizeDatePackage
ServiceAdmin.javaAPI DocApache Axis 1.48275Sat Apr 22 18:57:26 BST 2006org.apache.axis.management

ServiceAdmin

public class ServiceAdmin extends Object
The ServiceControl Object is responsible for starting and stopping specific services
author
bdillon
version
1.0

Fields Summary
private static org.apache.axis.server.AxisServer
axisServer
Constructors Summary
Methods Summary
public static voiddeployHandler(org.apache.axis.deployment.wsdd.WSDDHandler handler)

        getWSDDEngineConfiguration().getDeployment().deployHandler(handler);
    
public static voiddeployService(org.apache.axis.deployment.wsdd.WSDDService service)

        getWSDDEngineConfiguration().getDeployment().deployService(service);
    
public static voiddeployTransport(org.apache.axis.deployment.wsdd.WSDDTransport transport)

        getWSDDEngineConfiguration().getDeployment().deployTransport(transport);
    
public static org.apache.axis.server.AxisServergetEngine()
Get the singleton engine for this management object

return
throws
AxisFault

        if (axisServer == null) {
            //Throw a could not get AxisEngine Exception
            throw new AxisFault(
                    "Unable to locate AxisEngine for ServiceAdmin Object");
        }
        return axisServer;
    
public static org.apache.axis.deployment.wsdd.WSDDGlobalConfigurationgetGlobalConfig()

        return getWSDDEngineConfiguration().getDeployment().getGlobalConfiguration();
    
public static org.apache.axis.deployment.wsdd.WSDDHandlergetHandler(javax.xml.namespace.QName qname)

        return getWSDDEngineConfiguration().getDeployment().getWSDDHandler(qname);
    
public static org.apache.axis.deployment.wsdd.WSDDHandler[]getHandlers()

        return getWSDDEngineConfiguration().getDeployment().getHandlers();
    
public static org.apache.axis.deployment.wsdd.WSDDServicegetService(javax.xml.namespace.QName qname)

        return getWSDDEngineConfiguration().getDeployment().getWSDDService(qname);
    
public static org.apache.axis.deployment.wsdd.WSDDService[]getServices()

        return getWSDDEngineConfiguration().getDeployment().getServices();
    
public static org.apache.axis.deployment.wsdd.WSDDTransportgetTransport(javax.xml.namespace.QName qname)

        return getWSDDEngineConfiguration().getDeployment().getWSDDTransport(qname);
    
public static org.apache.axis.deployment.wsdd.WSDDTransport[]getTransports()

        return getWSDDEngineConfiguration().getDeployment().getTransports();
    
private static org.apache.axis.WSDDEngineConfigurationgetWSDDEngineConfiguration()

        if (axisServer != null) {
            EngineConfiguration config = axisServer.getConfig();
            if (config instanceof WSDDEngineConfiguration) {
                return (WSDDEngineConfiguration) config;
            } else {
                throw new RuntimeException("WSDDDeploymentHelper.getWSDDEngineConfiguration(): EngineConguration not of type WSDDEngineConfiguration");
            }
        }
        return null;
    
public static java.lang.String[]listServices()
List all registered services

return
Map of Services (SOAPService objects, Key is the ServiceName)
throws
AxisFault ConfigurationException

        ArrayList list = new ArrayList();
        AxisServer server = getEngine();
        Iterator iter; // get list of ServiceDesc objects
        try {
            iter = server.getConfig().getDeployedServices();
        } catch (ConfigurationException configException) {
            if (configException.getContainedException() instanceof AxisFault) {
                throw (AxisFault) configException.getContainedException();//Throw Axis fault if inst. of
            } else {
                throw configException;
            }
        }
        while (iter.hasNext()) {
            ServiceDesc sd = (ServiceDesc) iter.next();
            String name = sd.getName();
            list.add(name);
        }
        return (String[]) list.toArray(new String[list.size()]);
    
public static voidrestart()

        if (axisServer != null) {
            axisServer.stop();
            axisServer.start();
        }
    
public static voidsaveConfiguration()

        if (axisServer != null) {
            axisServer.saveConfiguration();
        }
    
public static voidsetEngine(org.apache.axis.server.AxisServer axisSrv, java.lang.String name)
Set the singleton engine

param
axisSrv

        ServiceAdmin.axisServer = axisSrv;
        Registrar.register(new ServiceAdministrator(), "axis:type=server", "ServiceAdministrator");
        Registrar.register(new DeploymentAdministrator(), "axis:type=deploy", "DeploymentAdministrator");
        Registrar.register(new DeploymentQuery(), "axis:type=query", "DeploymentQuery");
    
public static voidsetGlobalConfig(org.apache.axis.deployment.wsdd.WSDDGlobalConfiguration globalConfig)

        getWSDDEngineConfiguration().getDeployment().setGlobalConfiguration(globalConfig);
    
public static voidstart()

        if (axisServer != null) {
            axisServer.start();
        }
    
public static voidstartService(java.lang.String serviceName)
Start the Service

param
serviceName
throws
AxisFault ConfigurationException


                 
        
               
        AxisServer server = getEngine();
        try {
            SOAPService service = server.getConfig().getService(
                    new QName("", serviceName));
            service.start();
        } catch (ConfigurationException configException) {
            if (configException.getContainedException() instanceof AxisFault) {
                throw (AxisFault) configException.getContainedException();
            } else {
                throw configException;
            }
        }
    
public static voidstop()

        if (axisServer != null) {
            axisServer.stop();
        }
    
public static voidstopService(java.lang.String serviceName)
Stop the Service

param
serviceName
throws
AxisFault ConfigurationException

        AxisServer server = getEngine();
        try {
            SOAPService service = server.getConfig().getService(
                    new QName("", serviceName));
            service.stop();
        } catch (ConfigurationException configException) {
            if (configException.getContainedException() instanceof AxisFault) {
                throw (AxisFault) configException.getContainedException();//Throw Axis fault if ist. of
            } else {
                throw configException;
            }
        }
    
public static voidundeployHandler(javax.xml.namespace.QName qname)

        getWSDDEngineConfiguration().getDeployment().undeployHandler(qname);
    
public static voidundeployService(javax.xml.namespace.QName qname)

        getWSDDEngineConfiguration().getDeployment().undeployService(qname);
    
public static voidundeployTransport(javax.xml.namespace.QName qname)

        getWSDDEngineConfiguration().getDeployment().undeployTransport(qname);