Package org.apache.woden.wsdl20

Examples of org.apache.woden.wsdl20.Service


            // }
            //
            // }

            DescriptionElement descriptionElement = description.toElement();
            TypesElement typesElement = descriptionElement
                    .getTypesElement();
            if (typesElement != null) {
                Schema[] schemas = typesElement.getSchemas();
                for (int i = 0; i < schemas.length; i++) {
                    XmlSchema schemaDefinition = schemas[i].getSchemaDefinition();

                    // WSDL 2.0 spec requires that even the built-in schema should be returned
                    // once asked for schema definitions. But for data binding purposes we can ignore that
View Full Code Here


            @SuppressWarnings("unchecked")
            List<String> serviceNames = Service.getServiceNames();

            if (serviceNames != null) {
                for (String serviceName : serviceNames) {
                    Service s = null;

                    try {
                        s = new Service(serviceName);

                        ServiceConfig sc = s.getConfig();
                        ServiceInfo si = new ServiceInfo(sc.getName(), sc.getDisplayName(), sc.getDescription(), sc
                            .getPath(), sc.getDependencies());
                        services.add(si);
                    } catch (Win32Exception e) {
                        ; // Ignore these, it means Sigar was rejected by Windows for the particular Service.
                    } finally {
                        if (null != s) {
                            s.close();
                        }
                    }
                }
            }
        } catch (Exception e) {
View Full Code Here

    public void stop() {
    }

    private Service getIISService() throws Win32Exception {
        if (service == null) {
            service = new Service(WINDOWS_SERVICE_NAME);
        }
        return service;
    }
View Full Code Here

        return result;
    }

    private Win32ServiceControlDelegate getControlDelegate(Long timeout) throws Win32Exception {
        Service iisService = getIISService();
        String serviceName = iisService.getConfig().getName();
        List<String> serviceDependencies = Arrays.asList(iisService.getConfig().getDependencies());
        long serviceTimeout = (timeout == null ? SERVICE_CONTROL_TIMEOUT : timeout);
        return new Win32ServiceControlDelegate(serviceName, serviceDependencies, null, serviceTimeout);
    }
View Full Code Here

            this.reverseDependents = new ArrayList<String>(dependents);
            Collections.reverse(this.dependents);
        }
        this.timeout = timeout;

        service = new Service(serviceName);
    }
View Full Code Here

            return;

        log.debug("Starting list of services for Service [" + serviceName + "], services [" + services + "]");
        for (String relatedServiceName : services) {
            try {
                Service relatedService = new Service(relatedServiceName);
                int relatedServiceStatus = relatedService.getStatus();
                if (relatedServiceStatus == Service.SERVICE_STOPPED
                    || relatedServiceStatus == Service.SERVICE_STOP_PENDING) {
                    log.debug("Starting Service [" + relatedServiceName + "]");
                    relatedService.start(this.timeout);
                    log.debug("Service started [" + relatedServiceName + "]");
                    relatedService.close();
                }
            } catch (Exception e) {
                log.warn("Unable to start [" + relatedServiceName + "] from the list [" + services
                    + "]. Will continue with the rest. Cause:" + e);
            }
View Full Code Here

            return;

        log.debug("Stopping list of services for Service [" + serviceName + "], services [" + services + "]");
        for (String relatedServiceName : services) {
            try {
                Service relatedService = new Service(relatedServiceName);
                int relatedServiceStatus = relatedService.getStatus();
                if (!(relatedServiceStatus == Service.SERVICE_STOPPED || relatedServiceStatus == Service.SERVICE_STOP_PENDING)) {
                    log.debug("Stopping Service [" + relatedServiceName + "]");
                    relatedService.stop(this.timeout);
                    log.debug("Service stopped [" + relatedServiceName + "]");
                    relatedService.close();
                }
            } catch (Exception e) {
                log.warn("Unable to stop [" + relatedServiceName + "] from the list [" + services
                    + "]. Will continue with the rest. Cause:" + e);
            }
View Full Code Here

            return null;
        }
    }

    public void output(String[] args) throws SigarException {
        Service service = null;
        String name = args[0];
        String cmd = null;

        if (args.length == 2) {
            cmd = args[1];
        }
       
        try {
            service = new Service(name);
       
            if ((cmd == null) || cmd.equals("state")) {
                service.list(this.out);
            }
            else if (cmd.equals("start")) {
                service.start();
            }
            else if (cmd.equals("stop")) {
                service.stop();
            }
            else if (cmd.equals("pause")) {
                service.pause();
            }
            else if (cmd.equals("resume")) {
                service.resume();
            }
            else if (cmd.equals("delete")) {
                service.delete();
            }
            else if (cmd.equals("restart")) {
                service.stop(0);
                service.start();
            }
            else {
                println("Unsupported service command: " + args[1]);
                println("Valid commands: " + COMMANDS);
            }
        } finally {
            if (service != null) {
                service.close();
            }
        }
    }
View Full Code Here

public class ServiceStatus {

    private static void printStatus(String name)
        throws Win32Exception {

        Service service = new Service(name);
        System.out.println(name + ": " +
                           service.getStatusString());
        service.close();
    }
View Full Code Here

    public TestService(String name) {
        super(name);
    }

    public void testServiceOpen() throws Exception {
        Service service = new Service(EVENTLOG_NAME);
        service.getConfig();
        service.close();
       
        String dummyName = "DOESNOTEXIST";
        try {
            new Service(dummyName);
            assertTrue(false);
        } catch (Win32Exception e) {
            traceln(dummyName + ": " + e.getMessage());
            assertTrue(true);
        }
View Full Code Here

TOP

Related Classes of org.apache.woden.wsdl20.Service

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.