public final TermIOHandler getHandler() { Iterator<TermIOHandler> handlers = context.getPlugins(TermIOHandler.class).iterator(); if (handlers.hasNext()) { return handlers.next(); } else { return null; } }
/** * Create a new CRaSH. * * @param context the plugin context * @throws NullPointerException if the context argument is null */ public CRaSH(PluginContext context) throws NullPointerException { this.context = context; this.scriptResolver = new LanguageCommandResolver(context); // Add the resolver plugins for (CommandResolver resolver : context.getPlugins(CommandResolver.class)) { resolvers.add(resolver); } for (Language lang : context.getPlugins(Language.class)) { if (lang.isActive()) { langs.add(lang); } } // resolvers.add(scriptResolver); resolvers.add(SystemResolver.INSTANCE); }
public Command createCommand(String command) { // Just in case command = command.trim(); // log.log(Level.FINE, "About to execute shell command " + command); for (CommandPlugin plugin : pluginContext.getPlugins(CommandPlugin.class)) { Command cmd = plugin.createCommand(command); if (cmd != null) { return cmd; } } return new FailCommand("Unrecognized command " + command); } }
public LanguageCommandResolver(PluginContext context) { // activeCompilers.put("script", ScriptCompiler.getInstance()); // for (Language lang : context.getPlugins(Language.class)) { if (lang.isActive()) { Compiler compiler = lang.getCompiler(); if (compiler != null) { for (String ext : compiler.getExtensions()) { activeCompilers.put(ext, compiler); } } } } this.context = context; }
@Override public Completion complete(ParameterDescriptor parameter, String prefix) throws Exception { ShellSession session = (ShellSession)context.getSession(); Completion.Builder builder = Completion.builder(prefix); for (Language lang : session.getContext().getPlugins(Language.class)) { if (lang.isActive()) { if (lang.getRepl() != null) { String name = lang.getName(); if (name.startsWith(prefix)) { builder.add(name.substring(prefix.length()), true); } } } } return builder.build(); } }
List authentication = getContext().getProperty(AuthenticationPlugin.AUTH); if (authentication != null) { for (AuthenticationPlugin authenticationPlugin : getContext().getPlugins(AuthenticationPlugin.class)) { if (authentication.contains(authenticationPlugin.getName())) { authPlugins.add(authenticationPlugin);
for (SubsystemFactoryPlugin plugin : context.getPlugins(SubsystemFactoryPlugin.class)) { namedFactoryList.add(plugin.getFactory());
} else { Repl found = null; for (Language lang : session.getContext().getPlugins(Language.class)) { if (lang.getName().equals(name)) { if (lang.isActive()) { for (Language lang : session.getContext().getPlugins(Language.class)) { Repl repl = lang.getRepl(); if (repl != null) {
public final TermIOHandler getHandler() { Iterator<TermIOHandler> handlers = context.getPlugins(TermIOHandler.class).iterator(); if (handlers.hasNext()) { return handlers.next(); } else { return null; } }
public final TermIOHandler getHandler() { Iterator<TermIOHandler> handlers = context.getPlugins(TermIOHandler.class).iterator(); if (handlers.hasNext()) { return handlers.next(); } else { return null; } }
public Command createCommand(String command) { // Just in case command = command.trim(); // log.log(Level.FINE, "About to execute shell command " + command); for (CommandPlugin plugin : pluginContext.getPlugins(CommandPlugin.class)) { Command cmd = plugin.createCommand(command); if (cmd != null) { return cmd; } } return new FailCommand("Unrecognized command " + command); } }
public Command createCommand(String command) { // Just in case command = command.trim(); // log.log(Level.FINE, "About to execute shell command " + command); for (CommandPlugin plugin : pluginContext.getPlugins(CommandPlugin.class)) { Command cmd = plugin.createCommand(command); if (cmd != null) { return cmd; } } return new FailCommand("Unrecognized command " + command); } }
public Command createCommand(String command) { // Just in case command = command.trim(); // log.log(Level.FINE, "About to execute shell command " + command); for (CommandPlugin plugin : pluginContext.getPlugins(CommandPlugin.class)) { Command cmd = plugin.createCommand(command); if (cmd != null) { return cmd; } } return new FailCommand("Unrecognized command " + command); } }
/** * Create a new CRaSH. * * @param context the plugin context * @throws NullPointerException if the context argument is null */ public CRaSH(PluginContext context) throws NullPointerException { this.context = context; this.scriptResolver = new LanguageCommandResolver(context); // Add the resolver plugins for (CommandResolver resolver : context.getPlugins(CommandResolver.class)) { resolvers.add(resolver); } for (Language lang : context.getPlugins(Language.class)) { if (lang.isActive()) { langs.add(lang); } } // resolvers.add(scriptResolver); resolvers.add(SystemResolver.INSTANCE); }
/** * Create a new CRaSH. * * @param context the plugin context * @throws NullPointerException if the context argument is null */ public CRaSH(PluginContext context) throws NullPointerException { this.context = context; this.scriptResolver = new LanguageCommandResolver(context); // Add the resolver plugins for (CommandResolver resolver : context.getPlugins(CommandResolver.class)) { resolvers.add(resolver); } for (Language lang : context.getPlugins(Language.class)) { if (lang.isActive()) { langs.add(lang); } } // resolvers.add(scriptResolver); resolvers.add(SystemResolver.INSTANCE); resolvers.add(ExternalResolver.INSTANCE); }
public LanguageCommandResolver(PluginContext context) { // activeCompilers.put("script", ScriptCompiler.getInstance()); // for (Language lang : context.getPlugins(Language.class)) { if (lang.isActive()) { Compiler compiler = lang.getCompiler(); if (compiler != null) { for (String ext : compiler.getExtensions()) { activeCompilers.put(ext, compiler); } } } } this.context = context; }
public LanguageCommandResolver(PluginContext context) { // activeCompilers.put("script", ScriptCompiler.getInstance()); // for (Language lang : context.getPlugins(Language.class)) { if (lang.isActive()) { Compiler compiler = lang.getCompiler(); if (compiler != null) { for (String ext : compiler.getExtensions()) { activeCompilers.put(ext, compiler); } } } } this.context = context; }
@Override public Completion complete(ParameterDescriptor parameter, String prefix) throws Exception { ShellSession session = (ShellSession)context.getSession(); Completion.Builder builder = Completion.builder(prefix); for (Language lang : session.getContext().getPlugins(Language.class)) { if (lang.isActive()) { if (lang.getRepl() != null) { String name = lang.getName(); if (name.startsWith(prefix)) { builder.add(name.substring(prefix.length()), true); } } } } return builder.build(); } }
@Override public Completion complete(ParameterDescriptor parameter, String prefix) throws Exception { ShellSession session = (ShellSession)context.getSession(); Completion.Builder builder = Completion.builder(prefix); for (Language lang : session.getContext().getPlugins(Language.class)) { if (lang.isActive()) { if (lang.getRepl() != null) { String name = lang.getName(); if (name.startsWith(prefix)) { builder.add(name.substring(prefix.length()), true); } } } } return builder.build(); } }
for (SubsystemFactoryPlugin plugin : context.getPlugins(SubsystemFactoryPlugin.class)) { namedFactoryList.add(plugin.getFactory());