CN104598288A - Java program execution method and device - Google Patents

Java program execution method and device Download PDF

Info

Publication number
CN104598288A
CN104598288A CN201310529091.3A CN201310529091A CN104598288A CN 104598288 A CN104598288 A CN 104598288A CN 201310529091 A CN201310529091 A CN 201310529091A CN 104598288 A CN104598288 A CN 104598288A
Authority
CN
China
Prior art keywords
file
powershell script
dynamic link
link library
execution environment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201310529091.3A
Other languages
Chinese (zh)
Other versions
CN104598288B (en
Inventor
石林灵
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Gaohang Intellectual Property Operation Co ltd
Haining hi tech Zone Science and Innovation Center Co.,Ltd.
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201310529091.3A priority Critical patent/CN104598288B/en
Publication of CN104598288A publication Critical patent/CN104598288A/en
Application granted granted Critical
Publication of CN104598288B publication Critical patent/CN104598288B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Devices For Executing Special Programs (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a Java program execution method and device, and belongs to the field of the computer. The method comprises the following steps: loading a dynamic link library file, wherein the dynamic link library file comprises the implement of a first local method used for creating a Powershell script execution environment pool and the implementation of a second local method used for executing a Powershell script; calling the first local method, and creating the Powershell script execution environment pool, wherein the Powershell script execution environment pool comprises a plurality of Powershell script execution environments; calling the second local method, executing the Powershell scripts in a Java program in the Powershell script execution environments; and returning a Powershell script execution result. Expenditures generated when the Powershell script in the Java program is executed are lowered.

Description

Java applet manner of execution and device
Technical field
The present invention relates to computer realm, particularly a kind of java applet manner of execution and device.
Background technology
Java is a kind of object oriented program language can writing cross-platform software, is the general name of java applet design language and the Java platform released by Sun Microsystems.Java has remarkable versatility, high efficiency, platform transplantation and security, is widely used in every field.
When java applet runs on windows platform, often need to call Windows Powershell script, thus reach corresponding business purpose.And for the java application operated on windows platform, can only be reached by JavalangRuntime exec (Stringcommand) method provided in Java application programming interface, the method can restart an independently Powershell script process outside the java application process of current operation, thus the Powershell script performed in this java applet, terminate this process again after script is finished.
Realizing in process of the present invention, inventor finds that prior art at least exists following problem:
Java applet often performs a Powershell script will create an independently Powershell script process, if there is multiple thread concurrence performance Powershell script will create multiple process in java applet simultaneously, cause taking too much system resource, produce expense large.
Summary of the invention
Often perform a Powershell script will create an independently process to solve java applet in prior art, cause the problem taking too much system resource, embodiments provide a kind of java applet manner of execution and device.Described technical scheme is as follows:
On the one hand, the embodiment of the present invention provides a kind of java applet manner of execution, and described method comprises:
Load dynamic link library file, described dynamic link library file comprises: for creating the realization of first nation method in Powershell script execution environment pond and the realization for the second nation method of performing Powershell script;
Call described first nation method, create Powershell script execution environment pond, described Powershell script execution environment pond comprises multiple Powershell script execution environment;
Call described second nation method, in described Powershell script execution environment, perform the Powershell script in described java applet;
Return Powershell script execution result.
In a kind of implementation of the embodiment of the present invention, described dynamic link library file also comprises the realization of the 3rd nation method relying on class libraries for pre-loaded Powershell script, and described method also comprises:
Before calling described second nation method, call described 3rd nation method, in each described Powershell script execution environment, pre-loaded Powershell script relies on class libraries.
In the another kind of implementation of the embodiment of the present invention, described loading dynamic link library file, comprising:
Load the class file for performing Powershell script, described class file comprises the statement of the title of called dynamic link library, and the statement of described first nation method, described second nation method and described 3rd nation method;
According to the title of the dynamic link library of described class file state, load described dynamic link library file.
In the another kind of implementation of the embodiment of the present invention, described method also comprises:
Generate described dynamic link library file and described class file.
In the another kind of implementation of the embodiment of the present invention, the described dynamic link library file of described generation and described class file, comprising:
Obtain Java file, described Java file comprises the statement of the title of called dynamic link library, and the statement of described first nation method, described second nation method and described 3rd nation method;
Compile described Java file, obtain described class file;
According to described class file generated Java local interface header file;
Obtain and compile C# code, generate CS file, described C# code comprises the introducing of described Java local interface header file, and the realization of described first nation method stated in described header file, described second nation method and described 3rd nation method;
Described CS file is compiled as described dynamic link library file.
In the another kind of implementation of the embodiment of the present invention, the described dynamic link library file of described generation and described class file, comprising:
Obtain and compile C# code, generate CS file, described C# code comprises the realization of described first nation method, described second nation method and described 3rd nation method;
Described CS file is compiled as described dynamic link library file;
Use JNI4NET compilation tool to compile described dynamic link library file, obtain described class file.
On the other hand, the embodiment of the present invention additionally provides a kind of java applet actuating unit, and described device comprises:
Load module, for loading dynamic link library file, described first dynamic link library file comprises: for creating the realization of first nation method in Powershell script execution environment pond and the realization for the second nation method of performing Powershell script;
First processing module, for calling described first nation method, create Powershell script execution environment pond, described Powershell script execution environment pond comprises multiple Powershell script execution environment;
Second processing module, for calling described second nation method, performs the Powershell script in described java applet in described Powershell script execution environment;
Output module, for returning Powershell script execution result.
In a kind of implementation of the embodiment of the present invention, described dynamic link library file also comprises the realization of the 3rd nation method relying on class libraries for pre-loaded Powershell script, and described device also comprises:
3rd processing module, for before calling described second nation method, calls described 3rd nation method, and in each described Powershell script execution environment, pre-loaded Powershell script relies on class libraries.
In the another kind of implementation of the embodiment of the present invention, described load module, comprising:
Loading unit, for loading the class file for performing Powershell script, described class file comprises the statement of the title of called dynamic link library, and the statement of described first nation method, described second nation method and described 3rd nation method;
Performance element, for the title of the dynamic link library according to described class file state, loads described dynamic link library file.
In the another kind of implementation of the embodiment of the present invention, described device also comprises:
Generation module, for generating described dynamic link library file and described class file.
In the another kind of implementation of the embodiment of the present invention, described generation module, comprising:
Acquiring unit, for obtaining Java file, described Java file comprises the statement of the title of called dynamic link library, and the statement of described first nation method, described second nation method and described 3rd nation method;
First compilation unit, for compiling described Java file, obtains described class file;
Second compilation unit, for according to described class file generated Java local interface header file;
3rd compilation unit, for obtaining and compiling C# code, generate CS file, described C# code comprises the introducing of described Java local interface header file, and the realization of described first nation method stated in described header file, described second nation method and described 3rd nation method;
4th compilation unit, for being compiled as described dynamic link library file by described CS file.
In the another kind of implementation of the embodiment of the present invention, described generation module, comprising:
5th compilation unit, for obtaining and compiling C# code, generate CS file, described C# code comprises the realization of described first nation method, described second nation method and described 3rd nation method;
6th compilation unit, for being compiled as described dynamic link library file by described CS file;
7th compilation unit, for using JNI4NET compilation tool to compile described dynamic link library file, obtains described class file.
The beneficial effect that the technical scheme that the embodiment of the present invention provides is brought is:
By loading dll file, and the first nation method called in this DLL, create Powershell script execution environment pond, Powershell script execution environment pond comprises multiple Powershell script execution environment, call the second nation method in DLL, perform the Powershell script in java applet; On the one hand, owing to have employed nation method to perform Powershell script, therefore new process can not be created when performing Powershell script, simultaneously, multiple Powershell script execution environment is comprised in Powershell script execution environment pond, make it possible to perform multiple Powershell script simultaneously, avoid an often execution Powershell script and will create an independently process, the problem of the wasting of resources caused; On the other hand, the 3rd nation method is also comprised in dll file, behind establishment Powershell script execution environment pond, can be loaded in Powershell script execution environment and rely on class libraries by the 3rd nation method, shorten the time that java applet performs Powershell script.
Accompanying drawing explanation
In order to be illustrated more clearly in the technical scheme in the embodiment of the present invention, below the accompanying drawing used required in describing embodiment is briefly described, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 is the java applet manner of execution process flow diagram that the embodiment of the present invention one provides;
Fig. 2 is the java applet manner of execution process flow diagram that the embodiment of the present invention two provides;
Fig. 3 is the java applet manner of execution process flow diagram that the embodiment of the present invention three provides;
Fig. 4 is the structural representation of the java applet actuating unit that the embodiment of the present invention four provides;
Fig. 5 is the structural representation of the java applet actuating unit that the embodiment of the present invention five provides.
Embodiment
For making the object, technical solutions and advantages of the present invention clearly, below in conjunction with accompanying drawing, embodiment of the present invention is described further in detail.
Embodiment one
Embodiments provide a kind of java applet manner of execution, see Fig. 1, the method comprises:
Step 101: load DLL(Dynamic Link Library, dynamic link library) file, this dll file comprises: the Native(for creating Powershell script execution environment pond is local) realization of method and the realization for performing Powershell script the 2nd Native method.
This dll file is for performing the Powershell script in java applet.
Step 102: call a Native method, create Powershell script execution environment pond, Powershell script execution environment pond comprises multiple Powershell script execution environment.
Step 103: call the 2nd Native method, performs the Powershell script in java applet in Powershell script execution environment.
Step 104: return Powershell script execution result.
The embodiment of the present invention is by loading dll file, and the Native method called in this DLL, create Powershell script execution environment pond, Powershell script execution environment pond comprises multiple Powershell script execution environment, call the 2nd Native method in DLL, perform the Powershell script in java applet; On the one hand, owing to have employed Native method to perform Powershell script, therefore new process can not be created when performing Powershell script, simultaneously, multiple Powershell script execution environment is comprised in Powershell script execution environment pond, make it possible to perform multiple Powershell script simultaneously, avoid an often execution Powershell script and will create an independently process, the problem of the wasting of resources caused.
Embodiment two
Embodiments provide a kind of java applet manner of execution, see Fig. 2, the method comprises:
Step 201: obtain Java file, this Java file comprises the statement of the title of called DLL, and the statement of a Native method, the 2nd Native method and the 3rd Native method.
Java file is by Java code compilation.Wherein, a Native method, for creating Powershell script execution environment pond, comprises some script execution environment in pond, and the quantity of script execution environment can be specified in code.3rd Native method is used for pre-loaded Powershell script in above-mentioned script execution environment and relies on class libraries, when performing for script.2nd Native method is used for, when needs perform Powershell script, obtaining idle script execution environment, and then perform Powershell script from script execution environment pond.Wherein, script execution environment pond refers to the set providing object in multiple C# class libraries, and this object just can as being a Powershell script actuator, and namely each object can as a Powershell script execution environment.Java applet needs only to need when performing Powershell script to obtain idle script execution environment, heavily discharges this script execution environment again, so just can reuse script execution environment, form a script execution environment pond after executing.
Preferably, the script that the 3rd Native method loads relies on class libraries and comprises: required class libraries when all Powershell scripts comprised in this java applet perform.
Below the Java file in step 201 is illustrated:
Wherein, the Demo in System.LoadLibrary (" Demo ") is exactly the title of called DLL.
Step 202: compiling Java file, obtain class file, this class file is for performing Powershell script, and this class file comprises the statement of the title of called DLL, and the statement of a Native method, the 2nd Native method and the 3rd Native method.
This step can complete in Java compiler.
Step 203: according to class file generated JNI(Java Native Interface, Java local interface) header file.
Particularly, the class file obtained in Javah compile step 202 can be adopted in command-line tool, thus generate the header file including three native methods.
Step 204: obtain and compile C# code, generate CS file, C# code comprises the introducing of JNI header file, and the realization of the Native method stated in header file, the 2nd Native method and the 3rd Native method.
Step 205: CS file is compiled as dll file.
Above-mentioned steps 201 ~ 205 is the process generating dll file.The dll file finally generated is the DLL called stated in Java file in step 201.
Step 206: load this dll file, this dll file comprises the realization of a Native method, the 2nd Native method and the 3rd Native method.
Particularly, step 206 can comprise:
Step one, when java applet starts or perform Powershell script, load the class file produced in step 202.
The basic composition unit of java applet is class, and class comprises method.When java applet performs, class in java applet loads Lib(storehouse) in class file, realize the method that class comprises, above-mentioned execution Powershell script namely can method in certain class.
Step 2, title according to the DLL stated in this class file, load dll file.
Step 207: call a Native method, create Powershell script execution environment pond, Powershell script execution environment pond comprises multiple Powershell script execution environment.
Step 208: call the 3rd Native method, in each Powershell script execution environment, pre-loaded Powershell script relies on class libraries.
Step 209: call the 2nd Native method, performs the Powershell script in java applet in Powershell script execution environment.
Step 210: return Powershell script execution result.
The embodiment of the present invention is by loading dll file, and the Native method called in this DLL, create Powershell script execution environment pond, Powershell script execution environment pond comprises multiple Powershell script execution environment, call the 2nd Native method in DLL, perform the Powershell script in java applet; On the one hand, owing to have employed Native method to perform Powershell script, therefore new process can not be created when performing Powershell script, simultaneously, multiple Powershell script execution environment is comprised in Powershell script execution environment pond, make it possible to perform multiple Powershell script simultaneously, avoid an often execution Powershell script and will create an independently process, the problem of the wasting of resources caused; On the other hand, the 3rd Native method is also comprised in dll file, behind establishment Powershell script execution environment pond, can be loaded in Powershell script execution environment and rely on class libraries by the 3rd Native method, shorten the time that java applet performs Powershell script.
Embodiment three
Embodiments provide a kind of java applet manner of execution, the difference of the present embodiment and embodiment two is to adopt JNI4NET to realize to compile, and see Fig. 3, the method comprises:
Step 301: obtain and compile C# code, generate CS file, C# code comprises the realization of a Native method, the 2nd Native method and the 3rd Native method.
Wherein, a Native method, for creating Powershell script execution environment pond, comprises some script execution environment in pond, and the quantity of script execution environment can be specified in code.3rd Native method is used for pre-loaded Powershell script in above-mentioned script execution environment and relies on class libraries, when performing for script.2nd Native method is used for, when needs perform Powershell script, obtaining idle script execution environment, and then perform Powershell script from script execution environment pond.Wherein, script execution environment pond refers to the set providing object in multiple C# class libraries, and this object just can as being a Powershell script actuator, and namely each object can as a Powershell script execution environment.Program needs only to need when performing Powershell script to obtain idle script execution environment, heavily discharges this script execution environment again, so just can reuse script execution environment, form a script execution environment pond after executing.
Preferably, the script that the 3rd Native method loads relies on class libraries and comprises: required class libraries when all Powershell scripts comprised in this java applet perform.
Step 302: CS file is compiled as dll file.
Step 303: use JNI4NET compilation tool compiling dll file, obtain class file, this class file is for performing Powershell script, this class file comprises the statement of the title of called DLL, and the statement of a Native method, the 2nd Native method and the 3rd Native method.
Step 304: load dll file, this dll file comprises the realization of a Native method, the 2nd Native method and the 3rd Native method.
Particularly, step 304 can comprise:
Step one, when java applet starts or perform Powershell script, load the class file generated in step 303.
Step 2, title according to the DLL stated in this class file, load dll file.
Step 305: call a Native method, create Powershell script execution environment pond, Powershell script execution environment pond comprises multiple Powershell script execution environment.
Step 306: call the 3rd Native method, in each Powershell script execution environment, pre-loaded Powershell script relies on class libraries.
Step 307: call the 2nd Native method, performs the Powershell script in java applet in Powershell script execution environment.
Step 308: return Powershell script execution result.
The embodiment of the present invention is by loading dll file, and the Native method called in this DLL, create Powershell script execution environment pond, Powershell script execution environment pond comprises multiple Powershell script execution environment, call the 2nd Native method in DLL, perform the Powershell script in java applet; On the one hand, owing to have employed Native method to perform Powershell script, therefore new process can not be created when performing Powershell script, simultaneously, multiple Powershell script execution environment is comprised in Powershell script execution environment pond, make it possible to perform multiple Powershell script simultaneously, avoid an often execution Powershell script and will create an independently process, the problem of the wasting of resources caused; On the other hand, the 3rd Native method is also comprised in dll file, behind establishment Powershell script execution environment pond, can be loaded in Powershell script execution environment and rely on class libraries by the 3rd Native method, shorten the time that java applet performs Powershell script.
Embodiment four
Embodiments provide a kind of java applet actuating unit, see Fig. 4, this device comprises:
Load module 401, for loading dll file, dll file comprises: for creating the realization of a Native method in Powershell script execution environment pond and the realization for performing Powershell script the 2nd Native method;
First processing module 402, for calling a Native method, create Powershell script execution environment pond, Powershell script execution environment pond comprises multiple Powershell script execution environment;
Second processing module 403, for calling the 2nd Native method, performs the Powershell script in java applet in Powershell script execution environment;
Output module 404, for returning Powershell script execution result.
The embodiment of the present invention is by loading dll file, and the Native method called in this DLL, create Powershell script execution environment pond, Powershell script execution environment pond comprises multiple Powershell script execution environment, call the 2nd Native method in DLL, perform the Powershell script in java applet; On the one hand, owing to have employed Native method to perform Powershell script, therefore new process can not be created when performing Powershell script, simultaneously, multiple Powershell script execution environment is comprised in Powershell script execution environment pond, make it possible to perform multiple Powershell script simultaneously, avoid an often execution Powershell script and will create an independently process, the problem of the wasting of resources caused.
Embodiment five
Embodiments provide a kind of java applet actuating unit, see Fig. 5, this device comprises: load module 501, first processing module 502, second processing module 503 and output module 504.
Load module 501, for loading dll file, dll file comprises: for creating the realization of a Native method in Powershell script execution environment pond and the realization for performing Powershell script the 2nd Native method;
First processing module 502, for calling a Native method, create Powershell script execution environment pond, Powershell script execution environment pond comprises multiple Powershell script execution environment;
Second processing module 503, for calling the 2nd Native method, performs the Powershell script in java applet in Powershell script execution environment;
Output module 504, for returning Powershell script execution result.
Further, above-mentioned dll file also comprises the realization of the 3rd Native method relying on class libraries for pre-loaded Powershell script, and this device also comprises:
3rd processing module 505, for before calling the 2nd Native method, calls the 3rd Native method, and in each Powershell script execution environment, pre-loaded Powershell script relies on class libraries.
Wherein, a Native method, for creating Powershell script execution environment pond, comprises some script execution environment in pond, and the quantity of script execution environment can be specified in code.3rd Native method is used for pre-loaded Powershell script in above-mentioned script execution environment and relies on class libraries, when performing for script.2nd Native method is used for, when needs perform Powershell script, obtaining idle script execution environment, and then perform Powershell script from script execution environment pond.Wherein, script execution environment pond refers to the set providing object in multiple C# class libraries, and this object just can as being a Powershell script actuator, and namely each object can as a Powershell script execution environment.Program needs only to need when performing Powershell script to obtain idle script execution environment, heavily discharges this script execution environment again, so just can reuse script execution environment, form a script execution environment pond after executing.
Preferably, the script that the 3rd Native method loads relies on class libraries and comprises: required class libraries when all Powershell scripts comprised in this java applet perform.
In a kind of implementation of the embodiment of the present invention, load module 501 can comprise:
Loading unit, for when java applet starts or perform Powershell script, load the class file for performing Powershell script, class file comprises the statement of the title of called DLL, and the statement of a Native method, the 2nd Native method and the 3rd Native method;
Performance element, for the title of the DLL according to class file state, loads dll file.
Further, device also comprises:
Generation module 506, for generating dll file and class file.
In a kind of implementation of the embodiment of the present invention, generation module 506 comprises:
Acquiring unit, for obtaining Java file, Java file comprises the statement of the title of called DLL, and the statement of a Native method, the 2nd Native method and the 3rd Native method;
First compilation unit, for compiling Java file, obtains class file;
Second compilation unit, for according to class file generated JNI header file;
3rd compilation unit, for obtaining and compiling C# code, generate CS file, C# code comprises the introducing of JNI header file, and the realization of the Native method stated in header file, the 2nd Native method and the 3rd Native method;
4th compilation unit, for being compiled as dll file by CS file.
In the another kind of implementation of the embodiment of the present invention, generation module 506 comprises:
5th compilation unit, for obtaining and compiling C# code, generate CS file, C# code comprises the realization of a Native method, the 2nd Native method and the 3rd Native method;
6th compilation unit, for being compiled as dll file by CS file;
7th compilation unit, for using JNI4NET compilation tool to compile dll file, obtains class file.
The embodiment of the present invention is by loading dll file, and the Native method called in this DLL, create Powershell script execution environment pond, Powershell script execution environment pond comprises multiple Powershell script execution environment, call the 2nd Native method in DLL, perform the Powershell script in java applet; On the one hand, owing to have employed Native method to perform Powershell script, therefore new process can not be created when performing Powershell script, simultaneously, multiple Powershell script execution environment is comprised in Powershell script execution environment pond, make it possible to perform multiple Powershell script simultaneously, avoid an often execution Powershell script and will create an independently process, the problem of the wasting of resources caused; On the other hand, the 3rd Native method is also comprised in dll file, behind establishment Powershell script execution environment pond, can be loaded in Powershell script execution environment and rely on class libraries by the 3rd Native method, shorten the time that java applet performs Powershell script.
It should be noted that: the java applet actuating unit that above-described embodiment provides is when performing Powershell script, only be illustrated with the division of above-mentioned each functional module, in practical application, can distribute as required and by above-mentioned functions and be completed by different functional modules, inner structure by device is divided into different functional modules, to complete all or part of function described above.In addition, the java applet actuating unit that above-described embodiment provides and java applet manner of execution embodiment belong to same design, and its specific implementation process refers to embodiment of the method, repeats no more here.
The invention described above embodiment sequence number, just to describing, does not represent the quality of embodiment.
One of ordinary skill in the art will appreciate that all or part of step realizing above-described embodiment can have been come by hardware, the hardware that also can carry out instruction relevant by program completes, described program can be stored in a kind of computer-readable recording medium, the above-mentioned storage medium mentioned can be ROM (read-only memory), disk or CD etc.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, within the spirit and principles in the present invention all, any amendment done, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (12)

1. a java applet manner of execution, is characterized in that, described method comprises:
Load dynamic link library file, described dynamic link library file comprises: for creating the realization of first nation method in Powershell script execution environment pond and the realization for the second nation method of performing Powershell script;
Call described first nation method, create Powershell script execution environment pond, described Powershell script execution environment pond comprises multiple Powershell script execution environment;
Call described second nation method, in described Powershell script execution environment, perform the Powershell script in described java applet;
Return Powershell script execution result.
2. method according to claim 1, is characterized in that, described dynamic link library file also comprises the realization of the 3rd nation method relying on class libraries for pre-loaded Powershell script, and described method also comprises:
Before calling described second nation method, call described 3rd nation method, in each described Powershell script execution environment, pre-loaded Powershell script relies on class libraries.
3. method according to claim 2, is characterized in that, described loading dynamic link library file, comprising:
Load the class file for performing Powershell script, described class file comprises the statement of the title of called dynamic link library, and the statement of described first nation method, described second nation method and described 3rd nation method;
According to the title of the dynamic link library of described class file state, load described dynamic link library file.
4. method according to claim 3, is characterized in that, described method also comprises:
Generate described dynamic link library file and described class file.
5. method according to claim 4, is characterized in that, the described dynamic link library file of described generation and described class file, comprising:
Obtain Java file, described Java file comprises the statement of the title of called dynamic link library, and the statement of described first nation method, described second nation method and described 3rd nation method;
Compile described Java file, obtain described class file;
According to described class file generated Java local interface header file;
Obtain and compile C# code, generate CS file, described C# code comprises the introducing of described Java local interface header file, and the realization of described first nation method stated in described header file, described second nation method and described 3rd nation method;
Described CS file is compiled as described dynamic link library file.
6. method according to claim 4, is characterized in that, the described dynamic link library file of described generation and described class file, comprising:
Obtain and compile C# code, generate CS file, described C# code comprises the realization of described first nation method, described second nation method and described 3rd nation method;
Described CS file is compiled as described dynamic link library file;
Use JNI4NET compilation tool to compile described dynamic link library file, obtain described class file.
7. a java applet actuating unit, is characterized in that, described device comprises:
Load module, for loading dynamic link library file, described first dynamic link library file comprises: for creating the realization of first nation method in Powershell script execution environment pond and the realization for the second nation method of performing Powershell script;
First processing module, for calling described first nation method, create Powershell script execution environment pond, described Powershell script execution environment pond comprises multiple Powershell script execution environment;
Second processing module, for calling described second nation method, performs the Powershell script in described java applet in described Powershell script execution environment;
Output module, for returning Powershell script execution result.
8. device according to claim 7, is characterized in that, described dynamic link library file also comprises the realization of the 3rd nation method relying on class libraries for pre-loaded Powershell script, and described device also comprises:
3rd processing module, for before calling described second nation method, calls described 3rd nation method, and in each described Powershell script execution environment, pre-loaded Powershell script relies on class libraries.
9. device according to claim 8, is characterized in that, described load module, comprising:
Loading unit, for loading the class file for performing Powershell script, described class file comprises the statement of the title of called dynamic link library, and the statement of described first nation method, described second nation method and described 3rd nation method;
Performance element, for the title of the dynamic link library according to described class file state, loads described dynamic link library file.
10. device according to claim 9, is characterized in that, described device also comprises:
Generation module, for generating described dynamic link library file and described class file.
11. devices according to claim 10, is characterized in that, described generation module, comprising:
Acquiring unit, for obtaining Java file, described Java file comprises the statement of the title of called dynamic link library, and the statement of described first nation method, described second nation method and described 3rd nation method;
First compilation unit, for compiling described Java file, obtains described class file;
Second compilation unit, for according to described class file generated Java local interface header file;
3rd compilation unit, for obtaining and compiling C# code, generate CS file, described C# code comprises the introducing of described Java local interface header file, and the realization of described first nation method stated in described header file, described second nation method and described 3rd nation method;
4th compilation unit, for being compiled as described dynamic link library file by described CS file.
12. devices according to claim 10, is characterized in that, described generation module, comprising:
5th compilation unit, for obtaining and compiling C# code, generate CS file, described C# code comprises the realization of described first nation method, described second nation method and described 3rd nation method;
6th compilation unit, for being compiled as described dynamic link library file by described CS file;
7th compilation unit, for using JNI4NET compilation tool to compile described dynamic link library file, obtains described class file.
CN201310529091.3A 2013-10-30 2013-10-30 Java applet performs method and apparatus Active CN104598288B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310529091.3A CN104598288B (en) 2013-10-30 2013-10-30 Java applet performs method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310529091.3A CN104598288B (en) 2013-10-30 2013-10-30 Java applet performs method and apparatus

Publications (2)

Publication Number Publication Date
CN104598288A true CN104598288A (en) 2015-05-06
CN104598288B CN104598288B (en) 2018-05-11

Family

ID=53124106

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310529091.3A Active CN104598288B (en) 2013-10-30 2013-10-30 Java applet performs method and apparatus

Country Status (1)

Country Link
CN (1) CN104598288B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106897080A (en) * 2015-12-18 2017-06-27 北京国双科技有限公司 The processing method and processing device of dynamic link library
CN107730574A (en) * 2017-09-29 2018-02-23 四川长虹电器股份有限公司 Identity card automatic generation method based on powershell

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102033935A (en) * 2010-12-20 2011-04-27 深圳市五巨科技有限公司 Preloading method, preloading device and preloading system of mobile terminal browser
US20120096527A1 (en) * 2010-10-14 2012-04-19 Michael Pasternak Powershell cmdlets code generating tool for communicating to the web services
CN102934081A (en) * 2010-04-13 2013-02-13 Et国际有限公司 Runspace method, system and apparatus

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102934081A (en) * 2010-04-13 2013-02-13 Et国际有限公司 Runspace method, system and apparatus
US20120096527A1 (en) * 2010-10-14 2012-04-19 Michael Pasternak Powershell cmdlets code generating tool for communicating to the web services
CN102033935A (en) * 2010-12-20 2011-04-27 深圳市五巨科技有限公司 Preloading method, preloading device and preloading system of mobile terminal browser

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
ITANDERS: "用Powershell调用DLL文件", 《HTTP://BLOG.CSDN.NET/ITANDERS/ARTICLE/DETAILS/5702771》 *
THE SURLY ADMIN: "多线程PowerShell脚本", 《HTTPS://THESURLYADMIN.COM/2013/02/11/MULTITHREADING-POWERSHELL-SCRIPTS/》 *
杨丰盛: "《Android应用开发揭秘》", 31 January 2010, 机械工业出版社 *
杨云君: "《Android的设计与实现 卷1》", 31 May 2013, 机械工业出版社 *
浅谈一测试NATIVE WINDOWS COMMAND与NATIVE POWERSHELL COMMAND: "浅谈一测试Native Windows Command与Native PowerShell Command", 《HTTP://BLOG.CSDN.NET/ITANDERS/ARTICLE/DETAILS/1787148》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106897080A (en) * 2015-12-18 2017-06-27 北京国双科技有限公司 The processing method and processing device of dynamic link library
CN106897080B (en) * 2015-12-18 2020-05-01 北京国双科技有限公司 Processing method and device of dynamic link library
CN107730574A (en) * 2017-09-29 2018-02-23 四川长虹电器股份有限公司 Identity card automatic generation method based on powershell

Also Published As

Publication number Publication date
CN104598288B (en) 2018-05-11

Similar Documents

Publication Publication Date Title
CN104090765A (en) Method and device for switching from mobile game to webgame
JP5722448B2 (en) Image processing software development method, image processing software development apparatus, and image processing software development program
RU2010149255A (en) PLANNER EXAMPLES IN PROCESS
CN102567033B (en) Based on kind loading method in advance and the device of embedded real-time Java virtual machine
CN105468428B (en) A kind of Android compilation of source code method and system
CN115185539B (en) Method, device and storage medium for generating executable dynamic link library file
WO2015032311A1 (en) Code generation method, compiler, scheduling method, apparatus and scheduling system
CN104331315A (en) Analysis and generation method and system of json object of any level
CN103513966A (en) PHP developing framework based on assemblies
KR101350798B1 (en) Robot system controlled on the basis of opros platform and control method thereof
CN102004662A (en) Embedded scalable virtual machine
KR20230088686A (en) Derivative software construction method, system and facility based on original system
CN103488517A (en) PHP code compiling method and device and PHP code running method and device
CN110795091A (en) Modular routing decoupling method, storage medium, electronic device and system
CN104598288A (en) Java program execution method and device
CN103699478A (en) Test case generation system and test case generation method
CN106547537B (en) Method for realizing assembled electric power application software based on QML technology
CN102999371A (en) Lua script-based human-computer interface development method and system
CN108829440B (en) Method and system for converting logic configuration array into logic execution command
CN104750482A (en) Method for constructing dynamic script execution engine based on MapReduce
Pufek et al. Achieving Efficient Structured Concurrency through Lightweight Fibers in Java Virtual Machine
CN111596923B (en) Haxe static link library construction method and device and electronic equipment
CN103488519A (en) Implement method of interactive scripting language interpreter
CN115629802A (en) Program migration processing method and device
CN115237390A (en) Relay protection device logic diagram code generation method and device and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20191216

Address after: 314400 No.11, Weisan Road, Nongfa District, Chang'an Town, Haining City, Jiaxing City, Zhejiang Province

Patentee after: Haining hi tech Zone Science and Innovation Center Co.,Ltd.

Address before: 510000 unit 2414-2416, building, No. five, No. 371, Tianhe District, Guangdong, China

Patentee before: GUANGDONG GAOHANG INTELLECTUAL PROPERTY OPERATION Co.,Ltd.

Effective date of registration: 20191216

Address after: 510000 unit 2414-2416, building, No. five, No. 371, Tianhe District, Guangdong, China

Patentee after: GUANGDONG GAOHANG INTELLECTUAL PROPERTY OPERATION Co.,Ltd.

Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Patentee before: HUAWEI TECHNOLOGIES Co.,Ltd.

TR01 Transfer of patent right