001: /*
002: * JBoss, Home of Professional Open Source.
003: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
004: * as indicated by the @author tags. See the copyright.txt file in the
005: * distribution for a full listing of individual contributors.
006: *
007: * This is free software; you can redistribute it and/or modify it
008: * under the terms of the GNU Lesser General Public License as
009: * published by the Free Software Foundation; either version 2.1 of
010: * the License, or (at your option) any later version.
011: *
012: * This software is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this software; if not, write to the Free
019: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
021: */
022: package test.compliance.standard.support;
023:
024: import javax.management.MBeanInfo;
025: import javax.management.MBeanAttributeInfo;
026: import javax.management.MBeanConstructorInfo;
027: import javax.management.MBeanOperationInfo;
028: import javax.management.MBeanParameterInfo;
029: import javax.management.StandardMBean;
030:
031: public class MyStandardMBean extends StandardMBean implements
032: MyManagementInterface {
033: public static final String MBEAN_CLASSNAME = "MBEAN_CLASSNAME";
034: public static final String MBEAN_DESCRIPTION = "MBEAN_DESCRIPTION";
035: public static final String MBEAN_ATTRIBUTE_DESCRIPTION = "MBEAN_ATTRIBUTE_DESCRIPTION";
036: public static final String MBEAN_CONSTRUCTOR_DESCRIPTION = "MBEAN_CONSTRUCTOR_DESCRIPTION";
037: public static final String MBEAN_OPERATION_DESCRIPTION = "MBEAN_OPERATION_DESCRIPTION";
038: public static final String MBEAN_PARAMETER = "MBEAN_PARAMETER";
039: public static final String MBEAN_PARAMETER_DESCRIPTION = "MBEAN_PARAMETER_DESCRIPTION";
040:
041: public MyStandardMBean() throws Exception {
042: super (MyManagementInterface.class);
043: }
044:
045: public MyStandardMBean(String param1, String param2)
046: throws Exception {
047: super (MyManagementInterface.class);
048: }
049:
050: public String getAnAttribute() {
051: return null;
052: }
053:
054: public void setAnAttribute(String value) {
055: }
056:
057: public void anOperation(String param1, String param2) {
058: }
059:
060: protected String getClassName(MBeanInfo info) {
061: return MBEAN_CLASSNAME;
062: }
063:
064: protected String getDescription(MBeanInfo info) {
065: return MBEAN_DESCRIPTION;
066: }
067:
068: protected String getDescription(MBeanAttributeInfo info) {
069: return MBEAN_ATTRIBUTE_DESCRIPTION + info.getName();
070: }
071:
072: protected String getDescription(MBeanConstructorInfo info) {
073: return MBEAN_CONSTRUCTOR_DESCRIPTION
074: + info.getSignature().length;
075: }
076:
077: protected String getDescription(MBeanOperationInfo info) {
078: return MBEAN_OPERATION_DESCRIPTION + info.getName();
079: }
080:
081: protected String getDescription(MBeanConstructorInfo info,
082: MBeanParameterInfo param, int sequence) {
083: return MBEAN_PARAMETER_DESCRIPTION + sequence;
084: }
085:
086: protected String getDescription(MBeanOperationInfo info,
087: MBeanParameterInfo param, int sequence) {
088: return MBEAN_PARAMETER_DESCRIPTION + info.getName() + sequence;
089: }
090:
091: protected String getParameterName(MBeanConstructorInfo info,
092: MBeanParameterInfo param, int sequence) {
093: return MBEAN_PARAMETER + sequence;
094: }
095:
096: protected String getParameterName(MBeanOperationInfo info,
097: MBeanParameterInfo param, int sequence) {
098: return MBEAN_PARAMETER + info.getName() + sequence;
099: }
100:
101: protected int getImpact(MBeanOperationInfo info) {
102: return MBeanOperationInfo.ACTION;
103: }
104: }
|