001    /**
002     *
003     * Copyright 2004 The Apache Software Foundation
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    package org.apache.geronimo.kernel;
018    
019    import java.util.Set;
020    
021    import org.apache.geronimo.gbean.AbstractName;
022    import org.apache.geronimo.gbean.AbstractNameQuery;
023    
024    import javax.management.ObjectName;
025    
026    
027    /**
028     * @version $Rev: 392164 $ $Date: 2006-04-06 19:38:29 -0700 (Thu, 06 Apr 2006) $
029     */
030    public class GBeanNotFoundException extends KernelException {
031        private ObjectName gBeanName;
032        private AbstractName abstractName;
033    
034        public GBeanNotFoundException(ObjectName gBeanName) {
035            super(gBeanName+" not found");
036            this.gBeanName = gBeanName;
037        }
038    
039        public GBeanNotFoundException(ObjectName gBeanName, Throwable cause) {
040            super(gBeanName+" not found", cause);
041            this.gBeanName = gBeanName;
042        }
043    
044        public GBeanNotFoundException(AbstractName abstractName) {
045            super(abstractName + " not found");
046            this.abstractName = abstractName;
047        }
048    
049        public GBeanNotFoundException(String message, Set patterns) {
050            super(message + ": " + patterns);
051        }
052    
053        public GBeanNotFoundException(String message, Throwable cause) {
054            super(message, cause);
055        }
056    
057        public ObjectName getGBeanName() {
058            return gBeanName;
059        }
060    
061        public AbstractName getAbstractName() {
062            return abstractName;
063        }
064    
065        public boolean isGBeanName() {
066            return gBeanName != null;
067        }
068    
069        public boolean isAbstractName() {
070            return abstractName != null;
071        }
072    }