01: /**
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * 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: */package org.apache.geronimo.kernel;
17:
18: import java.util.Set;
19:
20: import org.apache.geronimo.gbean.AbstractName;
21: import javax.management.ObjectName;
22:
23: /**
24: * @version $Rev: 519834 $ $Date: 2007-03-18 21:32:05 -0700 (Sun, 18 Mar 2007) $
25: */
26: public class GBeanNotFoundException extends KernelException {
27: private ObjectName gBeanName;
28: private AbstractName abstractName;
29: private Set<AbstractName> matches;
30:
31: public GBeanNotFoundException(ObjectName gBeanName) {
32: super (gBeanName + " not found");
33: this .gBeanName = gBeanName;
34: }
35:
36: public GBeanNotFoundException(ObjectName gBeanName, Throwable cause) {
37: super (gBeanName + " not found", cause);
38: this .gBeanName = gBeanName;
39: }
40:
41: public GBeanNotFoundException(AbstractName abstractName) {
42: super (abstractName + " not found");
43: this .abstractName = abstractName;
44: }
45:
46: public GBeanNotFoundException(String message, Set patterns,
47: Set<AbstractName> matches) {
48: super (message + ": " + patterns);
49: this .matches = matches;
50: }
51:
52: public GBeanNotFoundException(String message, Throwable cause) {
53: super (message, cause);
54: }
55:
56: public ObjectName getGBeanName() {
57: return gBeanName;
58: }
59:
60: public AbstractName getAbstractName() {
61: return abstractName;
62: }
63:
64: public boolean isGBeanName() {
65: return gBeanName != null;
66: }
67:
68: public boolean isAbstractName() {
69: return abstractName != null;
70: }
71:
72: public Set<AbstractName> getMatches() {
73: return matches;
74: }
75:
76: public boolean hasMatches() {
77: return matches != null && matches.size() > 0;
78: }
79: }
|