Package com.google.gerrit.sshd.SshScope

Examples of com.google.gerrit.sshd.SshScope.Context


  protected Repository repo;

  @Override
  public void start(final Environment env) {
    Context ctx = context.subContext(newSession(), context.getCommandLine());
    final Context old = SshScope.set(ctx);
    try {
      startThread(new ProjectCommandRunnable() {
        @Override
        public void executeParseCommand() throws Exception {
          parseCommandLine();
View Full Code Here


    public void setExitCallback(final ExitCallback callback) {
      this.exit = callback;
    }

    public void setSession(final ServerSession session) {
      this.context = new Context(session.getAttribute(SshSession.KEY), "");
    }
View Full Code Here

    public void setSession(final ServerSession session) {
      this.context = new Context(session.getAttribute(SshSession.KEY), "");
    }

    public void start(final Environment env) throws IOException {
      Context old = SshScope.set(context);
      String message;
      try {
        message = messageFactory.get().getMessage();
      } finally {
        SshScope.set(old);
View Full Code Here

      this.taskName = m.toString();
    }

    @Override
    public void cancel() {
      final Context old = SshScope.set(context);
      try {
        onExit(STATUS_CANCEL);
      } finally {
        SshScope.set(old);
      }
View Full Code Here

    @Override
    public void run() {
      final Thread thisThread = Thread.currentThread();
      final String thisName = thisThread.getName();
      int rc = 0;
      final Context old = SshScope.set(context);
      try {
        context.started = System.currentTimeMillis();
        thisThread.setName("SSH " + taskName);

        if (thunk instanceof ProjectCommandRunnable) {
View Full Code Here

    async.append(event);
  }

  void onExecute(int exitValue) {
    final Context ctx = context.get();
    ctx.finished = System.currentTimeMillis();

    final String commandLine = ctx.getCommandLine();
    String cmd = QuotedString.BOURNE.quote(commandLine);
    if (cmd == commandLine) {
      cmd = "'" + commandLine + "'";
    }
View Full Code Here

      this.exit = callback;
    }

    public void setSession(final ServerSession session) {
      final SshSession s = session.getAttribute(SshSession.KEY);
      this.ctx = new Context(s, commandLine);
    }
View Full Code Here

      this.ctx = new Context(s, commandLine);
    }

    public void start(final Environment env) throws IOException {
      synchronized (this) {
        final Context old = SshScope.set(ctx);
        try {
          cmd = dispatcher.get();
          cmd.setArguments(argv);
          cmd.setInputStream(in);
          cmd.setOutputStream(out);
View Full Code Here

    @Override
    public void destroy() {
      synchronized (this) {
        if (cmd != null) {
          final Context old = SshScope.set(ctx);
          try {
            cmd.destroy();
            log(BaseCommand.STATUS_CANCEL);
          } finally {
            ctx = null;
View Full Code Here

TOP

Related Classes of com.google.gerrit.sshd.SshScope.Context

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.