blob: 649da6bcfdbdd565cc90ee0bcf0558a13e587d9a [file] [log] [blame]
Guillaume Nodet05fac962009-04-27 10:01:58 +00001/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17package org.apache.servicemix.jpm.impl;
18
19import java.io.File;
20import java.io.IOException;
21
22import org.apache.servicemix.jpm.Process;
23import org.apache.servicemix.jpm.ProcessBuilder;
24
25
26public class ProcessBuilderImpl implements ProcessBuilder {
27
28 private File dir;
29 private String command;
30
31 public ProcessBuilder directory(File dir) {
32 this.dir = dir;
33 return this;
34 }
35
36 public ProcessBuilder command(String command) {
37 this.command = command;
38 return this;
39 }
40
41 public Process start() throws IOException {
42 return ProcessImpl.create(dir, command);
43 }
44
45 public Process attach(int pid) throws IOException {
46 return ProcessImpl.attach(pid);
47 }
48}