.TH "KJavaProcess" kde3 "11 Jun 2005" "Version Version 3.4.1" "khtml Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KJavaProcess \- A class for invoking a Java VM.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kjavaprocess.h>\fP
.PP
Inherits \fBKProcess\fP.
.PP
.SS "Signals"

.in +1c
.ti -1c
.RI "void \fBreceived\fP (const \fBQByteArray\fP &)"
.br
.ti -1c
.RI "void \fBexited\fP (int \fBstatus\fP)"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKJavaProcess\fP ()"
.br
.ti -1c
.RI "bool \fBstartJava\fP ()"
.br
.ti -1c
.RI "void \fBstopJava\fP ()"
.br
.ti -1c
.RI "bool \fBisRunning\fP ()"
.br
.ti -1c
.RI "void \fBsetJVMPath\fP (const \fBQString\fP &path)"
.br
.ti -1c
.RI "void \fBsetClasspath\fP (const \fBQString\fP &classpath)"
.br
.ti -1c
.RI "void \fBsetSystemProperty\fP (const \fBQString\fP &\fBname\fP, const \fBQString\fP &value)"
.br
.ti -1c
.RI "void \fBsetMainClass\fP (const \fBQString\fP &clazzName)"
.br
.ti -1c
.RI "void \fBsetExtraArgs\fP (const \fBQString\fP &\fBargs\fP)"
.br
.ti -1c
.RI "void \fBsetClassArgs\fP (const \fBQString\fP &classArgs)"
.br
.ti -1c
.RI "void \fBsend\fP (char cmd_code, const \fBQStringList\fP &\fBargs\fP)"
.br
.ti -1c
.RI "void \fBsend\fP (char cmd_code, const \fBQStringList\fP &\fBargs\fP, const \fBQByteArray\fP &data)"
.br
.ti -1c
.RI "void \fBflushBuffers\fP ()"
.br
.in -1c
.SS "Protected Slots"

.in +1c
.ti -1c
.RI "void \fBslotWroteData\fP ()"
.br
.ti -1c
.RI "void \fBslotReceivedData\fP (int, int &)"
.br
.ti -1c
.RI "void \fBslotExited\fP (\fBKProcess\fP *process)"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual bool \fBinvokeJVM\fP ()"
.br
.ti -1c
.RI "virtual void \fBkillJVM\fP ()"
.br
.ti -1c
.RI "\fBQByteArray\fP * \fBaddArgs\fP (char cmd_code, const \fBQStringList\fP &\fBargs\fP)"
.br
.ti -1c
.RI "void \fBpopBuffer\fP ()"
.br
.ti -1c
.RI "void \fBsendBuffer\fP (\fBQByteArray\fP *buff)"
.br
.ti -1c
.RI "void \fBstoreSize\fP (\fBQByteArray\fP *buff)"
.br
.in -1c
.SS "Protected Attributes"

.in +1c
.ti -1c
.RI "\fBKProcess\fP * \fBjavaProcess\fP"
.br
.in -1c
.SH "Detailed Description"
.PP 
A class for invoking a Java VM. 

This class is a general tool for invoking a Java interpreter. It allows you to specify some of the standard options that should be understood by all JVMs.
.PP
\fBAuthor:\fP
.RS 4
Richard J. Moore, rich@kde.org 
.PP
Wynn Wilkes, wynnw@calderasystems.com 
.RE
.PP

