CN104598288B - Java applet performs method and apparatus - Google Patents

Java applet performs method and apparatus Download PDF

Info

Publication number
CN104598288B
CN104598288B CN201310529091.3A CN201310529091A CN104598288B CN 104598288 B CN104598288 B CN 104598288B CN 201310529091 A CN201310529091 A CN 201310529091A CN 104598288 B CN104598288 B CN 104598288B
Authority
CN
China
Prior art keywords
powershell
files
dynamic link
link library
nation method
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.)
Active
Application number
CN201310529091.3A
Other languages
Chinese (zh)
Other versions
CN104598288A (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 kind of java applet to perform method and apparatus, belongs to computer realm.The described method includes:Dynamic link library file is loaded, the dynamic link library file includes:For the realization of the first nation method and the realization of the second nation method for performing Powershell scripts for creating Powershell script execution environments pond;First nation method is called, creates Powershell script execution environments pond, the Powershell script execution environments pond includes multiple Powershell script execution environments;Second nation method is called, the Powershell scripts in the java applet are performed in the Powershell script execution environments;Return to Powershell script implementing results.Reduce expense when Powershell scripts perform in java applet.

Description

Java applet performs method and apparatus
Technical field
The present invention relates to computer realm, more particularly to a kind of java applet performs method and apparatus.
Background technology
Java is a kind of object oriented program language that can write cross-platform software, is by Sun Microsystems The java applet design language of release and the general name of Java platform.Java has remarkable versatility, high efficiency, platform transplantation And security, it is widely used in every field.
Java applet on windows platforms when running, it is often necessary to Windows Powershell scripts are called, so that Reach corresponding business purpose.And for operating in the java application on windows platform, it can only be answered by Java Reached with JavalangRuntime exec (String command) methods provided in programming interface, the method can worked as An independent Powershell script process is restarted outside the java application process of preceding operation, so as to perform this Powershell scripts in java applet, script terminate the process again after being finished.
In the implementation of the present invention, inventor has found that the prior art has at least the following problems:
Java applet, which often performs a Powershell script, will create an independent Powershell script process, If multiple processes will be created at the same time by there are multiple threads concurrently to perform Powershell scripts in java applet, cause to take More system resource, it is big to produce expense.
The content of the invention
In order to solve java applet in the prior art often perform a Powershell script will create one it is independent Process, the problem of causing to take excessive system resource, an embodiment of the present invention provides a kind of java applet to perform method and dress Put.The technical solution is as follows:
On the one hand, the embodiment of the present invention provides a kind of java applet and performs method, the described method includes:
Dynamic link library file is loaded, the dynamic link library file includes:Performed for creating Powershell scripts The realization of first nation method in environment pond and the realization of the second nation method for performing Powershell scripts;
First nation method is called, creates Powershell script execution environments pond, the Powershell scripts Performing environment pond includes multiple Powershell script execution environments;
Second nation method is called, is performed in the Powershell script execution environments in the java applet Powershell scripts;
Return to Powershell script implementing results.
In a kind of implementation of the embodiment of the present invention, the dynamic link library file is further included for pre-loaded Powershell scripts rely on the realization of the 3rd nation method of class libraries, and the method further includes:
Before second nation method is called, the 3rd nation method is called, in each Powershell feet Pre-loaded Powershell scripts rely on class libraries in this performing environment.
In another implementation of the embodiment of the present invention, the loading dynamic link library file, including:
The class files for being used for performing Powershell scripts are loaded, the class files include called dynamic chain Connect the statement of the title in storehouse, and the sound of first nation method, second nation method and the 3rd nation method It is bright;
According to the title of the dynamic link library of the class file states, the dynamic link library file is loaded.
In another implementation of the embodiment of the present invention, the method further includes:
Generate the dynamic link library file and the class files.
In another implementation of the embodiment of the present invention, the generation dynamic link library file and described Class files, including:
Java files are obtained, the Java files include the statement of the title of called dynamic link library, Yi Jisuo State the statement of the first nation method, second nation method and the 3rd nation method;
The Java files are compiled, obtain the class files;
According to the class file generateds Java local interface header files;
Obtain and compile C# codes, generate CS files, the C# codes include drawing for the Java local interfaces header file Enter, and first nation method, second nation method and the 3rd nation method stated in the header file Realization;
The CS files are compiled as the dynamic link library file.
In another implementation of the embodiment of the present invention, the generation dynamic link library file and described Class files, including:
Obtain and compile C# codes, generate CS files, the C# codes include first nation method, second described The realization of ground method and the 3rd nation method;
The CS files are compiled as the dynamic link library file;
The dynamic link library file is compiled using JNI4NET compilation tools, obtains the class files.
On the other hand, the embodiment of the present invention additionally provides a kind of java applet executive device, and described device includes:
Input module, for loading dynamic link library file, the dynamic link library file includes:For creating The realization of first nation method in Powershell script execution environments pond and second for performing Powershell scripts The realization of nation method;
First processing module, for calling first nation method, creates Powershell script execution environments pond, institute Stating Powershell script execution environments pond includes multiple Powershell script execution environments;
Second processing module, for calling second nation method, in the Powershell script execution environments Perform the Powershell scripts in the java applet;
Output module, for returning to Powershell script implementing results.
In a kind of implementation of the embodiment of the present invention, the dynamic link library file is further included for pre-loaded Powershell scripts rely on the realization of the 3rd nation method of class libraries, and described device further includes:
3rd processing module, for before second nation method is called, the 3rd nation method being called, each Pre-loaded Powershell scripts rely on class libraries in the Powershell script execution environments.
In another implementation of the embodiment of the present invention, the input module, including:
Loading unit, for loading the class files for being used for performing Powershell scripts, the class files include The statement of the title of the dynamic link library called, and first nation method, second nation method and described The statement of three nation methods;
Execution unit, for the title of the dynamic link library according to the class file states, loads the dynamic link Library file.
In another implementation of the embodiment of the present invention, described device further includes:
Generation module, for generating the dynamic link library file and the class files.
In another implementation of the embodiment of the present invention, the generation module, including:
Acquiring unit, for obtaining Java files, the Java files include the title of called dynamic link library Statement, and the statement of first nation method, second nation method and the 3rd nation method;
First compilation unit, for compiling the Java files, obtains the class files;
Second compilation unit, for according to the class file generateds Java local interface header files;
3rd compilation unit, for obtaining and compiling C# codes, generates CS files, the C# codes include the Java sheets The introducing of ground interface header file, and stated in the header file first nation method, second nation method and The realization of 3rd nation method;
4th compilation unit, for the CS files to be compiled as the dynamic link library file.
In another implementation of the embodiment of the present invention, the generation module, including:
5th compilation unit, for obtaining and compiling C# codes, generates CS files, the C# codes include the first The realization of ground method, second nation method and the 3rd nation method;
6th compilation unit, for the CS files to be compiled as the dynamic link library file;
7th compilation unit, for compiling the dynamic link library file using JNI4NET compilation tools, obtains described Class files.
The beneficial effect that technical solution provided in an embodiment of the present invention is brought is:
By loading dll file, and the first nation method in the DLL is called, create Powershell scripts and perform ring Border pond, Powershell script execution environments pond include multiple Powershell script execution environments, call second in DLL Ground method, performs the Powershell scripts in java applet;On the one hand, performed as a result of nation method Powershell scripts, therefore new process will not be created when performing Powershell scripts, meanwhile, in Powershell feet This performing environment pond includes multiple Powershell script execution environments so that may be performed simultaneously multiple Powershell feet This, avoid it is every execution one Powershell script will create an independent process, caused by the wasting of resources the problem of; On the other hand, the 3rd nation method is further included in dll file, Powershell scripts can created by the 3rd nation method Behind performing environment pond, the loading dependence class libraries in Powershell script execution environments, shortens java applet execution The time of Powershell scripts.
Brief description of the drawings
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment Attached drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the present invention, for For those of ordinary skill in the art, without creative efforts, other can also be obtained according to these attached drawings Attached drawing.
Fig. 1 is that the java applet that the embodiment of the present invention one provides performs method flow diagram;
Fig. 2 is that java applet provided by Embodiment 2 of the present invention performs method flow diagram;
Fig. 3 is that the java applet that the embodiment of the present invention three provides performs method flow diagram;
Fig. 4 is the structure diagram for the java applet executive device that the embodiment of the present invention four provides;
Fig. 5 is the structure diagram for the java applet executive device that the embodiment of the present invention five provides.
Embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with attached drawing to embodiment party of the present invention Formula is described in further detail.
Embodiment one
An embodiment of the present invention provides a kind of java applet to perform method, and referring to Fig. 1, this method includes:
Step 101:DLL (Dynamic Link Library, dynamic link library) file is loaded, which includes:With In the realization of the first Native (local) method for creating Powershell script execution environments pond and for performing The realization of the 2nd Native methods of Powershell scripts.
The dll file is used to perform the Powershell scripts in java applet.
Step 102:The first Native methods are called, create Powershell script execution environments pond, Powershell feet This performing environment pond includes multiple Powershell script execution environments.
Step 103:The 2nd Native methods are called, are performed in Powershell script execution environments in java applet Powershell scripts.
Step 104:Return to Powershell script implementing results.
The embodiment of the present invention calls the first Native methods in the DLL by loading dll file, creates Powershell script execution environments pond, Powershell script execution environments pond include multiple Powershell scripts and perform ring Border, calls the 2nd Native methods in DLL, performs the Powershell scripts in java applet;On the one hand, as a result of Native methods perform Powershell scripts, therefore will not create new process when performing Powershell scripts, together When, include multiple Powershell script execution environments in Powershell script execution environments pond so that can hold at the same time The multiple Powershell scripts of row, an independent process will be created by avoiding one Powershell script of every execution, be made Into the wasting of resources the problem of.
Embodiment two
An embodiment of the present invention provides a kind of java applet to perform method, and referring to Fig. 2, this method includes:
Step 201:Java files are obtained, which includes the statement of the title of called DLL, and first The statement of Native methods, the 2nd Native methods and the 3rd Native methods.
Java files are compiled by Java code.Wherein, the first Native methods are used to create Powershell Script execution environment pond, includes some script execution environments in pond, the quantity of script execution environment can specify in code.The Three Native methods are used for the pre-loaded Powershell scripts in above-mentioned script execution environment and rely on class libraries, are performed for script When use.2nd Native methods are used to, when needing to perform Powershell scripts, obtain from script execution environment pond empty Not busy script execution environment, and then perform Powershell scripts.Wherein, script execution environment pond refers to carry in multiple C# class libraries For the set of object, it is a Powershell script executor which, which can regard, i.e., each object can be used as one A Powershell script execution environments.Java applet needs only to need to obtain idle script when performing Powershell scripts Performing environment, discharges the script execution environment again again after having performed, can thus reuse script execution environment, forms one A script execution environment pond.
Preferably, the script that the 3rd Native methods are loaded, which relies on class libraries, to be included:What is included in the java applet is all Required class libraries when Powershell scripts perform.
The Java files in step 201 are illustrated below:
Wherein, the Demo in System.LoadLibrary (" Demo ") is exactly the title of called DLL.
Step 202:Java files are compiled, obtain class files, which is used to perform Powershell scripts, The statement of the title of the class files including called DLL, and the first Native methods, the 2nd Native methods and the The statement of three Native methods.
The step can be completed in Java compiler.
Step 203:According to class file generateds JNI (Java Native Interface, Java local interface) head text Part.
Specifically, the class files obtained in Javah compilation steps 202 can be used in command-line tool, so that raw Into the header file for including three native methods.
Step 204:Obtain and compile C# codes, generate CS files, C# codes include the introducing of JNI header files, Yi Jitou The realization of the first Native methods, the 2nd Native methods and the 3rd Native methods stated in file.
Step 205:CS files are compiled as dll file.
Above-mentioned steps 201~205 are the process of generation dll file.The dll file ultimately produced is in step 201 The DLL called stated in Java files.
Step 206:The dll file is loaded, which includes the first Native methods, the 2nd Native methods and the The realization of three Native methods.
Specifically, step 206 can include:
Step 1: when java applet starts or performs Powershell scripts, the class produced in step 202 is loaded File.
The basic component units of java applet are classes, and class includes method.When java applet performs, the class in java applet The class files in Lib (storehouse) are loaded, to realize method that class includes, above-mentioned execution Powershell scripts can certain Method in a class.
Step 2: according to the title of the DLL stated in the class files, dll file is loaded.
Step 207:The first Native methods are called, create Powershell script execution environments pond, Powershell feet This performing environment pond includes multiple Powershell script execution environments.
Step 208:The 3rd Native methods are called, it is pre-loaded in each Powershell script execution environments Powershell scripts rely on class libraries.
Step 209:The 2nd Native methods are called, are performed in Powershell script execution environments in java applet Powershell scripts.
Step 210:Return to Powershell script implementing results.
The embodiment of the present invention calls the first Native methods in the DLL by loading dll file, creates Powershell script execution environments pond, Powershell script execution environments pond include multiple Powershell scripts and perform ring Border, calls the 2nd Native methods in DLL, performs the Powershell scripts in java applet;On the one hand, as a result of Native methods perform Powershell scripts, therefore will not create new process when performing Powershell scripts, together When, include multiple Powershell script execution environments in Powershell script execution environments pond so that can hold at the same time The multiple Powershell scripts of row, an independent process will be created by avoiding one Powershell script of every execution, be made Into the wasting of resources the problem of;On the other hand, the 3rd Native methods are further included in dll file, pass through the 3rd Native methods Can be after Powershell script execution environments pond be created, the loading dependence class libraries in Powershell script execution environments, Shorten the time that java applet performs Powershell scripts.
Embodiment three
An embodiment of the present invention provides a kind of java applet to perform method, the difference between the present embodiment and the second embodiment lies in that adopting Compiling is realized with JNI4NET, and referring to Fig. 3, this method includes:
Step 301:Obtain and compile C# codes, generate CS files, C# codes include the first Native methods, second The realization of Native methods and the 3rd Native methods.
Wherein, the first Native methods are used to create Powershell script execution environments pond, include some scripts in pond Performing environment, the quantity of script execution environment can specify in code.3rd Native methods are used to perform in above-mentioned script Pre-loaded Powershell scripts rely on class libraries in environment, are used when being performed for script.2nd Native methods, which are used to work as, to be needed When performing Powershell scripts, the script execution environment of free time is obtained from script execution environment pond, and then perform Powershell scripts.Wherein, script execution environment pond refers to the set that object is provided in multiple C# class libraries, which can As being a Powershell script executor, i.e., each object can be used as a Powershell script execution environment. Program needs only to need to obtain idle script execution environment when performing Powershell scripts, discharges the foot after having performed again again This performing environment, can thus reuse script execution environment, form a script execution environment pond.
Preferably, the script that the 3rd Native methods are loaded, which relies on class libraries, to be included:What is included in the java applet is all Required class libraries when Powershell scripts perform.
Step 302:CS files are compiled as dll file.
Step 303:Dll file is compiled using JNI4NET compilation tools, obtains class files, which is used for Execution Powershell scripts, the statement of title of the class files including called DLL, and the first Native methods, The statement of 2nd Native methods and the 3rd Native methods.
Step 304:Dll file is loaded, which includes the first Native methods, the 2nd Native methods and the 3rd The realization of Native methods.
Specifically, step 304 can include:
Step 1: when java applet starts or performs Powershell scripts, the class generated in step 303 is loaded File.
Step 2: according to the title of the DLL stated in the class files, dll file is loaded.
Step 305:The first Native methods are called, create Powershell script execution environments pond, Powershell feet This performing environment pond includes multiple Powershell script execution environments.
Step 306:The 3rd Native methods are called, it is pre-loaded in each Powershell script execution environments Powershell scripts rely on class libraries.
Step 307:The 2nd Native methods are called, are performed in Powershell script execution environments in java applet Powershell scripts.
Step 308:Return to Powershell script implementing results.
The embodiment of the present invention calls the first Native methods in the DLL by loading dll file, creates Powershell script execution environments pond, Powershell script execution environments pond include multiple Powershell scripts and perform ring Border, calls the 2nd Native methods in DLL, performs the Powershell scripts in java applet;On the one hand, as a result of Native methods perform Powershell scripts, therefore will not create new process when performing Powershell scripts, together When, include multiple Powershell script execution environments in Powershell script execution environments pond so that can hold at the same time The multiple Powershell scripts of row, an independent process will be created by avoiding one Powershell script of every execution, be made Into the wasting of resources the problem of;On the other hand, the 3rd Native methods are further included in dll file, pass through the 3rd Native methods Can be after Powershell script execution environments pond be created, the loading dependence class libraries in Powershell script execution environments, Shorten the time that java applet performs Powershell scripts.
Example IV
An embodiment of the present invention provides a kind of java applet executive device, and referring to Fig. 4, which includes:
Input module 401, for loading dll file, dll file includes:Ring is performed for creating Powershell scripts The realization of the first Native methods in border pond and the realization for performing the 2nd Native methods of Powershell scripts;
First processing module 402, for calling the first Native methods, creates Powershell script execution environments pond, Powershell script execution environments pond includes multiple Powershell script execution environments;
Second processing module 403, for calling the 2nd Native methods, performs in Powershell script execution environments Powershell scripts in java applet;
Output module 404, for returning to Powershell script implementing results.
The embodiment of the present invention calls the first Native methods in the DLL by loading dll file, creates Powershell script execution environments pond, Powershell script execution environments pond include multiple Powershell scripts and perform ring Border, calls the 2nd Native methods in DLL, performs the Powershell scripts in java applet;On the one hand, as a result of Native methods perform Powershell scripts, therefore will not create new process when performing Powershell scripts, together When, include multiple Powershell script execution environments in Powershell script execution environments pond so that can hold at the same time The multiple Powershell scripts of row, an independent process will be created by avoiding one Powershell script of every execution, be made Into the wasting of resources the problem of.
Embodiment five
An embodiment of the present invention provides a kind of java applet executive device, and referring to Fig. 5, which includes:Input module 501st, first processing module 502, Second processing module 503 and output module 504.
Input module 501, for loading dll file, dll file includes:Ring is performed for creating Powershell scripts The realization of the first Native methods in border pond and the realization for performing the 2nd Native methods of Powershell scripts;
First processing module 502, for calling the first Native methods, creates Powershell script execution environments pond, Powershell script execution environments pond includes multiple Powershell script execution environments;
Second processing module 503, for calling the 2nd Native methods, performs in Powershell script execution environments Powershell scripts in java applet;
Output module 504, for returning to Powershell script implementing results.
Further, above-mentioned dll file, which is further included, relies on the 3rd of class libraries for pre-loaded Powershell scripts The realization of Native methods, the device further include:
3rd processing module 505, for before the 2nd Native methods are called, the 3rd Native methods being called, each Pre-loaded Powershell scripts rely on class libraries in Powershell script execution environments.
Wherein, the first Native methods are used to create Powershell script execution environments pond, include some scripts in pond Performing environment, the quantity of script execution environment can specify in code.3rd Native methods are used to perform in above-mentioned script Pre-loaded Powershell scripts rely on class libraries in environment, are used when being performed for script.2nd Native methods, which are used to work as, to be needed When performing Powershell scripts, the script execution environment of free time is obtained from script execution environment pond, and then perform Powershell scripts.Wherein, script execution environment pond refers to the set that object is provided in multiple C# class libraries, which can As being a Powershell script executor, i.e., each object can be used as a Powershell script execution environment. Program needs only to need to obtain idle script execution environment when performing Powershell scripts, discharges the foot after having performed again again This performing environment, can thus reuse script execution environment, form a script execution environment pond.
Preferably, the script that the 3rd Native methods are loaded, which relies on class libraries, to be included:What is included in the java applet is all Required class libraries when Powershell scripts perform.
In a kind of implementation of the embodiment of the present invention, input module 501 can include:
Loading unit, for when java applet starts or performs Powershell scripts, loading and being used to perform The class files of Powershell scripts, class files include the statement of the title of called DLL, and the first Native The statement of method, the 2nd Native methods and the 3rd Native methods;
Execution unit, for the title of the DLL according to class file states, loads dll file.
Further, device further includes:
Generation module 506, for generating dll file and class files.
In a kind of implementation of the embodiment of the present invention, generation module 506 includes:
Acquiring unit, for obtaining Java files, Java files include the statement of the title of called DLL, and The statement of first Native methods, the 2nd Native methods and the 3rd Native methods;
First compilation unit, for compiling Java files, obtains class files;
Second compilation unit, for according to class file generated JNI header files;
3rd compilation unit, for obtaining and compiling C# codes, generates CS files, C# codes include drawing for JNI header files Enter, and the realization for the first Native methods, the 2nd Native methods and the 3rd Native methods stated in header file;
4th compilation unit, for CS files to be compiled as dll file.
In another implementation of the embodiment of the present invention, generation module 506 includes:
5th compilation unit, for obtaining and compiling C# codes, generates CS files, C# codes include the first Native side The realization of method, the 2nd Native methods and the 3rd Native methods;
6th compilation unit, for CS files to be compiled as dll file;
7th compilation unit, for using JNI4NET compilation tools compiling dll file, obtaining class files.
The embodiment of the present invention calls the first Native methods in the DLL by loading dll file, creates Powershell script execution environments pond, Powershell script execution environments pond include multiple Powershell scripts and perform ring Border, calls the 2nd Native methods in DLL, performs the Powershell scripts in java applet;On the one hand, as a result of Native methods perform Powershell scripts, therefore will not create new process when performing Powershell scripts, together When, include multiple Powershell script execution environments in Powershell script execution environments pond so that can hold at the same time The multiple Powershell scripts of row, an independent process will be created by avoiding one Powershell script of every execution, be made Into the wasting of resources the problem of;On the other hand, the 3rd Native methods are further included in dll file, pass through the 3rd Native methods Can be after Powershell script execution environments pond be created, the loading dependence class libraries in Powershell script execution environments, Shorten the time that java applet performs Powershell scripts.
It should be noted that:Above-described embodiment provide java applet executive device when performing Powershell scripts, , can be as needed and by above-mentioned function distribution only with the division progress of above-mentioned each function module for example, in practical application Completed by different function modules, i.e., the internal structure of device is divided into different function modules, it is described above to complete All or part of function.In addition, the java applet executive device that above-described embodiment provides performs method with java applet and implements Example belongs to same design, its specific implementation process refers to embodiment of the method, and which is not described herein again.
The embodiments of the present invention are for illustration only, do not represent the quality of embodiment.
One of ordinary skill in the art will appreciate that hardware can be passed through by realizing all or part of step of above-described embodiment To complete, relevant hardware can also be instructed to complete by program, the program can be stored in a kind of computer-readable In storage medium, storage medium mentioned above can be read-only storage, disk or CD etc..
The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all the present invention spirit and Within principle, any modification, equivalent replacement, improvement and so on, should all be included in the protection scope of the present invention.

Claims (12)

1. a kind of java applet performs method, it is characterised in that the described method includes:
Dynamic link library file is loaded, the dynamic link library file includes:For creating Powershell script execution environments The realization of first nation method in pond and the realization of the second nation method for performing Powershell scripts;
First nation method is called, creates Powershell script execution environments pond, the Powershell scripts perform Environment pond includes multiple Powershell script execution environments;
Second nation method is called, is performed in the Powershell script execution environments in the java applet Powershell scripts;
Return to Powershell script implementing results.
2. according to the method described in claim 1, it is characterized in that, the dynamic link library file is further included for pre-loaded Powershell scripts rely on the realization of the 3rd nation method of class libraries, and the method further includes:
Before second nation method is called, the 3rd nation method is called, is held in each Powershell scripts Pre-loaded Powershell scripts rely on class libraries in row environment.
3. according to the method described in claim 2, it is characterized in that, the loading dynamic link library file, including:
The class files for being used for performing Powershell scripts are loaded, the class files include called dynamic link library Title statement, and the statement of first nation method, second nation method and the 3rd nation method;
According to the title of the dynamic link library of the class file states, the dynamic link library file is loaded.
4. according to the method described in claim 3, it is characterized in that, the method further includes:
Generate the dynamic link library file and the class files.
5. the according to the method described in claim 4, it is characterized in that, generation dynamic link library file and described Class files, including:
Java files are obtained, the Java files include the statement of the title of called dynamic link library, and described the The statement of one nation method, second nation method and the 3rd nation method;
The Java files are compiled, obtain the class files;
According to the class file generateds Java local interface header files;
Obtaining and compile C# codes, generate CS files, the C# codes include the introducing of the Java local interfaces header file, with And the reality for first nation method, second nation method and the 3rd nation method stated in the header file It is existing;
The CS files are compiled as the dynamic link library file.
6. the according to the method described in claim 4, it is characterized in that, generation dynamic link library file and described Class files, including:
Obtain and compile C# codes, generate CS files, the C# codes include first nation method, second place The realization of method and the 3rd nation method;
The CS files are compiled as the dynamic link library file;
The dynamic link library file is compiled using JNI4NET compilation tools, obtains the class files.
7. a kind of java applet executive device, it is characterised in that described device includes:
Input module, for loading dynamic link library file, the dynamic link library file includes:For creating Powershell The realization of first nation method in script execution environment pond and the second nation method for performing Powershell scripts Realize;
First processing module, for calling first nation method, creates Powershell script execution environments pond, described Powershell script execution environments pond includes multiple Powershell script execution environments;
Second processing module, for calling second nation method, performs in the Powershell script execution environments Powershell scripts in the java applet;
Output module, for returning to Powershell script implementing results.
8. device according to claim 7, it is characterised in that the dynamic link library file is further included for pre-loaded Powershell scripts rely on the realization of the 3rd nation method of class libraries, and described device further includes:
3rd processing module, for before second nation method is called, the 3rd nation method being called, each described Pre-loaded Powershell scripts rely on class libraries in Powershell script execution environments.
9. device according to claim 8, it is characterised in that the input module, including:
Loading unit, for loading the class files for being used for performing Powershell scripts, the class files include being adjusted The statement of the title of dynamic link library, and first nation method, second nation method and 3rd described The statement of ground method;
Execution unit, for the title of the dynamic link library according to the class file states, loads the dynamic link library text Part.
10. device according to claim 9, it is characterised in that described device further includes:
Generation module, for generating the dynamic link library file and the class files.
11. device according to claim 10, it is characterised in that the generation module, including:
Acquiring unit, for obtaining Java files, the Java files include the statement of the title of called dynamic link library, And the statement of first nation method, second nation method and the 3rd nation method;
First compilation unit, for compiling the Java files, obtains the class files;
Second compilation unit, for according to the class file generateds Java local interface header files;
3rd compilation unit, for obtaining and compiling C# codes, generates CS files, the C# codes locally connect including the Java First nation method stated in the introducing of oral file, and the header file, second nation method and described The realization of 3rd nation method;
4th compilation unit, for the CS files to be compiled as the dynamic link library file.
12. device according to claim 10, it is characterised in that the generation module, including:
5th compilation unit, for obtaining and compiling C# codes, generates CS files, the C# codes include first place The realization of method, second nation method and the 3rd nation method;
6th compilation unit, for the CS files to be compiled as the dynamic link library file;
7th compilation unit, for compiling the dynamic link library file using JNI4NET compilation tools, obtains the 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 CN104598288A (en) 2015-05-06
CN104598288B true 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)

