001: /*
002: * Copyright (C) The MX4J Contributors.
003: * All rights reserved.
004: *
005: * This software is distributed under the terms of the MX4J License version 1.0.
006: * See the terms of the MX4J License in the documentation provided with this software.
007: */
008: package mx4j.examples.tools.xdoclet;
009:
010: /**
011: * Sample MBean implementation.
012: *
013: * @version $Revision: 1.1 $
014: * @jmx:mbean name="mx4j:name=My MBean" description="My wonderful service."
015: * @jmx:mlet-entry archive="MyApp.jar" codebase="../lib"
016: */
017: public class MyService implements MyServiceMBean {
018: protected int status = 0;
019: protected String m_dummy = null;
020:
021: /**
022: * Default constructor.
023: *
024: * @jmx:managed-constructor description="Default constructor."
025: */
026: public MyService() {
027: }
028:
029: /**
030: * Constructor.
031: *
032: * @param type the type,
033: * @param status the status.
034: * @jmx:managed-constructor description="Build the service."
035: * @jmx:managed-constructor-parameter name="type" position="0" description="The type."
036: * @jmx:managed-constructor-parameter name="status" position="1" description="The status."
037: */
038: public MyService(String type, int status) {
039: }
040:
041: /**
042: * Start my service.
043: *
044: * @jmx:managed-operation description="Starts the service."
045: */
046: public void start() {
047: }
048:
049: /**
050: * Method that is not an JMX managed operation.
051: */
052: public void stop() {
053: }
054:
055: /**
056: * Echos a string.
057: *
058: * @jmx:managed-operation description="Echoes the string given as a parameter."
059: * @jmx:managed-operation-parameter name="str" position="0" description="The string to echo."
060: */
061: public void echo(String str) {
062: }
063:
064: /**
065: * Does some crazy stuff.
066: *
067: * @jmx:managed-operation description="Do some crazy stuff."
068: * @jmx:managed-operation-parameter name="firstObject" position="0" description="My first object."
069: * @jmx:managed-operation-parameter name="secondObject" position="1" description="My second object."
070: */
071: public int doSomeCrazyStuff(Object firstObject, Object secondObject) {
072: return -1;
073: }
074:
075: /**
076: * Sets the status.
077: *
078: * @jmx:managed-attribute description="My Status."
079: */
080: public void setStatus(int status) {
081: this .status = status;
082: }
083:
084: /**
085: * Gets the dummy variable.
086: *
087: * @jmx:managed-attribute description="My dummy attribute."
088: */
089: public String getDummy() {
090: return "";
091: }
092:
093: /**
094: * Sets the dummy variable.
095: *
096: * @jmx:managed-attribute description="This description should be ignored because of the getter."
097: */
098: public void setDummy(String dummy) {
099: }
100:
101: }
|