javax.naming.event
Interface NamingListener

All Superinterfaces:
EventListener sample code for java.util.EventListener definition code for java.util.EventListener
All Known Subinterfaces:
NamespaceChangeListener sample code for javax.naming.event.NamespaceChangeListener definition code for javax.naming.event.NamespaceChangeListener , ObjectChangeListener sample code for javax.naming.event.ObjectChangeListener definition code for javax.naming.event.ObjectChangeListener , UnsolicitedNotificationListener sample code for javax.naming.ldap.UnsolicitedNotificationListener definition code for javax.naming.ldap.UnsolicitedNotificationListener

public interface NamingListener
extends EventListener sample code for java.util.EventListener definition code for java.util.EventListener

This interface is the root of listener interfaces that handle NamingEvents. It does not make sense for a listener to implement just this interface. A listener typically implements a subinterface of NamingListener, such as ObjectChangeListener or NamespaceChangeListener.

This interface contains a single method, namingExceptionThrown(), that must be implemented so that the listener can be notified of exceptions that are thrown (by the service provider) while gathering information about the events that they're interested in. When this method is invoked, the listener has been automatically deregistered from the EventContext with which it has registered.

For example, suppose a listener implements ObjectChangeListener and registers with a EventContext. Then, if the connection to the server is subsequently broken, the listener will receive a NamingExceptionEvent and may take some corrective action, such as notifying the user of the application.

Since:
1.3
See Also:
NamingEvent sample code for javax.naming.event.NamingEvent definition code for javax.naming.event.NamingEvent , NamingExceptionEvent sample code for javax.naming.event.NamingExceptionEvent definition code for javax.naming.event.NamingExceptionEvent , EventContext sample code for javax.naming.event.EventContext definition code for javax.naming.event.EventContext , EventDirContext sample code for javax.naming.event.EventDirContext definition code for javax.naming.event.EventDirContext

Method Summary
 void namingExceptionThrown sample code for javax.naming.event.NamingListener.namingExceptionThrown(javax.naming.event.NamingExceptionEvent) definition code for javax.naming.event.NamingListener.namingExceptionThrown(javax.naming.event.NamingExceptionEvent) (NamingExceptionEvent sample code for javax.naming.event.NamingExceptionEvent definition code for javax.naming.event.NamingExceptionEvent  evt)
          Called when a naming exception is thrown while attempting to fire a NamingEvent.
 

Method Detail

namingExceptionThrown sample code for javax.naming.event.NamingListener.namingExceptionThrown(javax.naming.event.NamingExceptionEvent) definition code for javax.naming.event.NamingListener.namingExceptionThrown(javax.naming.event.NamingExceptionEvent)

void namingExceptionThrown(NamingExceptionEvent sample code for javax.naming.event.NamingExceptionEvent definition code for javax.naming.event.NamingExceptionEvent  evt)
Called when a naming exception is thrown while attempting to fire a NamingEvent.

Parameters:
evt - The nonnull event.