Families Citing this family (2)

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

Citations (2)

* 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
CN102934081A (en) * 2010-04-13 2013-02-13 Et国际有限公司 Runspace method, system and apparatus

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8694956B2 (en) * 2010-10-14 2014-04-08 Red Hat Israel, Ltd. PowerShell cmdlets code generating tool for communicating to the web services

Patent Citations (2)

* 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
CN102033935A (en) * 2010-12-20 2011-04-27 深圳市五巨科技有限公司 Preloading method, preloading device and preloading system of mobile terminal browser

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
多线程PowerShell脚本;The Surly Admin;《https://thesurlyadmin.com/2013/02/11/multithreading-powershell-scripts/》;20130215;第3-4页 *
浅谈一测试Native Windows Command与Native PowerShell Command;浅谈一测试Native Windows Command与Native PowerShell Command;《http://blog.csdn.net/itanders/article/details/1787148》;20070916;第2页 *
用Powershell调用DLL文件;itanders;《http://blog.csdn.net/itanders/article/details/5702771》;20100629;第1-2页 *

Also Published As

Publication number Publication date
CN104598288A (en) 2015-05-06

Similar Documents

Publication Publication Date Title
US8429619B2 (en) Executable high-level trace file generation system
EP1805622B1 (en) Method and system for simplifying the debugging of a program comprising user-written code and non user-written code
US8191042B2 (en) Continuation based declarative definition and composition
US20130159963A1 (en) Agile Unit and Regression Testing Framework for Domain Specific Languages
Harel et al. PlayGo: towards a comprehensive tool for scenario based programming
CN106775744B (en) Method and device for generating static library
Dig et al. Relooper: refactoring for loop parallelism in Java
US8261248B2 (en) System and method of executing a dynamic program in a structured environment
CN1851665A (en) Method for completing product automation test utilizing test kit
JP2015524126A (en) Adaptively portable library
EP2564316B1 (en) Resumable methods
Tanno et al. TesMa and CATG: automated test generation tools for models of enterprise applications
CN104598288B (en) Java applet performs method and apparatus
KR101350798B1 (en) Robot system controlled on the basis of opros platform and control method thereof
CN102004662A (en) Embedded scalable virtual machine
CN110795091A (en) Modular routing decoupling method, storage medium, electronic device and system
CN104915199B (en) A kind of method and apparatus that Flash projects are converted to Html5 projects
CN109032607B (en) Machine room monitoring real-time data analysis engine based on lua script and script debugging tool
CN103488519A (en) Implement method of interactive scripting language interpreter
Song et al. An xpath-based approach to reusing test scripts for android applications
CN104750482A (en) Method for constructing dynamic script execution engine based on MapReduce
CN111596923B (en) Haxe static link library construction method and device and electronic equipment
CN113064591A (en) WPF page dynamic generation method, system, equipment and medium
Diepenbeck et al. Towards automatic scenario generation from coverage information
CN111679832A (en) Tool assembly integration method and device based on DevOps platform

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