Package org.jitterbit.util.net

Examples of org.jitterbit.util.net.CommandListener


*/
public class KongaCommandSocketListenerTest {

    public static void main(String[] args) {
        // Use scheduler port for testing...
        CommandListener listener = new KongaCommandSocketListener(46906, "Scheduler");
        listener.registerCommandHandler("bubba", null);

        CommandHandler dummy = new CommandHandler() {

            @Override
            public CommandResult handleCommand(Command command) {
                KongaCommandResult result = new KongaCommandResult(command.getCommandName());
                result.addReturnValue("3");
                result.addReturnValue("Simulating Scheduler using Java....");
                return result;
            }
        };

        listener.registerCommandHandler("GetStatus", dummy);

        try {
            listener.startListening();
            Thread.sleep(6000);
            listener.stopListening();
        } catch (InterruptedException e) {
            e.printStackTrace();
        } catch (Exception e) {
            System.err.println(e.getMessage());
        }
View Full Code Here

TOP

Related Classes of org.jitterbit.util.net.CommandListener

Copyright © 2018 www.massapicom. 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.