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    package org.activemq.transport;
019    
020    import java.util.Collections;
021    import java.util.EventObject;
022    import java.util.Map;
023    
024    /**
025     * Represents a discovery event containing the details of the service
026     *
027     * @version $Revision: 1.1.1.1 $
028     */
029    public class DiscoveryEvent extends EventObject {
030        private static final long serialVersionUID = -2352750080837918135L;
031        
032        private String serviceName;
033        private Map serviceDetails;
034    
035        public DiscoveryEvent(DiscoveryAgent source, String serviceName) {
036            this(source, serviceName, Collections.EMPTY_MAP);
037        }
038    
039        public DiscoveryEvent(DiscoveryAgent source, String serviceName, Map serviceDetails) {
040            super(source);
041            this.serviceName = serviceName;
042            this.serviceDetails = serviceDetails;
043        }
044    
045        public String getServiceName() {
046            return serviceName;
047        }
048    
049        public Map getServiceDetails() {
050            return serviceDetails;
051        }
052        
053        public String toString(){
054            return "DiscoveryEvent: " + serviceName;
055        }
056    }