( ( ExtendedResponse ) req.getResultResponse() ).setResponse( new byte[0] );
ExtendedResponse resp = ( ExtendedResponse ) req.getResultResponse(); resp.setResponse( new byte[0] );
    public void messageReceived( IoSession session, Object request ) throws Exception    {        ExtendedRequest req = ( ExtendedRequest ) request;        ExtendedOperationHandler handler = ( ExtendedOperationHandler ) handlers.get( req.getOid() );        if ( handler == null )        {            // As long as no extended operations are implemented, send appropriate            // error back to the client.            String msg = "Unrecognized extended operation EXTENSION_OID: " + req.getOid();            LdapResult result = req.getResultResponse().getLdapResult();            result.setResultCode( ResultCodeEnum.PROTOCOLERROR );            result.setErrorMessage( msg );            session.write( req.getResultResponse() );        }        else        {            try            {                handler.handleExtendedOperation( session, SessionRegistry.getSingleton(), req );            }            catch ( Exception e )            {                LdapResult result = req.getResultResponse().getLdapResult();                result.setResultCode( ResultCodeEnum.OTHER );                result.setErrorMessage( "Extended operation handler for the specified EXTENSION_OID (" + req.getOid()                    + ") has failed to process your request:\n" + ExceptionUtils.getStackTrace( e ) );                ( ( ExtendedResponse ) req.getResultResponse() ).setResponse( new byte[0] );                session.write( req.getResultResponse() );            }        }    }