在路上...

生命是一段过程,是一个没有归途的旅程

  DonewsBlog  |  Donews首页  |  Donews社区  |  Donews邮箱  |  我的首页  |  联系作者  |  聚合   |  登录
  65篇文章 :: 0篇收藏:: 4篇评论:: 0个Trackbacks

文章

收藏

相册

链接

存档


正在读取评论……


1、CallbackUtil
回调工具类org.enhydra.shark.CallbackUtil定义在Shark.class中,也可以通过配置文件修改为用户指定的类。在配置文件中是这样描述的:CallbackUtilitiesClassName=org.enhydra.shark.CallbackUtil

CallbackUtil类位于modules/SharkKernel/Standard/src目录下,它实现了CallbackUtilities接口。CallbackUtilities位于modules/SharkAPI/src目录下 org.enhydra.shark.api.internal.working包中。

2、调用方式
通过参数注入的方式,对CallbackUtil进行调用:
...
   private CallbackUtilities callback;

   public void configure (CallbackUtilities cus) throws RootException {
      if (null == cus)
         throw new RootException("Cannot configure without call back impl.");
      callback = cus;
      HibernateUtilities.init(callback.getProperties());
      callback.debug("HibernateUserGroupManager configured");
   }
...

3、实现的接口
CallbackUtilities接口定义了如下一些方法:
/** 设置、读取Shark 配置文件中的内容**/
String getProperty (String propertyName);
String getProperty (String propertyName,String defaultValue);
Properties getProperties ();
void setProperties (Properties props);

/** 以下方法提供Log功能 **/
void error (String msg);
void error (String msg,RootException ex);
void error (String channel,String msg);
void error (String channel,String msg,RootException ex);
void warn (String msg);
void warn (String msg,RootException ex);
void warn (String channel,String msg);
void warn (String channel,String msg,RootException ex);
void info (String msg);
void info (String msg,RootException ex);
void info (String channel,String msg);
void info (String channel,String msg,RootException ex);
void debug (String msg);
void debug (String msg,RootException ex);
void debug (String channel,String msg);
void debug (String channel,String msg,RootException ex);





Trackback: http://tb.donews.net/TrackBack.aspx?PostId=852115


[点击此处收藏本文]  发表于2006年04月30日 4:22 PM




正在读取评论……

发表评论

大名:
网址:
验证码
评论