Author: mturk Date: Fri Oct 9 17:43:17 2009 New Revision: 823632 URL: http://svn.apache.org/viewvc?rev=823632&view=rev Log: Add WaitHow enum
Added: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/WaitHow.java (with props) Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/LocalStrings.properties Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/LocalStrings.properties URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/LocalStrings.properties?rev=823632&r1=823631&r2=823632&view=diff ============================================================================== --- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/LocalStrings.properties (original) +++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/LocalStrings.properties Fri Oct 9 17:43:17 2009 @@ -13,4 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -runtime.unsupportedOs=Apache Commons Runtime does not support this operating system +os.ENOTIMPL=Apache Commons Runtime does not support this operating system +os.EVERSION=Apache Commons Runtime does not support this operating system version +waithow.EINVAL=Invalid WaitHow enum initializer ({0}) Added: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/WaitHow.java URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/WaitHow.java?rev=823632&view=auto ============================================================================== --- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/WaitHow.java (added) +++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/WaitHow.java Fri Oct 9 17:43:17 2009 @@ -0,0 +1,53 @@ +/* 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; + +import org.apache.commons.runtime.util.StringManager; + +/** + * Determines how to wait for a Process + */ +public enum WaitHow +{ + /** Wait for the specified process to finish */ + WAIT( 0), + /** Do not wait -- just see if it has finished */ + NOWAIT( 1); + + + private int value; + private WaitHow(int v) + { + value = v; + } + + public int valueOf() + { + return value; + } + + public static WaitHow valueOf(int value) + throws IllegalArgumentException + { + for (WaitHow e : values()) { + if (e.value == value) + return e; + } + throw new IllegalArgumentException(Local.sm.get("waithow.EINVAL", value)); + } + +} Propchange: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/WaitHow.java ------------------------------------------------------------------------------ svn:eol-style = native