Zorka source code interpretation: Beanshell and zorka interaction implementation, zorkabeanshell

Source: Internet
Author: User

Zorka source code interpretation: Beanshell and zorka interaction implementation, zorkabeanshell

1. beanshell basic knowledge
Call BeanShell from an application
Create a BeanShell interpreter (interpreter)
Run the eval () and source () commands to evaluate a string and run a script file.
You can use the set () method to input a variable reference to an object.
You can use the get () method to obtain the result of a variable again.

2. Register a java object in beanshell
Java code uses the interpreter of the beanshell library to pass variables to beanshell.
The put Method in ZorkaBshAgent. java calls the set Method of Interpreter to register SpyLib, ZorkaLib, TracerLib, ZabbixLib, NagiosLib, and SyslogLib instances in beanshell.

3. Load beanshell in java and execute beanshell
The eval () and source () commands of interpreter can be used in beanshell scripts to evaluate a string and run a script file.
ZorkaBshAgent. java executes the bsh script loading operation. In the loadScript method, execute the source (path) and eval () of interpreter to execute the script.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.