Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (215.02 KB, 10 trang )
{
/** Answers a reference to the newly created Activity bean. */
public RecordTimeWorkflow create(String username) throws
RemoteException,
CreateException;
}
RecordTimeWorkflowBean.java
RecordTimeWorkflowBean.java is the implementation class for the RecordTimeWork-
flow session bean. Most of this code should be somewhere between familiar and
monotonous, by this point. However, there is one new wrinkle, as the ejbCreate
method finds a User entity bean based on the username parameter. This bean reference
is kept for the duration of the stateful session. The RecordTimeWorkflow session bean
wraps the data for a timecard into a custom TimecardDTO object.
package com.wiley.compBooks.EJwithUML.TimeCardWorkflow;
import com.wiley.compBooks.EJwithUML.Dtos.*;
import com.wiley.compBooks.EJwithUML.TimeCardDomain.*;
import com.wiley.compBooks.EJwithUML.Base.ApplicationExceptions.*;
import com.wiley.compBooks.EJwithUML.Base.DateUtil;
import com.wiley.compBooks.EJwithUML.Base.EjbUtil.*;
import java.util.*;
import java.rmi.*;
import javax.ejb.*;
import javax.naming.*;
/**
* The RecordTimeWorkflow allows client objects to record their time.
* RecordTimeWorkflowBean is the actual session bean implementation.
*/
public class RecordTimeWorkflowBean extends BasicSessionBean
{
private UserLocal user;
public void ejbCreate(String username) throws CreateException