001    /** 
002     * 
003     * Copyright 2004 Protique Ltd
004     * 
005     * Licensed under the Apache License, Version 2.0 (the "License"); 
006     * you may not use this file except in compliance with the License. 
007     * You may obtain a copy of the License at 
008     * 
009     * http://www.apache.org/licenses/LICENSE-2.0
010     * 
011     * Unless required by applicable law or agreed to in writing, software
012     * distributed under the License is distributed on an "AS IS" BASIS, 
013     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
014     * See the License for the specific language governing permissions and 
015     * limitations under the License. 
016     * 
017     **/
018    
019    
020    package org.activemq.capacity;
021    
022    
023    /**
024     * A CapacityMonitorEvent is raised to notify that a change has occurred to the 
025     * capacity of  a CapacityMonitor
026     * 
027     * @version $Revision: 1.1.1.1 $
028     */
029    public class CapacityMonitorEvent {
030        private String monitorName;
031        private int capacity;
032    
033        /**
034         * Default Constructor
035         *
036         */
037        public CapacityMonitorEvent() {
038        }
039        
040        /**
041         * 
042         * @param name
043         * @param newCapacity
044         */
045        
046        public CapacityMonitorEvent(String name,int newCapacity){
047            this.monitorName = name;
048            this.capacity = newCapacity;
049        }
050    
051       
052        /**
053         * @return Returns the capacity.
054         */
055        public int getCapacity() {
056            return capacity;
057        }
058        /**
059         * @param capacity The capacity to set.
060         */
061        public void setCapacity(int capacity) {
062            this.capacity = capacity;
063        }
064        /**
065         * @return Returns the monitorName.
066         */
067        public String getMonitorName() {
068            return monitorName;
069        }
070        /**
071         * @param monitorName The monitorName to set.
072         */
073        public void setMonitorName(String monitorName) {
074            this.monitorName = monitorName;
075        }
076        
077        /**
078         * @return a pretty print of this 
079         */
080        public String toString(){
081            return monitorName + ": capacity = " + capacity;
082        }
083    }