From commits-return-9042-apmail-commons-commits-archive=commons.apache.org@commons.apache.org Fri Oct 09 17:48:40 2009 Return-Path: Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: (qmail 97749 invoked from network); 9 Oct 2009 17:48:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 Oct 2009 17:48:40 -0000 Received: (qmail 87385 invoked by uid 500); 9 Oct 2009 17:48:39 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 87302 invoked by uid 500); 9 Oct 2009 17:48:39 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 87293 invoked by uid 99); 9 Oct 2009 17:48:39 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Oct 2009 17:48:39 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Oct 2009 17:48:36 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 6DCB72388901; Fri, 9 Oct 2009 17:48:15 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r823636 - /commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/ServiceControl.java Date: Fri, 09 Oct 2009 17:48:15 -0000 To: commits@commons.apache.org From: mturk@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20091009174815.6DCB72388901@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mturk Date: Fri Oct 9 17:48:15 2009 New Revision: 823636 URL: http://svn.apache.org/viewvc?rev=823636&view=rev Log: Add bunch of windows service enums Added: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/ServiceControl.java (with props) Added: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/ServiceControl.java URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/ServiceControl.java?rev=823636&view=auto ============================================================================== --- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/ServiceControl.java (added) +++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/ServiceControl.java Fri Oct 9 17:48:15 2009 @@ -0,0 +1,90 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.commons.runtime.platform.windows; + +import java.util.EnumSet; + +/** + * ServiceControl types. + */ +public enum ServiceControl +{ + + UNKNOWN( -1), + /** + * Notifies a service that it should start. + */ + START( 0), + /** + * Notifies a service that it should stop.
+ * After sending the stop request to a service, you should not send + * other controls to the service. + */ + STOP( 1), + /** + * Notifies a service that it should pause. + */ + PAUSE( 2), + /** + * Notifies a paused service that it should resume. + */ + CONTINUE( 3), + /** + * Notifies a service that it should report its current status + * information to the service control manager. + */ + INTERROGATE( 4), + /** + * Notifies a service when system shutdown occurs. + *
+ * Note that ControlService cannot + * send this notification; only the system can send it. + */ + SHUTDOWN( 5), + /** + * Notifies a service that its startup parameters have changed. + */ + PARAMCHANGE( 6), + /** + * The service defines the action associated with the control code. + * Range 128 to 255. + */ + USER( 128); + + private int value; + private ServiceControl(int v) + { + value = v; + } + + public int valueOf() + { + return value; + } + + public static ServiceControl valueOf(int value) + { + for (ServiceControl e : values()) { + if (e.value == value) + return e; + } + if (value > USER.value) + return USER; + else + return UNKNOWN; + } +} Propchange: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/ServiceControl.java ------------------------------------------------------------------------------ svn:eol-style = native