Shark workflow code study (2)

zhaozj2021-02-17  53

Org.enhydra.shark.shark

Before starting the Shark engine, you have to configure it, configure the operation you want to do, Shark.configure ("Shark.conf"), below the following order;

1) The entire system is only configured once, if it has been configured, it will not be configured and directly returned, as follows:

IF (isconfigured) {

SharkengineManager.getInstance (). Getcallbackutilities (). INFO

"Trying to Configure Shark Instance That Is Already CONFIGURED !!!");

Return;

}

2) If you do not give an absolute path for the configuration file, the system will automatically obtain:

IF (! configfile.isabsolute ()) {

CONFIGFILE = configfile.getabsolutefile ();

}

3) Then get the Properties, configure it, and set the iSconfigured to true:

Try {

FIS = New FileInputStream (configfile);

Properties PROPS = New Properties ();

Props.Load (FIA);

fis.close ();

Adjustsharkproperties (Props);

} catch (exception ex) {

Throw New Error ("Something Went Wrong During Reading of Configuration from The File";

}

iSconfigured = true;

4) The SharkenGineManager is then configured, which uses the callback function to initialize and configure each submanger and plant of the manager. You can call directly:

Try {

Callbackutilities = (Callbackutil) cl.loadclass (cbuclassname) .newinstance ();

Callbackutilities.SetProperties (Properties);

ObjectFactory = (SharkObjectFactory) Cl.loadClass (ObjectFactoryClassName) .newinstance ();

ToolagentManager = (ToolAgentManager) cl.loadclass (tamclassname) .newinstance ();

Xmlinterface = new xmlinterfaceforjdk13 ();

} catch (throwable ex) {

Throw New Error ("Problems Instantiating Core Managers");

}

5) Finally, configure the system's cache and LimitManager:

Shark.initcaches ();

Shark.reevaluateAssterials ();

Shark.initlimitManager ();

HONGBO781202, also known as hongsoft, professional programmer, research area: 1) Based on workflow 2) Java-based information security

Technology. Welcome to discuss all aspects of Java related aspects of technology and market issues hongbosoftware@163.com

转载请注明原文地址:https://www.9cbs.com/read-28857.html

New Post(0)