⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testejbbean.java

📁 功能完善的java开发框架
💻 JAVA
字号:
/**
 * Copyright 2005 Jdon.com
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */

package com.jdon.framework.test.ejb;

import javax.ejb.CreateException;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;

import org.apache.log4j.Logger;

import com.jdon.controller.events.EventModel;
import com.jdon.controller.model.PageIterator;
import com.jdon.framework.test.dao.JdbcDAO;
import com.jdon.framework.test.model.UserTest;
import com.jdon.framework.test.service.TestService;
import com.jdon.framework.test.service.TestServicePOJOImp;

/**
 * this bean delagte to service,
 * @author <a href="mailto:banqiao@jdon.com">banq</a>
 *
 */
public class TestEJBBean implements SessionBean, TestService {
  private final static Logger logger = Logger.getLogger(TestEJBBean.class);

  private TestService testService;
  SessionContext sessionContext;

  public void ejbCreate() throws CreateException {
      JdbcDAO jdbcDAO = new JdbcDAO();
      testService = new TestServicePOJOImp(jdbcDAO);
  }

  public void createUser(EventModel em) {
      testService.createUser(em);
  }

  public void updateUser(EventModel em) {
      testService.updateUser(em);
  }

  public void deleteUser(EventModel em) {
      testService.deleteUser(em);
  }

  public UserTest getUser(String userId){
      return testService.getUser(userId);
  }

  
  public PageIterator getAllUsers(int start, int count) {
      return testService.getAllUsers(start, count);
  }

  public void ejbRemove() {
  }

  public void ejbActivate() {
  }

  public void ejbPassivate() {
  }

  public void setSessionContext(SessionContext sessionContext) {
    this.sessionContext = sessionContext;
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -