public void removeConnectionEventListener(ConnectionEventListener listener) {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();

        if (isTraceOn && tc.isEntryEnabled()) 
            Tr.entry(this, tc, "removeConnectionEventListener", listener);

        if (listener == null) {
            NullPointerException nullX = new NullPointerException(
                            "Cannot remove null ConnectionEventListener.");

            if (isTraceOn && tc.isEntryEnabled())
                Tr.exit(this, tc, "removeConnectionEventListener", nullX); 
            throw nullX; 
        }

        // setting the metrics to null here causes a NPE the metrics cannot be set to null
        // until the end of the destroy method.

        // Not synchronized because of the contract that add/remove event listeners will only
        // be used on ManagedConnection create/destroy, when the ManagedConnection is not
        // used by any other threads. 

        // Find matching listener in the array -- then remove it, adjust entries as
        // necessary, and adjust the counter

        // loop through the listeners
        for (int i = 0; i < numListeners; i++)
            // look for matching listener
            if (listener == ivEventListeners[i]) {
                // remove the matching listener, but don't leave a gap in the array -- the order of
                // the listeners in the array doesn't matter, so move the last listener to fill the
                // gap left by the remove, if necessary
                ivEventListeners[i] = ivEventListeners[--numListeners];
                ivEventListeners[numListeners] = null;

                if (isTraceOn && tc.isEntryEnabled())
                    Tr.exit(this, tc, "removeConnectionEventListener"); 
                return;
            }

        if (isTraceOn && tc.isEntryEnabled()) 
            Tr.exit(this, tc, "removeConnectionEventListener", "Listener not found for remove.");
    }
public void removeConnectionEventListener ( ConnectionEventListener listener ) { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( this , tc , "removeConnectionEventListener" , listener ) ; if ( listener == null ) { NullPointerException nullX = new NullPointerException ( "Cannot remove null ConnectionEventListener." ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "removeConnectionEventListener" , nullX ) ; throw nullX ; } for ( int i = 0 ; i < numListeners ; i ++ ) if ( listener == ivEventListeners [ i ] ) { ivEventListeners [ i ] = ivEventListeners [ -- numListeners ] ; ivEventListeners [ numListeners ] = null ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "removeConnectionEventListener" ) ; return ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "removeConnectionEventListener" , "Listener not found for remove." ) ; }
Removes an already registered connection event listener from the
ManagedConnection instance.

@param listener - already registered connection event listener to be removed