CapacityMonitorEvent xref

View Javadoc

    1   /***
    2    *
    3    * Copyright 2004 Protique Ltd
    4    *
    5    * Licensed under the Apache License, Version 2.0 (the "License");
    6    * you may not use this file except in compliance with the License.
    7    * You may obtain a copy of the License at
    8    *
    9    * http://www.apache.org/licenses/LICENSE-2.0
    10   *
    11   * Unless required by applicable law or agreed to in writing, software
    12   * distributed under the License is distributed on an "AS IS" BASIS,
    13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    14   * See the License for the specific language governing permissions and
    15   * limitations under the License.
    16   *
    17   **/
    18
    19
    20  package org.codehaus.activemq.capacity;
    21
    22
    23  /***
    24   * A CapacityMonitorEvent is raised to notify that a change has occurred to the
    25   * capacity of  a CapacityMonitor
    26   *
    27   * @version $Revision: 1.2 $
    28   */
    29  public class CapacityMonitorEvent {
    30      private String monitorName;
    31      private int capacity;
    32
    33      /***
    34       * Default Constructor
    35       *
    36       */
    37      public CapacityMonitorEvent() {
    38      }
    39
    40      /***
    41       *
    42       * @param name
    43       * @param newCapacity
    44       */
    45
    46      public CapacityMonitorEvent(String name,int newCapacity){
    47          this.monitorName = name;
    48          this.capacity = newCapacity;
    49      }
    50
    51
    52      /***
    53       * @return Returns the capacity.
    54       */
    55      public int getCapacity() {
    56          return capacity;
    57      }
    58      /***
    59       * @param capacity The capacity to set.
    60       */
    61      public void setCapacity(int capacity) {
    62          this.capacity = capacity;
    63      }
    64      /***
    65       * @return Returns the monitorName.
    66       */
    67      public String getMonitorName() {
    68          return monitorName;
    69      }
    70      /***
    71       * @param monitorName The monitorName to set.
    72       */
    73      public void setMonitorName(String monitorName) {
    74          this.monitorName = monitorName;
    75      }
    76
    77      /***
    78       * @return a pretty print of this
    79       */
    80      public String toString(){
    81          return monitorName + ": capacity = " + capacity;
    82      }
    83  }