Package org.infinispan.cli.commands.server

Source Code of org.infinispan.cli.commands.server.AbstractServerCommand

package org.infinispan.cli.commands.server;

import org.infinispan.cli.CommandBuffer;
import org.infinispan.cli.Context;
import org.infinispan.cli.commands.AbstractCommand;
import org.infinispan.cli.commands.ProcessedCommand;
import org.infinispan.cli.commands.ServerCommand;

public abstract class AbstractServerCommand extends AbstractCommand implements ServerCommand {

   @Override
   public boolean isAvailable(Context context) {
      return context.isConnected();
   }

   @Override
   public void execute(Context context, ProcessedCommand commandLine) {
      CommandBuffer commandBuffer = context.getCommandBuffer();
      if(commandBuffer.addCommand(commandLine.getCommandLine(), nesting())) {
         context.execute();
      }
   }
}
TOP

Related Classes of org.infinispan.cli.commands.server.AbstractServerCommand

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.