Bboss starts the application helper class and, through a simple configuration file, configures the dependent libraries and dependent resources that the main program needs to cut to the chase.
Suppose the application root directory is: Run
Put the Bboss startup application Help class package Bboss-rt.jar file into the run directory,bboss-rt.jar file download address:Bboss-rt.jar
1. Configure dependent libraries and dependent resources required by the main program
In the run directory, place the Config.properties file with the following contents:
Mainclass=org.frameworkset.bigdata.imp.imp
MainClass Specifies the main program to run, the main program depends on the resource file into the Run/resources directory, the main program depends on the jar and other library files into the Run/lib directory, so you can write the following running instructions.
2. Writing and running instructions (Linux and Windows edition)
Linux
Run File: Creates a new startup.sh file in the run directory with the following contents:
#!/bin/shjava-xms1024m-xmx1024m-xmn512m-xx:permsize=256m-xx:maxpermsize=512m-jar Bboss-rt.jar
Grant executable permission: chmod +x startup.sh
OK, you can execute the./startup.sh in the Run directory, you can see the execution effect, if you want your program to run in the background, you can execute the following command:
Nohup./startup.sh > Run.log &
Windows
Run File: Creates a new Startup.bat file in the run directory with the following contents:
Java-xms1024m-xmx1024m-xmn512m-xx:permsize=256m-xx:maxpermsize=512m-jar Bboss-rt.jar
OK, you can execute the Startup.bat in the run directory, you can see the effect of execution.
3. Advanced
The Resources directory and the Lib directory are the two resource directories that are scanned by default by the Bboss-rt.jar Toolkit, and if you want to configure some other dependent directories and dependent resources in Config.properties, you can specify Extlibs and extresources two properties, such as:
Extlibs=/webroot/web-inf/lib
Extresources=/webroot/web-inf/classes
Multiple directories can be separated by numbers, for example:
Extlibs=/webroot/web-inf/lib; /WEBROOT/WEB-INF/LIB1
extresources=/webroot/web-inf/classes; /webroot/web-inf/classes1
This is also possible if you want to configure some of the parameters that other main programs need to rely on in the Config.properties file:
port=8080
Context=bigdata
So how to get these parameters in the main program, the method is as follows:
Import org.frameworkset.runtime.commonlauncher;string port = commonlauncher.getproperty ("Port", "8080");// A default value of string contextpath = Commonlauncher.getproperty ("Context", "Bigdata") is specified, and the default value is specified at the same time
Ok,bboss Start the Application Help class feature description complete
Bboss starting the Application Help class