--- /dev/null
+/*
+ * Copyright 2014 gitblit.com.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.gitblit.transport.ssh;
+
+public class SshCommandContext {
+
+ private final SshDaemonClient client;
+ private final String commandLine;
+
+ public SshCommandContext(SshDaemonClient client, String commandLine) {
+ this.client = client;
+ this.commandLine = commandLine;
+ }
+
+ public SshDaemonClient getClient() {
+ return client;
+ }
+
+ public String getCommandLine() {
+ return commandLine;
+ }
+}
private void onStart() throws IOException {
synchronized (this) {
- SshContext ctx = new SshContext(session.getAttribute(SshDaemonClient.KEY), cmdLine);
+ SshCommandContext ctx = new SshCommandContext(session.getAttribute(SshDaemonClient.KEY), cmdLine);
try {
cmd = dispatcher;
cmd.setArguments(argv);
+++ /dev/null
-/*
- * Copyright 2014 gitblit.com.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.gitblit.transport.ssh;
-
-public class SshContext {
-
- private final SshDaemonClient client;
- private final String commandLine;
-
- public SshContext(SshDaemonClient client, String commandLine) {
- this.client = client;
- this.commandLine = commandLine;
- }
-
- public SshDaemonClient getClient() {
- return client;
- }
-
- public String getCommandLine() {
- return commandLine;
- }
-}
import org.slf4j.LoggerFactory;
import com.gitblit.transport.ssh.AbstractSshCommand;
-import com.gitblit.transport.ssh.SshContext;
+import com.gitblit.transport.ssh.SshCommandContext;
import com.gitblit.utils.IdGenerator;
import com.gitblit.utils.WorkQueue;
import com.gitblit.utils.WorkQueue.CancelableRunnable;
private String[] argv;
/** Ssh context */
- protected SshContext ctx;
+ protected SshCommandContext ctx;
/** The task, as scheduled on a worker thread. */
private final AtomicReference<Future<?>> task;
this.executor = w.getDefaultQueue();
}
- public void setContext(SshContext ctx) {
+ public void setContext(SshCommandContext ctx) {
this.ctx = ctx;
}