FileDocCategorySizeDatePackage
NamespaceChangeLogger.javaAPI DocExample2818Thu Dec 15 21:27:20 GMT 2005com.oreilly.jent.jndi

NamespaceChangeLogger

public class NamespaceChangeLogger extends Object implements NamespaceChangeListener
NamespaceChangeLogger: A sample NamespaceChangeListener that simply prints information about the namespace events.

Fields Summary
Constructors Summary
public NamespaceChangeLogger()

Methods Summary
public voidnamingExceptionThrown(javax.naming.event.NamingExceptionEvent ev)

    System.out.println("--> ERROR: An error occurred in the naming service:");
    ev.getException().printStackTrace();
  
public voidobjectAdded(javax.naming.event.NamingEvent ev)

    Binding b = ev.getNewBinding();
    System.out.println("--> ADD: Object of type " + b.getClassName() +
                       " added at binding \"" + b.toString() + "\"");
  
public voidobjectRemoved(javax.naming.event.NamingEvent ev)

    Binding b = ev.getOldBinding();
    System.out.println("--> REMOVE: Object of type " + b.getClassName() +
                       " removed from binding \"" + b.toString() + "\"");
  
public voidobjectRenamed(javax.naming.event.NamingEvent ev)

    Binding bNew = ev.getNewBinding();
    Binding bOld = ev.getOldBinding();
    System.out.println("--> RENAME: Object of type " + bNew.getClassName() +
                       " renamed from binding \"" + bOld.toString() +
                       "\" to binding \"" + bNew.toString() + "\"");