Search in sources :

Example 1 with DefaultActionPreparator

use of org.apache.karaf.shell.impl.action.command.DefaultActionPreparator in project karaf by apache.

the class Execute method execute.

static void execute(InstanceCommandSupport command, File storageFile, String[] args) throws Exception {
    DefaultActionPreparator dap = new DefaultActionPreparator();
    List<Object> params = new ArrayList<>(Arrays.asList(args));
    // this is the actual command name
    params.remove(0);
    if (!dap.prepare(command, null, params)) {
        return;
    }
    InstanceServiceImpl instanceService = new InstanceServiceImpl();
    instanceService.setStorageLocation(storageFile);
    command.setInstanceService(instanceService);
    command.execute();
}
Also used : InstanceServiceImpl(org.apache.karaf.instance.core.internal.InstanceServiceImpl) DefaultActionPreparator(org.apache.karaf.shell.impl.action.command.DefaultActionPreparator) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)1 InstanceServiceImpl (org.apache.karaf.instance.core.internal.InstanceServiceImpl)1 DefaultActionPreparator (org.apache.karaf.shell.impl.action.command.DefaultActionPreparator)1