\section{KJava\-Process Class Reference}
\label{classKJavaProcess}\index{KJavaProcess@{KJavaProcess}}
A class for invoking a Java VM.  


{\tt \#include $<$kjavaprocess.h$>$}

Inheritance diagram for KJava\-Process:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=58pt]{classKJavaProcess__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KJava\-Process:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=166pt]{classKJavaProcess__coll__graph}
\end{center}
\end{figure}
\subsection*{Signals}
\begin{CompactItemize}
\item 
void {\bf received} (const {\bf QByte\-Array} \&)\label{classKJavaProcess_l0}

\item 
void {\bf exited} (int {\bf status})\label{classKJavaProcess_l1}

\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KJava\-Process} ()
\item 
bool {\bf start\-Java} ()
\item 
void {\bf stop\-Java} ()
\item 
bool {\bf is\-Running} ()
\item 
void {\bf set\-JVMPath} (const {\bf QString} \&path)
\item 
void {\bf set\-Classpath} (const {\bf QString} \&classpath)
\item 
void {\bf set\-System\-Property} (const {\bf QString} \&{\bf name}, const {\bf QString} \&value)
\item 
void {\bf set\-Main\-Class} (const {\bf QString} \&clazz\-Name)
\item 
void {\bf set\-Extra\-Args} (const {\bf QString} \&{\bf args})
\item 
void {\bf set\-Class\-Args} (const {\bf QString} \&class\-Args)
\item 
void {\bf send} (char cmd\_\-code, const {\bf QString\-List} \&{\bf args})
\item 
void {\bf send} (char cmd\_\-code, const {\bf QString\-List} \&{\bf args}, const {\bf QByte\-Array} \&data)
\item 
void {\bf flush\-Buffers} ()
\end{CompactItemize}
\subsection*{Protected Slots}
\begin{CompactItemize}
\item 
void {\bf slot\-Wrote\-Data} ()
\item 
void {\bf slot\-Received\-Data} (int, int \&)
\item 
void {\bf slot\-Exited} ({\bf KProcess} $\ast$process)
\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
virtual bool {\bf invoke\-JVM} ()\label{classKJavaProcess_b0}

\item 
virtual void {\bf kill\-JVM} ()\label{classKJavaProcess_b1}

\item 
{\bf QByte\-Array} $\ast$ {\bf add\-Args} (char cmd\_\-code, const {\bf QString\-List} \&{\bf args})\label{classKJavaProcess_b2}

\item 
void {\bf pop\-Buffer} ()\label{classKJavaProcess_b3}

\item 
void {\bf send\-Buffer} ({\bf QByte\-Array} $\ast$buff)\label{classKJavaProcess_b4}

\item 
void {\bf store\-Size} ({\bf QByte\-Array} $\ast$buff)\label{classKJavaProcess_b5}

\end{CompactItemize}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
{\bf KProcess} $\ast$ {\bf java\-Process}\label{classKJavaProcess_p0}

\end{CompactItemize}


\subsection{Detailed Description}
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.

\begin{Desc}
\item[Author:]Richard J. Moore, {\tt rich@kde.org} 

Wynn Wilkes, {\tt wynnw@calderasystems.com} \end{Desc}




Definition at line 42 of file kjavaprocess.h.

\subsection{Constructor \& Destructor Documentation}
\index{KJavaProcess@{KJava\-Process}!KJavaProcess@{KJavaProcess}}
\index{KJavaProcess@{KJavaProcess}!KJavaProcess@{KJava\-Process}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KJava\-Process::KJava\-Process ()}\label{classKJavaProcess_a0}


Creates a process object, the process is NOT invoked at this point. 

You should first set the process's parameters, and then call start\-Java. 

Definition at line 49 of file kjavaprocess.cpp.

References QObject::connect(), KProcess::received\-Stdout(), slot\-Exited(), slot\-Received\-Data(), slot\-Wrote\-Data(), and KProcess::wrote\-Stdin().

