Thread.currentThread().getContextClassLoader()); ctx.refresh(); CRaSH crash = new CRaSH(ctx); StringBuilder buffer = new StringBuilder(); for (Map.Entry<String, String> s : crash.getCommands()) { Command<?> cmd = crash.getCommand(s.getKey()); CommandDescriptor<?> desc = cmd.getDescriptor(); buffer.append("== ").append(desc.getName()).append("\n").append("\n");
public Shell createShell() { return crash.createSession(null); } }
public Map<String, Object> getAttributes() { return session.crash.getContext().getAttributes(); }
public Command<?> getCommand(String name) throws CommandException { return crash.getCommand(name); }
Thread.currentThread().getContextClassLoader()); ctx.refresh(); CRaSH crash = new CRaSH(ctx); for (String s : ctx.listResourceId(ResourceKind.COMMAND)) { ShellCommand cmd = crash.getCommand(s); StringBuilder man = new StringBuilder(); if (cmd instanceof CRaSHCommand) {
@Override public void init() { PluginContext context = getContext(); crash = new CRaSH(context); }
public Iterable<Map.Entry<String, String>> getCommands() { return crash.getCommands(); }
public static PipeLineClosure resolveProperty(final InvocationContext context, final String property) { CRaSH crash = (CRaSH)context.getSession().get("crash"); if (crash != null) { try { Command<?> cmd = crash.getCommand(property); if (cmd != null) { return new PipeLineClosure(context, property, cmd); } else { return null; } } catch (CommandException e) { throw new InvokerInvocationException(e); } } else { return null; } }
private TestPluginLifeCycle(PluginDiscovery discovery, ClassLoader classLoader) throws Exception { this.attributes = new HashMap<String, Object>(); this.commands = new RAMDriver(); this.context = new PluginContext( discovery, attributes, new FS().mount(classLoader,Path.get("/crash/commands/")).mount(commands), new FS().mount(classLoader,Path.get("/crash/")), classLoader); this.crash = new CRaSH(context); }
public Iterable<Map.Entry<String, String>> getCommands() { return crash.getCommands(); }
Thread.currentThread().getContextClassLoader()); ctx.refresh(); CRaSH crash = new CRaSH(ctx); StringBuilder buffer = new StringBuilder(); for (Map.Entry<String, String> s : crash.getCommands()) { Command<?> cmd = crash.getCommand(s.getKey()); CommandDescriptor<?> desc = cmd.getDescriptor(); buffer.append("== ").append(desc.getName()).append("\n").append("\n");
public static SafeCallable resolveMethodInvocation(final InvocationContext context, final String name, final Object args) { CRaSH crash = (CRaSH)context.getSession().get("crash"); if (crash != null) { final Command<?> cmd; try { cmd = crash.getCommand(name); } catch (CommandException ce) { throw new InvokerInvocationException(ce); } if (cmd != null) { return new SafeCallable() { @Override public Object call() { PipeLineClosure closure = new PipeLineClosure(context, name, cmd); return closure.call((Object[])args); } }; } } return null; } }
@Override public void init() { PluginContext context = getContext(); crash = new CRaSH(context); }
public Shell create(Principal principal, boolean async) { CRaSHSession session = crash.createSession(principal); if (async) { return new AsyncShell(getContext().getExecutor(), session); } else { return session; } }
public Iterable<Map.Entry<String, String>> getCommands() { return crash.getCommands(); }
public Map<String, Object> getAttributes() { return session.crash.getContext().getAttributes(); }
public Command<?> getCommand(String name) throws CommandException { return crash.getCommand(name); }
@Override public void init() { PluginContext context = getContext(); crash = new CRaSH(context); }
public Shell create(Principal principal, boolean async) { CRaSHSession session = crash.createSession(principal); if (async) { return new AsyncShell(getContext().getExecutor(), session); } else { return session; } }
for (Map.Entry<String, String> command : crash.getCommands()) { try { String desc = command.getValue();