public final ReturnValue execute(final ICommandLine cl) {
        if (cl.hasOption('U')) {
            setUrl(cl.getOptionValue('U'));
        }
        if (cl.hasOption('O')) {
            setObject(cl.getOptionValue('O'));
        }
        if (cl.hasOption('A')) {
            setAttribute(cl.getOptionValue('A'));
        }
        if (cl.hasOption('I')) {
            setInfo_attribute(cl.getOptionValue('I'));
        }
        if (cl.hasOption('J')) {
            setInfo_key(cl.getOptionValue('J'));
        }
        if (cl.hasOption('K')) {
            setAttribute_key(cl.getOptionValue('K'));
        }
        if (cl.hasOption('w')) {
            setWarning(cl.getOptionValue('w'));
        }
        if (cl.hasOption('c')) {
            setCritical(cl.getOptionValue('c'));
        }
        if (cl.hasOption("username")) {
            setUsername(cl.getOptionValue("username"));
        }
        if (cl.hasOption("password")) {
            setPassword(cl.getOptionValue("password"));
        }

        setVerbatim(2);
        // setVerbatim(4);

        try {
            connect();
            execute();
            ByteArrayOutputStream bout = new ByteArrayOutputStream();
            PrintStream ps = new PrintStream(bout);
            Status status = report(ps);
            ps.flush();
            ps.close();
            return new ReturnValue(status, new String(bout.toByteArray()));
        } catch (Exception ex) {
            LOG.warn(getContext(), "An error has occurred during execution " + "of the CHECK_JMX plugin : " + ex.getMessage(), ex);
            ByteArrayOutputStream bout = new ByteArrayOutputStream();
            PrintStream ps = new PrintStream(bout);
            Status status = report(ex, ps);
            ps.flush();
            ps.close();
            return new ReturnValue(status, new String(bout.toByteArray()));
        } finally {
            try {
                disconnect();
            } catch (IOException e) {
                LOG.warn(getContext(), "An error has occurred during execution (disconnect) of the CHECK_JMX plugin : " + e.getMessage(), e);
//                ByteArrayOutputStream bout = new ByteArrayOutputStream();
//                PrintStream ps = new PrintStream(bout);
//
//                Status status = report(e, ps);
//                ps.flush();
//                ps.close();
//                return new ReturnValue(status, new String(bout.toByteArray()));
            }
        }
    }
public final ReturnValue execute ( final ICommandLine cl ) { if ( cl . hasOption ( 'U' ) ) { setUrl ( cl . getOptionValue ( 'U' ) ) ; } if ( cl . hasOption ( 'O' ) ) { setObject ( cl . getOptionValue ( 'O' ) ) ; } if ( cl . hasOption ( 'A' ) ) { setAttribute ( cl . getOptionValue ( 'A' ) ) ; } if ( cl . hasOption ( 'I' ) ) { setInfo_attribute ( cl . getOptionValue ( 'I' ) ) ; } if ( cl . hasOption ( 'J' ) ) { setInfo_key ( cl . getOptionValue ( 'J' ) ) ; } if ( cl . hasOption ( 'K' ) ) { setAttribute_key ( cl . getOptionValue ( 'K' ) ) ; } if ( cl . hasOption ( 'w' ) ) { setWarning ( cl . getOptionValue ( 'w' ) ) ; } if ( cl . hasOption ( 'c' ) ) { setCritical ( cl . getOptionValue ( 'c' ) ) ; } if ( cl . hasOption ( "username" ) ) { setUsername ( cl . getOptionValue ( "username" ) ) ; } if ( cl . hasOption ( "password" ) ) { setPassword ( cl . getOptionValue ( "password" ) ) ; } setVerbatim ( 2 ) ; try { connect ( ) ; execute ( ) ; ByteArrayOutputStream bout = new ByteArrayOutputStream ( ) ; PrintStream ps = new PrintStream ( bout ) ; Status status = report ( ps ) ; ps . flush ( ) ; ps . close ( ) ; return new ReturnValue ( status , new String ( bout . toByteArray ( ) ) ) ; } catch ( Exception ex ) { LOG . warn ( getContext ( ) , "An error has occurred during execution " + "of the CHECK_JMX plugin : " + ex . getMessage ( ) , ex ) ; ByteArrayOutputStream bout = new ByteArrayOutputStream ( ) ; PrintStream ps = new PrintStream ( bout ) ; Status status = report ( ex , ps ) ; ps . flush ( ) ; ps . close ( ) ; return new ReturnValue ( status , new String ( bout . toByteArray ( ) ) ) ; } finally { try { disconnect ( ) ; } catch ( IOException e ) { LOG . warn ( getContext ( ) , "An error has occurred during execution (disconnect) of the CHECK_JMX plugin : " + e . getMessage ( ) , e ) ; } } }
Executes the plugin.

@param cl
The command line
@return the result of the execution