1 /** 2 * 3 * Copyright 2004 The Apache Software Foundation 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 package org.apache.geronimo.kernel; 18 19 import java.util.Set; 20 21 import org.apache.geronimo.gbean.AbstractName; 22 import org.apache.geronimo.gbean.AbstractNameQuery; 23 24 import javax.management.ObjectName; 25 26 27 /** 28 * @version $Rev: 392164 $ $Date: 2006-04-06 19:38:29 -0700 (Thu, 06 Apr 2006) $ 29 */ 30 public class GBeanNotFoundException extends KernelException { 31 private ObjectName gBeanName; 32 private AbstractName abstractName; 33 34 public GBeanNotFoundException(ObjectName gBeanName) { 35 super(gBeanName+" not found"); 36 this.gBeanName = gBeanName; 37 } 38 39 public GBeanNotFoundException(ObjectName gBeanName, Throwable cause) { 40 super(gBeanName+" not found", cause); 41 this.gBeanName = gBeanName; 42 } 43 44 public GBeanNotFoundException(AbstractName abstractName) { 45 super(abstractName + " not found"); 46 this.abstractName = abstractName; 47 } 48 49 public GBeanNotFoundException(String message, Set patterns) { 50 super(message + ": " + patterns); 51 } 52 53 public GBeanNotFoundException(String message, Throwable cause) { 54 super(message, cause); 55 } 56 57 public ObjectName getGBeanName() { 58 return gBeanName; 59 } 60 61 public AbstractName getAbstractName() { 62 return abstractName; 63 } 64 65 public boolean isGBeanName() { 66 return gBeanName != null; 67 } 68 69 public boolean isAbstractName() { 70 return abstractName != null; 71 } 72 }