您的位置:首页 >> 编程开发 >> Java >> JavaBeans >> 正文
RSS
 

Petstore源码追踪记(3)-商业逻辑处理(五)

http://www.rdxx.com 01年11月18日 11:08 互联网 我要投稿

关键词: 商业 , 逻辑 , Stor

   */
   //判别新增或覆盖属性为”SIGNED_ON_USER”则进行处理,否则略过
   if (name.equals(SignOnFilter.SIGNED_ON_USER)) {
      boolean aSignOn  = ((Boolean)se.getValue()).booleanValue();
      if (aSignOn) {
          String userName =
(String)session.getAttribute(SignOnFilter.USER_NAME);
//
请加入侦察码
System.out.println("SignOnNotifier() userName="+userName);
          // look up the model manager and webclient controller
          PetstoreComponentManager sl =
(PetstoreComponentManager)session.getAttribute(PetstoreKeys.COMPONENT_MANAGER);
          WebController wc =  sl.getWebController(session);
          SignOnEvent soe = new SignOnEvent(userName);
          // set the EJBAction on the Event
          EventMapping em = getEventMapping(session.getServletContext(), soe);
          if (em != null) {
             soe.setEJBActionClassName(em.getEJBActionClassName());
System.out.println("EJBActionClassName="+
   em.getEJBActionClassName());
          }

          try {
             //
更新资料时会用到,以本例来说只需读取,所以没有作用
             wc.handleEvent(soe, session);
          } catch (EventException e) {
             System.err.println("SignOnNotifier Error handling event " + e);
          }
          //
取得Customer EJB Local Interface Reference
          CustomerLocal customer =  sl.getCustomer(session);
          // ensure the customer object is put in the session
          //
Customer EJB Local Interface存入
Session
          if (session.getAttribute(PetstoreKeys.CUSTOMER) == null) {
             session.setAttribute(PetstoreKeys.CUSTOMER, customer);
          }
          // set the language to the preferred language and other preferences
          ProfileLocal profile = sl.getCustomer(session).getProfile();
共7页  1 2 3 4 5 6 7

 
 
标签: 商业 , 逻辑 , Stor 打印本文
 
 
  热点搜索
 
 
 



Valid XHTML 1.0 Transitional
Copyright ©2005 - 2008 Rdxx.Com,All Rights Reserved
收藏本页
收藏本站