Package org.jboss.as.cli.handlers.module
Class ASModuleHandler
- java.lang.Object
-
- org.jboss.as.cli.handlers.CommandHandlerWithArguments
-
- org.jboss.as.cli.handlers.CommandHandlerWithHelp
-
- org.jboss.as.cli.handlers.module.ASModuleHandler
-
- All Implemented Interfaces:
CommandHandler
public class ASModuleHandler extends CommandHandlerWithHelp
- Author:
- Alexey Loubyansky
-
-
Field Summary
-
Fields inherited from class org.jboss.as.cli.handlers.CommandHandlerWithHelp
helpArg
-
-
Constructor Summary
Constructors Constructor Description ASModuleHandler(CommandContext ctx)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddModule(CommandContext ctx, ParsedCommandLine parsedCmd)static voidcopy(File source, File target)static org.jboss.staxmapper.XMLExtendedStreamWritercreate(XMLStreamWriter writer)protected voiddeleteRecursively(File file)protected voiddoHandle(CommandContext ctx)protected FilegetModulePath(File modulesDir, String moduleName, String slot)protected FilegetModulesDir(CommandContext ctx)booleanisAvailable(CommandContext ctx)Checks whether the command is available in the current context (e.g. some commands require connection with the controller, some are available only in the batch mode, etc)-
Methods inherited from class org.jboss.as.cli.handlers.CommandHandlerWithHelp
displayHelp, handle, isBatchMode, printHelp, printList
-
Methods inherited from class org.jboss.as.cli.handlers.CommandHandlerWithArguments
addArgument, getArgument, getArguments, getArgumentsMap, hasArgument, hasArgument, recognizeArguments
-
-
-
-
Constructor Detail
-
ASModuleHandler
public ASModuleHandler(CommandContext ctx)
-
-
Method Detail
-
isAvailable
public boolean isAvailable(CommandContext ctx)
Description copied from interface:CommandHandlerChecks whether the command is available in the current context (e.g. some commands require connection with the controller, some are available only in the batch mode, etc)- Specified by:
isAvailablein interfaceCommandHandler- Overrides:
isAvailablein classCommandHandlerWithHelp- Parameters:
ctx- current context- Returns:
- true if the command can be executed in the current context, false - otherwise.
-
doHandle
protected void doHandle(CommandContext ctx) throws CommandLineException
- Specified by:
doHandlein classCommandHandlerWithHelp- Throws:
CommandLineException
-
addModule
protected void addModule(CommandContext ctx, ParsedCommandLine parsedCmd) throws CommandLineException
- Throws:
CommandLineException
-
deleteRecursively
protected void deleteRecursively(File file) throws CommandLineException
- Throws:
CommandLineException
-
getModulePath
protected File getModulePath(File modulesDir, String moduleName, String slot) throws CommandLineException
- Throws:
CommandLineException
-
getModulesDir
protected File getModulesDir(CommandContext ctx) throws CommandLineException
- Throws:
CommandLineException
-
create
public static org.jboss.staxmapper.XMLExtendedStreamWriter create(XMLStreamWriter writer) throws CommandLineException
- Throws:
CommandLineException
-
copy
public static void copy(File source, File target) throws CommandLineException
- Throws:
CommandLineException
-
-