Package org.cyclopsgroup.jmxterm.cmd

Source Code of org.cyclopsgroup.jmxterm.cmd.QuitCommand

package org.cyclopsgroup.jmxterm.cmd;

import java.io.IOException;

import org.cyclopsgroup.jcli.annotation.Cli;
import org.cyclopsgroup.jmxterm.Command;
import org.cyclopsgroup.jmxterm.Session;

/**
* Command to terminate the console
*
* @author <a href="mailto:jiaqi.guo@gmail.com">Jiaqi Guo</a>
*/
@Cli( name = "quit", description = "Terminate console and exit" )
public class QuitCommand
    extends Command
{
    /**
     * @inheritDoc
     */
    @Override
    public void execute()
        throws IOException
    {
        Session session = getSession();
        session.disconnect();
        session.close();
        session.output.printMessage( "bye" );
    }
}
TOP

Related Classes of org.cyclopsgroup.jmxterm.cmd.QuitCommand

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.