.PP
Definition at line 42 of file kjavaprocess.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KJavaProcess::KJavaProcess ()"
.PP
Creates a process object, the process is NOT invoked at this point. 
.PP
You should first set the process's parameters, and then call startJava. 
.PP
Definition at line 49 of file kjavaprocess.cpp.
.PP
References QObject::connect(), KProcess::receivedStdout(), slotExited(), slotReceivedData(), slotWroteData(), and KProcess::wroteStdin().
.SH "Member Function Documentation"
.PP 
.SS "bool KJavaProcess::startJava ()"
.PP
Invoke the JVM with the parameters that have been set. 
.PP
The Java process will start after this call. 
.PP
Definition at line 85 of file kjavaprocess.cpp.
.PP
Referenced by KJavaAppletServer::KJavaAppletServer().
.SS "void KJavaProcess::stopJava ()"
.PP
Stop the JVM (if it's running). 
.PP
Definition at line 90 of file kjavaprocess.cpp.
.SS "bool KJavaProcess::isRunning ()"
.PP
Returns the status of the java Process- true if it's ok, false if it has died. 
.PP
It calls \fBKProcess::isRunning()\fP 
.PP
Definition at line 80 of file kjavaprocess.cpp.
.PP
References KProcess::isRunning().
.PP
Referenced by send().
.SS "void KJavaProcess::setJVMPath (const \fBQString\fP & path)"
.PP
Used to specify the path to the Java executable to be run. 
.PP
Definition at line 95 of file kjavaprocess.cpp.
.SS "void KJavaProcess::setClasspath (const \fBQString\fP & classpath)"
.PP
This will set the classpath the Java process will use. 
.PP
It's used as a the -cp command line option. It adds every jar file stored in $KDEDIRS/share/apps/kjava/ to the classpath, and then adds the $CLASSPATH environmental variable. This allows users to simply drop the JSSE (Java Secure Sockets Extension classes into that directory without having to modify the jvm configuration files. 
.PP
Definition at line 100 of file kjavaprocess.cpp.
.SS "void KJavaProcess::setSystemProperty (const \fBQString\fP & name, const \fBQString\fP & value)"
.PP
Set a property on the java command line as -Dname=value, or -Dname if value is QString::null. 
.PP
For example, you could call setSystemProperty( 'kjas.debug', '' ) to set the kjas.debug property. 
.PP
Definition at line 105 of file kjavaprocess.cpp.
.SS "void KJavaProcess::setMainClass (const \fBQString\fP & clazzName)"
.PP
The class to be called when \fBstartJava()\fP is called. 
.PP
Definition at line 111 of file kjavaprocess.cpp.
.SS "void KJavaProcess::setExtraArgs (const \fBQString\fP & args)"
.PP
Extra flags passed to the JVM. 
.PP
Definition at line 116 of file kjavaprocess.cpp.
.SS "void KJavaProcess::setClassArgs (const \fBQString\fP & classArgs)"
.PP
Arguments passed to the main class. 
.PP
They will be very last in the java command line, after the main class. 
.PP
Definition at line 121 of file kjavaprocess.cpp.
.SS "void KJavaProcess::send (char cmd_code, const \fBQStringList\fP & args)"
.PP
Sends a command to the KJAS Applet Server by building a \fBQByteArray\fP out of the data, and then writes it standard out. 
.PP
Definition at line 183 of file kjavaprocess.cpp.
.PP
References endl(), isRunning(), and kdDebug().
.PP
Referenced by KJavaAppletServer::createApplet(), KJavaAppletServer::createContext(), KJavaAppletServer::destroyApplet(), KJavaAppletServer::destroyContext(), KJavaAppletServer::initApplet(), KJavaAppletServer::quit(), KJavaAppletServer::sendURLData(), KJavaAppletServer::startApplet(), and KJavaAppletServer::stopApplet().
.SS "void KJavaProcess::send (char cmd_code, const \fBQStringList\fP & args, const \fBQByteArray\fP & data)"
.PP
Sends a command to the KJAS Applet Server by building a \fBQByteArray\fP out of the data, and then writes it standard out. 
.PP
It adds each \fBQString\fP in the arg list, and then adds the data array. 
.PP
Definition at line 194 of file kjavaprocess.cpp.
.PP
References endl(), isRunning(), and kdDebug().
.SS "void KJavaProcess::flushBuffers ()"
.PP
Writes all pending data to JVM. 
.PP
Definition at line 327 of file kjavaprocess.cpp.
.PP
References KProcess::slotSendData().
.PP
Referenced by KJavaAppletServer::quit().
.SS "void KJavaProcess::slotWroteData ()\fC [protected, slot]\fP"
.PP
This slot is called whenever something is written to stdin of the process. 
.PP
It's called again to make sure we keep emptying out the buffer that contains the messages we need send. 
.PP
Definition at line 239 of file kjavaprocess.cpp.
.PP
References endl(), and kdDebug().
.PP
Referenced by KJavaProcess().
.SS "void KJavaProcess::slotReceivedData (int, int &)\fC [protected, slot]\fP"
.PP
This slot is called when the Java Process writes to standard out. 
.PP
We then process the data from the file descriptor that is passed to us and send the command to the AppletServer 
.PP
Definition at line 340 of file kjavaprocess.cpp.
.PP
References endl(), kdError(), and QString::toInt().
.PP
Referenced by KJavaProcess().
.SS "void KJavaProcess::slotExited (\fBKProcess\fP * process)\fC [protected, slot]\fP"
.PP
This slot is called when the Java Process exited. 
.PP
Definition at line 385 of file kjavaprocess.cpp.
.PP
References endl(), KProcess::exitStatus(), and kdDebug().
.PP
Referenced by KJavaProcess().

.SH "Author"
.PP 
Generated automatically by Doxygen for khtml Library from the source code.
