shark工作流源代码学习(二)

org.enhydra.shark.Shark

 

在启动Shark引擎前,要对它进行配置,配置要做的操作就是Shark.configure("shark.conf"),下面按先后顺序说明;

 

1) 整个系统只用配置一次,如果已经配置过,将不会再配置而直接返回,如下:

if (isConfigured) {

     SharkEngineManager.getInstance().getCallbackUtilities().info(

            "Trying to configure shark instance that is already configured !!!");

         return;

      }

 

2)如果没有为配置文件给绝对路径,系统会自动进行获取:

if (!configFile.isAbsolute()) {

         configFile=configFile.getAbsoluteFile();

      }

 

3)然后就是获取properties,进行配置,并将isConfigured设置为true:

try {

            fis=new FileInputStream(configFile);

            Properties props=new Properties();

            props.load(fis);

            fis.close();

            adjustSharkProperties(props);

         } catch (Exception ex) {

            throw new Error ("Something went wrong during reading of configuration from the file");

         }

isConfigured=true;

 

4)然后对SharkEngineManager进行配置,它利用回调函数,对该管理器的各子管理器和工厂进行初始化和配置,以后可以直接调用:

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)最后,对系统的缓存和LimitManager进行配置:

shark.initCaches();

shark.reevaluateAssignments();

shark.initLimitManager();

 

hongbo781202,又名HongSoft,职业程序员,研究领域:1)基于工作流的BPM系统研究2)基于JAVA的信息安全

技术.欢迎和大家讨论JAVA相关各方面技术和市场问题 hongbosoftware@163.com

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值