/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
abstract public VirtualMachine
throws IOException,
AbstractLauncher() {
super();
}
}
/*
* Tokenize the command, respecting the given quote character.
*/
quote + " \t\r\n\f",
true);
while (tokenizer.hasMoreTokens()) {
} else {
}
} else {
}
} else {
quoted = "";
// continue
} else {
}
}
}
/*
* Add final token.
*/
}
/*
* An unclosed quote at the end of the command. Do an
* implicit end quote.
*/
}
}
return tokenArray;
}
throws IOException, VMStartException {
}
/**
* This class simply provides a context for a single launch and
* accept. It provides instance fields that can be used by
* all threads involved. This stuff can't be in the Connector proper
* because the connector is a singleton and is not specific to any
* one launch.
*/
private class Helper {
private boolean exited = false;
this.commandArray = commandArray;
}
if (i > 0) {
str += " ";
}
str += commandArray[i];
}
return str;
}
synchronized void launchAndAccept() throws
try {
while ((connection == null) &&
(acceptException == null) &&
!exited) {
wait();
}
if (exited) {
throw new VMStartException(
}
if (acceptException != null) {
// Rethrow the exception in this thread
throw acceptException;
}
} catch (InterruptedException e) {
throw new InterruptedIOException("Interrupted during accept");
} finally {
}
}
return process;
}
return connection;
}
synchronized void notifyOfExit() {
exited = true;
notify();
}
this.connection = connection;
notify();
}
this.acceptException = acceptException;
notify();
}
"launched target monitor") {
public void run() {
try {
/*
* Notify waiting thread of VM error termination
*/
notifyOfExit();
} catch (InterruptedException e) {
// Connection has been established, stop monitoring
}
}
};
return thread;
}
"connection acceptor") {
public void run() {
try {
/*
* Notify waiting thread of connection
*/
} catch (InterruptedIOException e) {
// VM terminated, stop accepting
} catch (IOException e) {
// Report any other exception to waiting thread
}
}
};
return thread;
}
}
}