author | smarks |
Tue, 28 Mar 2017 12:10:20 -0700 | |
changeset 47412 | 194f4c32678b |
parent 47216 | 71c04702a3d5 |
permissions | -rw-r--r-- |
2 | 1 |
/* |
5506 | 2 |
* Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved. |
2 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
2 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
2 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5506 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
2 | 24 |
*/ |
25 |
||
26 |
package javax.naming.event; |
|
27 |
||
28 |
import javax.naming.NamingException; |
|
29 |
||
30 |
/** |
|
31 |
* This class represents an event fired when the procedures/processes |
|
32 |
* used to collect information for notifying listeners of |
|
32029
a5538163e144
8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents:
25859
diff
changeset
|
33 |
* {@code NamingEvent}s threw a {@code NamingException}. |
2 | 34 |
* This can happen, for example, if the server which the listener is using |
32029
a5538163e144
8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents:
25859
diff
changeset
|
35 |
* aborts subsequent to the {@code addNamingListener()} call. |
2 | 36 |
* |
37 |
* @author Rosanna Lee |
|
38 |
* @author Scott Seligman |
|
39 |
* |
|
40 |
* @see NamingListener#namingExceptionThrown |
|
41 |
* @see EventContext |
|
42 |
* @since 1.3 |
|
43 |
*/ |
|
44 |
||
45 |
public class NamingExceptionEvent extends java.util.EventObject { |
|
46 |
/** |
|
47 |
* Contains the exception that was thrown |
|
48 |
* @serial |
|
49 |
*/ |
|
50 |
private NamingException exception; |
|
51 |
||
52 |
/** |
|
32029
a5538163e144
8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents:
25859
diff
changeset
|
53 |
* Constructs an instance of {@code NamingExceptionEvent} using |
a5538163e144
8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents:
25859
diff
changeset
|
54 |
* the context in which the {@code NamingException} was thrown and the exception |
2 | 55 |
* that was thrown. |
56 |
* |
|
57 |
* @param source The non-null context in which the exception was thrown. |
|
32029
a5538163e144
8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents:
25859
diff
changeset
|
58 |
* @param exc The non-null {@code NamingException} that was thrown. |
2 | 59 |
* |
60 |
*/ |
|
61 |
public NamingExceptionEvent(EventContext source, NamingException exc) { |
|
62 |
super(source); |
|
63 |
exception = exc; |
|
64 |
} |
|
65 |
||
66 |
/** |
|
67 |
* Retrieves the exception that was thrown. |
|
68 |
* @return The exception that was thrown. |
|
69 |
*/ |
|
70 |
public NamingException getException() { |
|
71 |
return exception; |
|
72 |
} |
|
73 |
||
74 |
/** |
|
32029
a5538163e144
8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents:
25859
diff
changeset
|
75 |
* Retrieves the {@code EventContext} that fired this event. |
a5538163e144
8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents:
25859
diff
changeset
|
76 |
* This returns the same object as {@code EventObject.getSource()}. |
a5538163e144
8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents:
25859
diff
changeset
|
77 |
* @return The non-null {@code EventContext} that fired this event. |
2 | 78 |
*/ |
79 |
public EventContext getEventContext() { |
|
80 |
return (EventContext)getSource(); |
|
81 |
} |
|
82 |
||
83 |
/** |
|
32029
a5538163e144
8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents:
25859
diff
changeset
|
84 |
* Invokes the {@code namingExceptionThrown()} method on |
2 | 85 |
* a listener using this event. |
86 |
* @param listener The non-null naming listener on which to invoke |
|
87 |
* the method. |
|
88 |
*/ |
|
89 |
public void dispatch(NamingListener listener) { |
|
90 |
listener.namingExceptionThrown(this); |
|
91 |
} |
|
92 |
||
93 |
private static final long serialVersionUID = -4877678086134736336L; |
|
94 |
} |