Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/share/gc/GCParams.java
41161 views
/*1* Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223package nsk.share.gc;2425import java.io.PrintStream;2627public class GCParams {28private String garbageProducerId;29private String garbageProducer1Id;30private String memoryStrategyId;31private String lockersId;3233public final String getGarbageProducerId() {34return garbageProducerId;35}3637public final void setGarbageProducerId(String garbageProducerId) {38this.garbageProducerId = garbageProducerId;39}4041public final String getGarbageProducer1Id() {42return garbageProducer1Id;43}4445public final void setGarbageProducer1Id(String garbageProducer1Id) {46this.garbageProducer1Id = garbageProducer1Id;47}4849public final String getMemoryStrategyId() {50return memoryStrategyId;51}5253public final void setMemoryStrategyId(String memoryStrategyId) {54this.memoryStrategyId = memoryStrategyId;55}5657public final String getLockersId() {58return lockersId;59}6061public final void setLockersId(String lockersId) {62this.lockersId = lockersId;63}6465public void parseCommandLine(String[] args) {66if (args == null)67return;68for (int i = 0; i < args.length; ++i) {69if (args[i].equals("-gp"))70garbageProducerId = args[++i];71else if (args[i].equals("-gp1"))72garbageProducer1Id = args[++i];73else if (args[i].equals("-ms"))74memoryStrategyId = args[++i];75else if (args[i].equals("-lockers"))76lockersId = args[++i];77}78printConfig(System.out);79}8081public void prinUsage() {82}8384public void printConfig(PrintStream out) {85}8687private static GCParams instance;8889public static GCParams getInstance() {90synchronized (GCParams.class) {91if (instance == null)92instance = new GCParams();93return instance;94}95}9697public static void setInstance(GCParams gcParams) {98synchronized (GCParams.class) {99instance = gcParams;100}101}102}103104105