\subsection{Member Function Documentation}
\index{KJavaProcess@{KJava\-Process}!startJava@{startJava}}
\index{startJava@{startJava}!KJavaProcess@{KJava\-Process}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KJava\-Process::start\-Java ()}\label{classKJavaProcess_a2}


Invoke the JVM with the parameters that have been set. 

The Java process will start after this call. 

Definition at line 85 of file kjavaprocess.cpp.

Referenced by KJava\-Applet\-Server::KJava\-Applet\-Server().\index{KJavaProcess@{KJava\-Process}!stopJava@{stopJava}}
\index{stopJava@{stopJava}!KJavaProcess@{KJava\-Process}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KJava\-Process::stop\-Java ()}\label{classKJavaProcess_a3}


Stop the JVM (if it's running). 



Definition at line 90 of file kjavaprocess.cpp.\index{KJavaProcess@{KJava\-Process}!isRunning@{isRunning}}
\index{isRunning@{isRunning}!KJavaProcess@{KJava\-Process}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KJava\-Process::is\-Running ()}\label{classKJavaProcess_a4}


Returns the status of the java Process- true if it's ok, false if it has died. 

It calls {\bf KProcess::is\-Running()} 

Definition at line 80 of file kjavaprocess.cpp.

References KProcess::is\-Running().

Referenced by send().\index{KJavaProcess@{KJava\-Process}!setJVMPath@{setJVMPath}}
\index{setJVMPath@{setJVMPath}!KJavaProcess@{KJava\-Process}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KJava\-Process::set\-JVMPath (const {\bf QString} \& {\em path})}\label{classKJavaProcess_a5}


Used to specify the path to the Java executable to be run. 



Definition at line 95 of file kjavaprocess.cpp.\index{KJavaProcess@{KJava\-Process}!setClasspath@{setClasspath}}
\index{setClasspath@{setClasspath}!KJavaProcess@{KJava\-Process}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KJava\-Process::set\-Classpath (const {\bf QString} \& {\em classpath})}\label{classKJavaProcess_a6}


This will set the classpath the Java process will use. 

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. 

Definition at line 100 of file kjavaprocess.cpp.\index{KJavaProcess@{KJava\-Process}!setSystemProperty@{setSystemProperty}}
\index{setSystemProperty@{setSystemProperty}!KJavaProcess@{KJava\-Process}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KJava\-Process::set\-System\-Property (const {\bf QString} \& {\em name}, const {\bf QString} \& {\em value})}\label{classKJavaProcess_a7}


Set a property on the java command line as -Dname=value, or -Dname if value is QString::null. 

For example, you could call set\-System\-Property( \char`\"{}kjas.debug\char`\"{}, \char`\"{}\char`\"{} ) to set the kjas.debug property. 

Definition at line 105 of file kjavaprocess.cpp.\index{KJavaProcess@{KJava\-Process}!setMainClass@{setMainClass}}
\index{setMainClass@{setMainClass}!KJavaProcess@{KJava\-Process}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KJava\-Process::set\-Main\-Class (const {\bf QString} \& {\em clazz\-Name})}\label{classKJavaProcess_a8}


The class to be called when {\bf start\-Java()}{\rm (p.\,\pageref{classKJavaProcess_a2})} is called. 



Definition at line 111 of file kjavaprocess.cpp.\index{KJavaProcess@{KJava\-Process}!setExtraArgs@{setExtraArgs}}
\index{setExtraArgs@{setExtraArgs}!KJavaProcess@{KJava\-Process}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KJava\-Process::set\-Extra\-Args (const {\bf QString} \& {\em args})}\label{classKJavaProcess_a9}


Extra flags passed to the JVM. 



Definition at line 116 of file kjavaprocess.cpp.\index{KJavaProcess@{KJava\-Process}!setClassArgs@{setClassArgs}}
\index{setClassArgs@{setClassArgs}!KJavaProcess@{KJava\-Process}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KJava\-Process::set\-Class\-Args (const {\bf QString} \& {\em class\-Args})}\label{classKJavaProcess_a10}


Arguments passed to the main class. 

They will be very last in the java command line, after the main class. 

Definition at line 121 of file kjavaprocess.cpp.\index{KJavaProcess@{KJava\-Process}!send@{send}}
\index{send@{send}!KJavaProcess@{KJava\-Process}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KJava\-Process::send (char {\em cmd\_\-code}, const {\bf QString\-List} \& {\em args})}\label{classKJavaProcess_a11}


Sends a command to the KJAS Applet Server by building a {\bf QByte\-Array} out of the data, and then writes it standard out. 



Definition at line 183 of file kjavaprocess.cpp.

References endl(), is\-Running(), and kd\-Debug().

Referenced by KJava\-Applet\-Server::create\-Applet(), KJava\-Applet\-Server::create\-Context(), KJava\-Applet\-Server::destroy\-Applet(), KJava\-Applet\-Server::destroy\-Context(), KJava\-Applet\-Server::init\-Applet(), KJava\-Applet\-Server::quit(), KJava\-Applet\-Server::send\-URLData(), KJava\-Applet\-Server::start\-Applet(), and KJava\-Applet\-Server::stop\-Applet().\index{KJavaProcess@{KJava\-Process}!send@{send}}
\index{send@{send}!KJavaProcess@{KJava\-Process}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KJava\-Process::send (char {\em cmd\_\-code}, const {\bf QString\-List} \& {\em args}, const {\bf QByte\-Array} \& {\em data})}\label{classKJavaProcess_a12}


Sends a command to the KJAS Applet Server by building a {\bf QByte\-Array} out of the data, and then writes it standard out. 

It adds each {\bf QString} in the arg list, and then adds the data array. 

Definition at line 194 of file kjavaprocess.cpp.

References endl(), is\-Running(), and kd\-Debug().\index{KJavaProcess@{KJava\-Process}!flushBuffers@{flushBuffers}}
\index{flushBuffers@{flushBuffers}!KJavaProcess@{KJava\-Process}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KJava\-Process::flush\-Buffers ()}\label{classKJavaProcess_a13}


Writes all pending data to JVM. 



Definition at line 327 of file kjavaprocess.cpp.

References KProcess::slot\-Send\-Data().

Referenced by KJava\-Applet\-Server::quit().\index{KJavaProcess@{KJava\-Process}!slotWroteData@{slotWroteData}}
\index{slotWroteData@{slotWroteData}!KJavaProcess@{KJava\-Process}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KJava\-Process::slot\-Wrote\-Data ()\hspace{0.3cm}{\tt  [protected, slot]}}\label{classKJavaProcess_j0}


This slot is called whenever something is written to stdin of the process. 

It's called again to make sure we keep emptying out the buffer that contains the messages we need send. 

Definition at line 239 of file kjavaprocess.cpp.

References endl(), and kd\-Debug().

Referenced by KJava\-Process().\index{KJavaProcess@{KJava\-Process}!slotReceivedData@{slotReceivedData}}
\index{slotReceivedData@{slotReceivedData}!KJavaProcess@{KJava\-Process}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KJava\-Process::slot\-Received\-Data (int, int \&)\hspace{0.3cm}{\tt  [protected, slot]}}\label{classKJavaProcess_j1}


This slot is called when the Java Process writes to standard out. 

We then process the data from the file descriptor that is passed to us and send the command to the Applet\-Server 

Definition at line 340 of file kjavaprocess.cpp.

References endl(), kd\-Error(), and QString::to\-Int().

Referenced by KJava\-Process().\index{KJavaProcess@{KJava\-Process}!slotExited@{slotExited}}
\index{slotExited@{slotExited}!KJavaProcess@{KJava\-Process}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KJava\-Process::slot\-Exited ({\bf KProcess} $\ast$ {\em process})\hspace{0.3cm}{\tt  [protected, slot]}}\label{classKJavaProcess_j2}


This slot is called when the Java Process exited. 



Definition at line 385 of file kjavaprocess.cpp.

References endl(), KProcess::exit\-Status(), and kd\-Debug().

Referenced by KJava\-Process().

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
kjavaprocess.h\item 
kjavaprocess.cpp\end{CompactItemize}
