View Javadoc

1   package org.sourceforge.jemm.server;
2   
3   import org.apache.commons.cli.ParseException;
4   
5   public enum ServerMode {
6   	PERSISTENT,
7   	MEMORY;
8   	
9   	public static final ServerMode DEFAULT=PERSISTENT;
10  	
11  	public static ServerMode parseServerMode(String modeValue) throws ParseException {
12  		if("persistent".equalsIgnoreCase(modeValue))
13  			return PERSISTENT;
14  		else if("memory".equalsIgnoreCase(modeValue))
15  			return MEMORY;
16  		else
17  			throw new ParseException("mode option " + modeValue 
18  			        + " is not valid, allowed values are persistent and memory");
19  	}
20  	
21  
22  }