KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > beehive > controls > spi > svc > InterceptorPivotException


1 package org.apache.beehive.controls.spi.svc;
2
3 /*
4  * Copyright 2004 The Apache Software Foundation.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  * $Header:$
19  */

20
21 /**
22  * The InterceptorPivotException class declares a checked exception that is thrown by
23  * an Interceptor upon pivoting. For example, if an interceptor wishes to stop a method
24  * from executing further and return a value, it can throw this exception and embed in
25  * the exception the return value that it wishes the method to return.
26  */

27 public class InterceptorPivotException extends Exception JavaDoc
28 {
29     /**
30      * Comment for <code>serialVersionUID</code>
31      */

32     private static final long serialVersionUID = 1L;
33     private Object JavaDoc returnValue;
34     private String JavaDoc interceptorName;
35     
36     /**
37      * Constructs a InterceptorPivotException object with the specified interceptor.
38      *
39      * @param interceptorName name of the interceptor that generated this exception
40      */

41     public InterceptorPivotException(String JavaDoc interceptorName)
42     {
43         super();
44         this.interceptorName = interceptorName;
45     }
46
47     /**
48      * Constructs a InterceptorPivotException object with the specified interceptor
49      * and return value for the method that is intercepted.
50      *
51      * @param interceptorName name of the interceptor that generated this exception
52      * @param returnValue the return value of the method that is intercepted.
53      */

54     public InterceptorPivotException(String JavaDoc interceptorName, Object JavaDoc returnValue)
55     {
56         super();
57         this.interceptorName = interceptorName;
58         this.returnValue = returnValue;
59     }
60     
61     /**
62      * Constructs a ServiceException object using the specified interceptor, the
63      * return value for the method that is intercepted and message.
64      *
65      * @param interceptorName name of the interceptor that generated this exception
66      * @param returnValue the return value of the method that is intercepted.
67      * @param message The message to use.
68      */

69     public InterceptorPivotException(String JavaDoc interceptorName, Object JavaDoc returnValue, String JavaDoc message)
70     {
71         super(message);
72         this.interceptorName = interceptorName;
73         this.returnValue = returnValue;
74     }
75
76     /**
77      * Constructs a ServiceException object using the specified interceptor and
78      * a message.
79      *
80      * @param interceptorName name of the interceptor that generated this exception
81      * @param message The message to use.
82      */

83     public InterceptorPivotException(String JavaDoc interceptorName, String JavaDoc message)
84     {
85         super(message);
86         this.interceptorName = interceptorName;
87     }
88
89     /**
90      * @return Returns the interceptorName.
91      */

92     public String JavaDoc getInterceptorName()
93     {
94         return interceptorName;
95     }
96     /**
97      * @return Returns the returnValue.
98      */

99     public Object JavaDoc getReturnValue()
100     {
101         return returnValue;
102     }
103     /**
104      * @param interceptorName The interceptorName to set.
105      */

106     public void setInterceptorName(String JavaDoc interceptorName)
107     {
108         this.interceptorName = interceptorName;
109     }
110 }
111
Popular Tags