KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > walend > somnifugi > SomniInterruptedException


1 package net.walend.somnifugi;
2
3 /**
4 An exception thrown when the Somni messaging system is interrupted or stopped.
5
6 @author <a HREF="http://walend.net">David Walend</a> <a HREF="mailto:david@walend.net">david@walend.net</a>
7 */

8
9 public class SomniInterruptedException
10     extends SomniException
11 {
12     private static final long serialVersionUID = 0L;
13
14     private SomniMessage lostMessage = null;
15     private SomniDestination destination = null;
16
17     protected SomniInterruptedException(String JavaDoc message)
18     {
19         super(message);
20     }
21
22     protected SomniInterruptedException(Throwable JavaDoc nester)
23     {
24         super(nester);
25     }
26
27     protected SomniInterruptedException(String JavaDoc message, Throwable JavaDoc nester)
28     {
29         super(message,nester);
30     }
31
32     protected SomniInterruptedException(Throwable JavaDoc nester,SomniMessage lostMessage,SomniDestination destination)
33     {
34         super(nester);
35         this.lostMessage = lostMessage;
36         this.destination = destination;
37     }
38
39     public String JavaDoc getMessage()
40     {
41         if(destination==null)
42             {
43                 return super.getMessage();
44             }
45         else
46             {
47                 StringBuffer JavaDoc buffy = new StringBuffer JavaDoc();
48                 
49                 buffy.append(super.getMessage());
50                 buffy.append(" while ");
51                 buffy.append(destination.getName());
52                 buffy.append(" was trying to send ");
53                 buffy.append(lostMessage.toString());
54
55                 return buffy.toString();
56             }
57     }
58
59     public SomniMessage getLostMessage()
60     {
61         return lostMessage;
62     }
63
64     public SomniDestination getDestination()
65     {
66         return destination;
67     }
68 }
69
70 /*
71 Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 David Walend
72 All rights reserved.
73
74 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
75
76 Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
77
78 Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
79
80 Neither the name of the SomnifugiJMS Project, walend.net, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission from David Walend.
81
82 Credits in redistributions in source or binary forms must include a link to http://somnifugi.sourceforge.net .
83
84 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
85 The net.walend.somnifugi.sql92 package is modified code from the openmq project, https://mq.dev.java.net/ , Copyright (c) of Sun, and carries the CDDL license, repeated here: You can obtain a copy of the license at https://glassfish.dev.java.net/public/CDDLv1.0.html. See the License for the specific language governing permissions and limitations under the License.
86
87 =================================================================================
88
89 For more information and the latest version of this software, please see http://somnifugi.sourceforge.net and http://walend.net or email <a HREF="mailto:david@walend.net">david@walend.net</a>.
90
91 */

92
93
94
95
Popular Tags