else if ( listener instanceof ObjectChangeListener ) { ObjectChangeListener oclistener = ( ObjectChangeListener ) listener; Binding binding = new Binding( upName, entry, false ); oclistener.objectChanged( new NamingEvent( rec.getEventContext(), NamingEvent.OBJECT_ADDED, null, binding, entry ) ); } else { throw new IllegalStateException( "unrecognized event listener type: " + listener.getClass() ); }
    public void add( NextInterceptor next, String upName, Name normName, Attributes entry ) throws NamingException    {        super.add( next, upName, normName, entry );        Set selecting = getSelectingSources( normName, entry );        if ( selecting.isEmpty() )        {            return;        }        Iterator list = selecting.iterator();        while ( list.hasNext() )        {            EventSourceRecord rec = ( EventSourceRecord ) list.next();            NamingListener listener = rec.getNamingListener();            if ( listener instanceof NamespaceChangeListener )            {                NamespaceChangeListener nclistener = ( NamespaceChangeListener ) listener;                Binding binding = new Binding( upName, entry, false );                nclistener.objectAdded( new NamingEvent( rec.getEventContext(),                        NamingEvent.OBJECT_ADDED, null, binding, entry ) );            }            else if ( listener instanceof ObjectChangeListener )            {                ObjectChangeListener oclistener = ( ObjectChangeListener ) listener;                Binding binding = new Binding( upName, entry, false );                oclistener.objectChanged( new NamingEvent( rec.getEventContext(),                        NamingEvent.OBJECT_ADDED, null, binding, entry ) );            }            else            {                throw new IllegalStateException( "unrecognized event listener type: " + listener.getClass() );            }        }    }