Package: SingleSessionCommandExecutor

SingleSessionCommandExecutor

nameinstructionbranchcomplexitylinemethod
SingleSessionCommandExecutor(CommandProcessor)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
execute(String, LinePrinter)
M: 12 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * This file is part of the Virgo Web Server.
3: *
4: * Copyright (c) 2010 VMware Inc.
5: * All rights reserved. This program and the accompanying materials
6: * are made available under the terms of the Eclipse Public License v1.0
7: * which accompanies this distribution, and is available at
8: * http://www.eclipse.org/legal/epl-v10.html
9: *
10: * Contributors:
11: * SpringSource, a division of VMware - initial API and implementation and/or initial documentation
12: *******************************************************************************/
13:
14: package org.eclipse.virgo.shell.internal;
15:
16: import java.io.IOException;
17:
18: import org.eclipse.virgo.shell.CommandExecutor;
19: import org.eclipse.virgo.shell.LinePrinter;
20:
21: /**
22: * Implementation of {@link CommandExecutor} which executes a single command in a new session.
23: * <p />
24: *
25: * <strong>Concurrent Semantics</strong><br />
26: * thread-safe
27: *
28: * @author Steve Powell
29: */
30: public class SingleSessionCommandExecutor implements CommandExecutor {
31:
32: private final CommandProcessor commandProcessor;
33:
34: SingleSessionCommandExecutor(CommandProcessor commandProcessor) {
35: this.commandProcessor = commandProcessor;
36: }
37:
38: /**
39: * {@inheritDoc}
40: */
41: public boolean execute(String commandLine, LinePrinter linePrinter) throws IOException {
42: CommandExecutor sessionCommandExecutor = new SessionCommandExecutor(this.commandProcessor.createSession());
43: return sessionCommandExecutor.execute(commandLine, linePrinter);
44: }
45:
46: }