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

📄 taskusebean_1.java~

📁 J2EE & Tomcat books published by hope
💻 JAVA~
字号:
/* */package com.sun.j2ee.workflow.control.web;import java.util.Collection;import com.sun.j2ee.workflow.util.JNDINames;import com.sun.j2ee.workflow.task.model.TaskModel;import com.sun.j2ee.workflow.task.dao.TaskDAOImpl;import com.sun.j2ee.workflow.task.exceptions.*;import com.sun.j2ee.workflow.control.exceptions.GeneralFailureException;import com.sun.j2ee.workflow.control.exceptions.WorkflowAppException;import com.sun.j2ee.workflow.util.Debug;/** * This class is the web-tier representation of the task. */public class TaskUseBean implements java.io.Serializable {    private TaskModel task = null;    private boolean cached = false;    public TaskUseBean() {}        public TaskModel getTask(String task_ID) {      if (cached==false)       {          try {           TaskDAOImpl taskDa = new TaskDAOImpl();           String task_id = taskDa.findByPrimaryKey(task_ID);           Debug.println("found task id: "+task_id);           task = taskDa.load(task_id);           //account = cust.getDetails();            } catch (TaskDAOFinderException fe) {                throw new GeneralFailureException("Unable to find the password details for task " );            } catch (TaskDAOSysException se) {            Debug.println("found TaskDAOSysException se" + se.toString());            }            return task;        }           else        {            task = loadFromCache(task_ID);            return task;        }}    public Collection getTaskByName(String task_name) {        Collection tasks = null;          try {           TaskDAOImpl taskDa = new TaskDAOImpl();           tasks = taskDa.findByName(task_name);           Debug.println("found task id: "+task_name);            } catch (TaskDAOFinderException fe) {                throw new GeneralFailureException("Unable to find the task by name " +task_name );            } catch (TaskDAOSysException se) {            Debug.println("found TaskDAOSysException se" + se.toString());            }            return tasks;        }       public Collection getTaskList() {        Collection tasks = null;          try {           TaskDAOImpl taskDa = new TaskDAOImpl();           tasks = taskDa.findAll();            } catch (TaskDAOFinderException fe) {                throw new GeneralFailureException("Unable to find all task by name ");            } catch (TaskDAOSysException se) {            Debug.println("found TaskDAOSysException se" + se.toString());            }            return tasks;        }     public Collection getTaskByProject(String proj_name) {        Collection tasks = null;          try {           TaskDAOImpl taskDa = new TaskDAOImpl();           tasks = taskDa.findByField("project", proj_name);            } catch (TaskDAOFinderException fe) {                throw new GeneralFailureException("Unable to find all task by name ");            } catch (TaskDAOSysException se) {            Debug.println("found TaskDAOSysException se" + se.toString());            }            return tasks;        }     public Collection getTaskByStatus(String status) {        Collection tasks = null;          try {           TaskDAOImpl taskDa = new TaskDAOImpl();           tasks = taskDa.findByField("status", status);            } catch (TaskDAOFinderException fe) {                throw new GeneralFailureException("Unable to find all task by name ");            } catch (TaskDAOSysException se) {            Debug.println("found TaskDAOSysException se" + se.toString());            }            return tasks;        }             public Collection getTaskByType(String type) {        Collection tasks = null;          try {           TaskDAOImpl taskDa = new TaskDAOImpl();           tasks = taskDa.findByField("type", type);            } catch (TaskDAOFinderException fe) {                throw new GeneralFailureException("Unable to find all task by name ");            } catch (TaskDAOSysException se) {            Debug.println("found TaskDAOSysException se" + se.toString());            }            return tasks;        }           public Collection getTaskByField(String field, String key) {        Collection tasks = null;          try {           TaskDAOImpl taskDa = new TaskDAOImpl();           tasks = taskDa.findByField(field, key);            } catch (TaskDAOFinderException fe) {                throw new GeneralFailureException("Unable to find all task by name ");            } catch (TaskDAOSysException se) {            Debug.println("found TaskDAOSysException se" + se.toString());            }            return tasks;        }                 private TaskModel loadFromCache(String task_ID)    {        TaskModel task = null; //need to be implemented        return task;    }}

⌨️ 快捷键说明

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