Path: blob/master/test/jdk/javax/management/security/Simple.java
41152 views
/*1* Copyright (c) 2004, 2015, 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*/222324//import java.beans.ConstructorProperties;25import javax.management.ConstructorParameters;2627/**28* This class defines a simple standard MBean.29*/30public class Simple implements SimpleMBean {3132private String attribute = "initial_value";33private boolean operationInvoked = false;34private boolean operation2Invoked = false;3536@SqeDescriptorKey("NO PARAMETER CONSTRUCTOR Simple")37public Simple() {38}3940@SqeDescriptorKey("TWO PARAMETERS CONSTRUCTOR Simple")41@ConstructorParameters({"unused1", "unused2"})42public Simple(@SqeDescriptorKey("CONSTRUCTOR PARAMETER unused1")int unused1,43@SqeDescriptorKey("CONSTRUCTOR PARAMETER unused2")int unused2) {44}4546public String getAttribute() {47return attribute;48}49public void setAttribute(String s) {50attribute = s;51}52public boolean getOperationInvoked() {53return operationInvoked;54}55public boolean getOperation2Invoked() {56return operation2Invoked;57}5859public void operation() {60operationInvoked = true;61return;62}6364public String operation2(int i) {65operation2Invoked = true;66return String.valueOf(i);67}6869public void reset() {70attribute = "initial_value";71operationInvoked = false;72operation2Invoked = false;73}74}757677