Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

linux
Class Linux  view Linux download Linux.java

java.lang.Object
  extended byarch.module.JXModule
      extended byarch.module.major.JXMajorModule
          extended bylinux.Linux

public final class Linux
extends arch.module.major.JXMajorModule

The JD4X operating system module is known as Linux. Linux is a platform dependent module that deals with all the platform specific needs of the JD4X desktop. It has native support for kernel facilties like administration and file system services.
Note: Some of J2SDK's functions are undependable for the type of services that JD4X requires and therefore there is a need to re-implement some of them to have the JD4X system working correctly. An example would be the Runtime.exec() function. Careful testing has revealed JNI invokation problems that exist when processes created by this facility tries to re-invoke Java code. This same facility also causes XSync() to crash the Java threads and results in unpredictable behavior for native windowing applications.

Since:
JD4X 1.0
Version:
0.1, 05/07/2003

Field Summary
private static java.lang.String[] jvmCmd
          Fixed java commands
private static java.lang.String[] jvmExt
          Fixed java command extendsions
private static java.util.Hashtable jvmTable
          Table of current running Jvms
static int LINUX_ID
          Linux ID
private static java.util.Hashtable runPTable
          Table of current running processes
 
Fields inherited from class arch.module.JXModule
 
Constructor Summary
Linux()
          Default constructor that creates a new Windowing module with the default settings.
 
Method Summary
 arch.message.error.JXError commit(arch.task.JXTask task)
          It requests Linux to perform a certain task on another's behalf.
private  arch.message.error.JXError configure(java.lang.Object prop)
          All major modules must provide the facility to configure its properties such that user customization is possible.
private  int forkExec0(java.lang.String[] arg)
          Fork and execute a new linux process.
 java.lang.String getCredits()
          It allows the module developer to provide his/her information.
static java.lang.Object[] getJvms()
          Get the list of current running Jvm IDs.
static java.lang.Object[] getProcesses()
          Get the list of current running native process IDs.
 arch.message.error.JXError init()
          Initialize all resources and to prepare the module to do useful task.
 boolean isBusy()
          All major modules must provide the facility to indicate whether it is busy processing some command or it is in an idle state.
private  void kill0(int pid)
          kill a linux process.
static void main(java.lang.String[] argv)
          Testing function.
private static void println(java.lang.String msg)
          It allows the native code to feed messages back to the standard output logged by JUNK.
private  void requestJvmClass(java.lang.String[] jvmOpts, java.lang.String[] cmds)
          Start a new Jvm process using class invokation.
private  void requestJvmJar(java.lang.String[] jvmOpts, java.lang.String[] cmds)
          Start a new Jvm process using jar invokation.
private  void requestProcess(java.lang.String[] params)
          Start a new linux process.
 arch.message.error.JXError restoreState()
          All major modules must provide the facility to restore the previous state of the module such that it can retain previous module configurations and preferences.
 arch.message.error.JXError saveState()
          All major modules must provide the facility to save the state of the module such that it can be restorted when the previous state of the module is desired.
 arch.message.error.JXError shutdown()
          Terminate the module, clean up and exit native code.
private  void terminate(int id, java.lang.Object[] param)
          Allow the terminating of any task that Linux has been requested to perform.
 java.lang.String toString()
          A String representation of the core module.
 
Methods inherited from class arch.module.JXModule
equals, getModuleID, getVersion, hashCode, isJXCoreModuleValid, makeRequest, setJXCoreModule, setModuleID, setVersion
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

runPTable

private static volatile java.util.Hashtable runPTable
Table of current running processes


jvmTable

private static volatile java.util.Hashtable jvmTable
Table of current running Jvms


jvmCmd

private static final java.lang.String[] jvmCmd
Fixed java commands


jvmExt

private static final java.lang.String[] jvmExt
Fixed java command extendsions


LINUX_ID

public static final int LINUX_ID
Linux ID

See Also:
Constant Field Values
Constructor Detail

Linux

public Linux()
Default constructor that creates a new Windowing module with the default settings.

Method Detail

forkExec0

private int forkExec0(java.lang.String[] arg)
Fork and execute a new linux process.


kill0

private void kill0(int pid)
kill a linux process.


commit

public arch.message.error.JXError commit(arch.task.JXTask task)
It requests Linux to perform a certain task on another's behalf. The task requested must be supported before requesting the task.
Note: Peer methods run under commit are executed in a seperate thread in JUNK and will not block the other modules. Some peer functions here are infinite loops and cannot be directly called.


configure

private arch.message.error.JXError configure(java.lang.Object prop)
All major modules must provide the facility to configure its properties such that user customization is possible.


getProcesses

public static java.lang.Object[] getProcesses()
Get the list of current running native process IDs.


getJvms

public static java.lang.Object[] getJvms()
Get the list of current running Jvm IDs.


getCredits

public java.lang.String getCredits()
It allows the module developer to provide his/her information. The basic information should be short and should include the following format each on its own line:
Module: Name, version
Developer: Name, . Name, . [...]


init

public arch.message.error.JXError init()
Initialize all resources and to prepare the module to do useful task.


isBusy

public boolean isBusy()
All major modules must provide the facility to indicate whether it is busy processing some command or it is in an idle state. The client calling this method must be ready to defer any task that it wants the module to do if the return value is true. If a module do not have shared resources that requires queueing or synchronization then this method should always return true.


println

private static void println(java.lang.String msg)
It allows the native code to feed messages back to the standard output logged by JUNK. Use for debugging and feedback tracking. This method will print a newline at end of the message. Even though this method is not a required standard interface but it is very useful and should be considered by all implementations.


requestProcess

private void requestProcess(java.lang.String[] params)
Start a new linux process.


requestJvmJar

private void requestJvmJar(java.lang.String[] jvmOpts,
                           java.lang.String[] cmds)
Start a new Jvm process using jar invokation.


requestJvmClass

private void requestJvmClass(java.lang.String[] jvmOpts,
                             java.lang.String[] cmds)
Start a new Jvm process using class invokation.


restoreState

public arch.message.error.JXError restoreState()
All major modules must provide the facility to restore the previous state of the module such that it can retain previous module configurations and preferences.


saveState

public arch.message.error.JXError saveState()
All major modules must provide the facility to save the state of the module such that it can be restorted when the previous state of the module is desired.


shutdown

public arch.message.error.JXError shutdown()
Terminate the module, clean up and exit native code.


terminate

private void terminate(int id,
                       java.lang.Object[] param)
Allow the terminating of any task that Linux has been requested to perform. Tasks that are waiting to be executed or is already being executed will be halted and removed from Linux's task list. A terminiated task cannot be restarted or referenced again.


toString

public java.lang.String toString()
A String representation of the core module. The exact details of the representation are unspecified and subject to change, but the following maybe regarded as typical: JD4X , [mj] LINUX. It can be interpreted as module id = 5, version = 0.1 and a major module known as Linux.


main

public static void main(java.lang.String[] argv)
Testing function.