FileDocCategorySizeDatePackage
ObjectChangeLogger.javaAPI DocExample2292Thu Dec 15 21:27:46 GMT 2005com.oreilly.jent.jndi

ObjectChangeLogger

public class ObjectChangeLogger extends Object implements ObjectChangeListener
ObjectChangeLogger: A sample ObjectChangeListener that simply prints information about the object change events it encounters.

Fields Summary
Constructors Summary
public ObjectChangeLogger()

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

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

    Binding bNew = ev.getNewBinding();
    Binding bOld = ev.getOldBinding();
    System.out.println("--> CHANGE: Object of type " + bNew.getClassName() +
                       " changed, previous binding = \"" + bOld.toString() +
                       "\" post-change binding = \"" + bNew.toString() + "\"");