class KJavaProcess

# class KJavaProcess |
Definition | `#include <kjavaprocess.h>`
Inherits | KProcess (kdecore) [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### Public Methods

- KJavaProcess ()
- virtual ~KJavaProcess ()
- bool startJava ()
- void stopJava ()
- bool isRunning ()
- void setJVMPath ( const QString& path )
- void setClasspath ( const QString& classpath )
- void setSystemProperty ( const QString& name, const QString& value )
- void setMainClass ( const QString& clazzName )
- void setExtraArgs ( const QString& args )
- void setClassArgs ( const QString& classArgs )
- void send ( char cmd_code, const QStringList& args )
- void sendSync ( int ticket, char cmd_code, const QStringList& args )
- void syncCommandReceived ( int ticket )
- void send ( char cmd_code, const QStringList& args, const QByteArray& data )

#### Signals

- void received ( const QByteArray& )
- void exited ( int status )

#### Protected Methods

- virtual bool invokeJVM ()
- virtual void killJVM ()
- QByteArray* addArgs ( char cmd_code, const QStringList& args )
- void popBuffer ()
- void sendBuffer ( QByteArray* buff )
- void storeSize ( QByteArray* buff )

#### Protected Slots

- void slotWroteData ()
- void slotReceivedData ( int, int& )
- void slotExited ( KProcess *process )

#### Protected Members

- KProcess* javaProcess

## Detailed Description

KJavaProcess () | ### KJavaProcess

Creates a process object, the process is NOT invoked at this point. You should first set the process's parameters, and then call startJava.

~KJavaProcess () | ### ~KJavaProcess

[virtual]

bool startJava () | ### startJava

Invoke the JVM with the parameters that have been set. The Java process will start after this call.

void stopJava () | ### stopJava

Stop the JVM (if it's running).

bool isRunning () | ### isRunning

Returns the status of the java Process- true if it's ok, false if it has died. It calls KProcess::isRunning()

Reimplemented from KProcess.

void setJVMPath ( const QString& path ) | ### setJVMPath

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

void setClasspath ( const QString& classpath ) | ### setClasspath

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.

void setSystemProperty ( const QString& name, const QString& value ) | ### setSystemProperty

Set a property on the java command line as -Dname=value, or -Dname if value is QString::null. For example, you could call setSystemProperty( "kjas.debug", "" ) to set the kjas.debug property.

void setMainClass ( const QString& clazzName ) | ### setMainClass

The class to be called when startJava() is called.

void setExtraArgs ( const QString& args ) | ### setExtraArgs

Extra flags passed to the JVM.

void setClassArgs ( const QString& classArgs ) | ### setClassArgs

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

void send ( char cmd_code, const QStringList& args ) | ### send

Sends a command to the KJAS Applet Server by building a QByteArray out of the data, and then writes it standard out.

void sendSync ( int ticket, char cmd_code, const QStringList& args ) | ### sendSync

As above, but block until the return value is received

void syncCommandReceived ( int ticket ) | ### syncCommandReceived

Notify that the return values has arrived

void send ( char cmd_code, const QStringList& args, const QByteArray& data ) | ### send

Sends a command to the KJAS Applet Server by building a QByteArray out of the data, and then writes it standard out. It adds each QString in the arg list, and then adds the data array.

void slotWroteData () | ### slotWroteData

[protected slots slot]

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.

void slotReceivedData ( int, int& ) | ### slotReceivedData

[protected slots slot]

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 AppletServer

void slotExited ( KProcess *process ) | ### slotExited

[protected slots slot]

This slot is called when the Java Process exited.

bool invokeJVM () | ### invokeJVM

[protected virtual]

void killJVM () | ### killJVM

[protected virtual]

QByteArray* addArgs ( char cmd_code, const QStringList& args ) | ### addArgs

[protected]

void popBuffer () | ### popBuffer

[protected]

void sendBuffer ( QByteArray* buff ) | ### sendBuffer

[protected]

void storeSize ( QByteArray* buff ) | ### storeSize

[protected]

KProcess* javaProcess | ### javaProcess

[protected]

void received ( const QByteArray& ) | ### received

[signal]

void exited ( int status ) | ### exited

[signal]

Generated by: root on macppc.ports.openbsd.org on Sat Sep 6 10:37:53 2003, using kdoc 2.0a54.