Java

本类阅读TOP10

·使用MyEclipse开发Struts框架的Hello World!(录像1)
·hibernate配置笔记
·AOP编程入门--Java篇
·linux下Tomcat 5.0.20 与 Apache 2 安装/集成/配置
·在win2003下整合了整合Tomcat5.5+ apache_2.0.53+ mod_jk_2.0.47.dll
·构建Linux下IDE环境--Eclipse篇
·Jsp 连接 mySQL、Oracle 数据库备忘(Windows平台)
·ASP、JSP、PHP 三种技术比较
·Tomcat5.5.9的安装配置
·AWT GUI 设计笔记(二)

分类导航
VC语言Delphi
VB语言ASP
PerlJava
Script数据库
其他语言游戏开发
文件格式网站制作
软件工程.NET开发
shark工作流源代码学习(二)

作者:未知 来源:月光软件站 加入时间:2005-2-28 月光软件站

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相关各方面技术和市场问题 [email protected]




相关文章

相关软件