KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opensymphony > workflow > spi > ejb > WorkflowEntryEJB


1 /*
2  * Copyright (c) 2002-2003 by OpenSymphony
3  * All rights reserved.
4  */

5 package com.opensymphony.workflow.spi.ejb;
6
7 import com.opensymphony.ejb.ExceptionlessEntityAdapter;
8
9 import javax.ejb.CreateException JavaDoc;
10
11
12 /**
13  * EJB implementation for workflow entries.
14  *
15  * @ejb.bean
16  * type="CMP"
17  * view-type="local"
18  * name="WorkflowEntry"
19  * reentrant="False"
20  * schema="WorkflowEntry"
21  * primkey-field="id"
22  *
23  * @ejb.pk class="java.lang.Long" extends="java.lang.Object"
24  *
25  * @ejb.persistence table-name="OS_WFENTRY"
26  *
27  * @ejb.home local-extends="javax.ejb.EJBLocalHome"
28  *
29  * @ejb.interface local-extends="javax.ejb.EJBLocalObject"
30  *
31  * @ejb.ejb-external-ref
32  * ref-name="ejb/SequenceGenerator"
33  * type="Session"
34  * view-type="remote"
35  * link="SequenceGenerator"
36  * home="com.opensymphony.module.sequence.SequenceGeneratorHome"
37  * business="com.opensymphony.module.sequence.SequenceGenerator"
38  *
39  * @ejb.env-entry
40  * name="sequenceName"
41  * type="java.lang.String"
42  * value="WorkflowEntryEJB"
43  *
44  * @ejb.permission unchecked="true"
45  * @ejb.transaction type="Supports"
46  *
47  * @author <a HREF="mailto:hani@formicary.net">Hani Suleiman</a>
48  * @author <a HREF="mailto:plightbo@hotmail.com">Pat Lightbody</a>
49  */

50 public abstract class WorkflowEntryEJB extends ExceptionlessEntityAdapter {
51     //~ Methods ////////////////////////////////////////////////////////////////
52

53     public abstract void setId(Long JavaDoc id);
54
55     /**
56      * @ejb.pk-field
57      * @ejb.interface-method
58      * @ejb.persistence column-name="ID"
59      */

60     public abstract Long JavaDoc getId();
61
62     /**
63      * @ejb.interface-method
64      */

65     public abstract void setState(int state);
66
67     /**
68      * @ejb.interface-method
69      * @ejb.persistence column-name="STATE"
70      */

71     public abstract int getState();
72
73     public abstract void setWorkflowName(String JavaDoc workflowName);
74
75     /**
76      * @ejb.interface-method
77      * @ejb.persistence column-name="NAME"
78      */

79     public abstract String JavaDoc getWorkflowName();
80
81     /**
82      * @ejb.create-method
83      */

84     public Long JavaDoc ejbCreate(String JavaDoc workflowName) throws CreateException JavaDoc {
85         try {
86             Long JavaDoc id = new Long JavaDoc(nextLong());
87             setId(id);
88             setWorkflowName(workflowName);
89             setState(0);
90
91             return null;
92         } catch (Exception JavaDoc e) {
93             throw new CreateException JavaDoc(e.getMessage());
94         }
95     }
96
97     public void ejbPostCreate(String JavaDoc workflowName) throws CreateException JavaDoc {
98     }
99 }
100
Popular Tags