use of org.apache.karaf.instance.core.internal.InstanceServiceImpl in project karaf by apache.
the class Activator method doStart.
@Override
protected void doStart() throws Exception {
InstanceService instanceService = new InstanceServiceImpl();
register(InstanceService.class, instanceService);
RegexCommandLoggingFilter filter = new RegexCommandLoggingFilter();
filter.addCommandOption("--password", "connect");
filter.addCommandOption("-p", "connect");
register(CommandLoggingFilter.class, filter);
InstancesMBeanImpl mbean = new InstancesMBeanImpl(instanceService);
registerMBean(mbean, "type=instance");
}
use of org.apache.karaf.instance.core.internal.InstanceServiceImpl 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();
}
Aggregations