001 /**
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements. See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License. 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 javax.management.ObjectName;
023
024
025 /**
026 * @version $Rev: 487175 $ $Date: 2006-12-14 03:10:31 -0800 (Thu, 14 Dec 2006) $
027 */
028 public class GBeanNotFoundException extends KernelException {
029 private ObjectName gBeanName;
030 private AbstractName abstractName;
031
032 public GBeanNotFoundException(ObjectName gBeanName) {
033 super(gBeanName+" not found");
034 this.gBeanName = gBeanName;
035 }
036
037 public GBeanNotFoundException(ObjectName gBeanName, Throwable cause) {
038 super(gBeanName+" not found", cause);
039 this.gBeanName = gBeanName;
040 }
041
042 public GBeanNotFoundException(AbstractName abstractName) {
043 super(abstractName + " not found");
044 this.abstractName = abstractName;
045 }
046
047 public GBeanNotFoundException(String message, Set patterns) {
048 super(message + ": " + patterns);
049 }
050
051 public GBeanNotFoundException(String message, Throwable cause) {
052 super(message, cause);
053 }
054
055 public ObjectName getGBeanName() {
056 return gBeanName;
057 }
058
059 public AbstractName getAbstractName() {
060 return abstractName;
061 }
062
063 public boolean isGBeanName() {
064 return gBeanName != null;
065 }
066
067 public boolean isAbstractName() {
068 return abstractName != null;
069 }
070 }