001: /* WfEventAuditIteratorSSBean.java */
002: package org.enhydra.shark.ejb;
003:
004: import java.rmi.RemoteException;
005:
006: import javax.ejb.EJBException;
007: import javax.ejb.EJBObject;
008: import javax.ejb.SessionBean;
009: import javax.ejb.SessionContext;
010:
011: import org.enhydra.shark.api.client.wfmodel.WfEventAudit;
012: import org.enhydra.shark.api.client.wfmodel.WfEventAuditIterator;
013:
014: /**
015: * @ejb.bean
016: * name="WfEventAuditIteratorSS"
017: * type="Stateful"
018: * display-name="WfEventAuditIterator"
019: * jndi-name="org/enhydra/shark/ejb/WfEventAuditIteratorSS"
020: * local-jndi-name="org/enhydra/shark/ejb/WfEventAuditIteratorSSLocal"
021: * transaction-type="Container"
022: * view-type="both"
023: * local-business-interface="org.enhydra.shark.api.client.wfmodel.WfEventAuditIterator"
024: *
025: * @ejb.ejb-ref ejb-name="WfAssignmentEventAuditSS"
026: * view-type="both"
027: * ref-name="org/enhydra/shark/ejb/WfAssignmentEventAuditSS"
028: * @ejb.ejb-ref ejb-name="WfCreateProcessEventAuditSS"
029: * view-type="both"
030: * ref-name="org/enhydra/shark/ejb/WfCreateProcessEventAuditSS"
031: * @ejb.ejb-ref ejb-name="WfDataEventAuditSS"
032: * view-type="both"
033: * ref-name="org/enhydra/shark/ejb/WfDataEventAuditSS"
034: * @ejb.ejb-ref ejb-name="WfPackageEventAuditSS"
035: * view-type="both"
036: * ref-name="org/enhydra/shark/ejb/WfPackageEventAuditSS"
037: * @ejb.ejb-ref ejb-name="WfStateEventAuditSS"
038: * view-type="both"
039: * ref-name="org/enhydra/shark/ejb/WfStateEventAuditSS"
040: *
041: * @ejb:interface
042: * extends="org.enhydra.shark.api.client.wfmodel.WfEventAuditIterator,javax.ejb.EJBObject"
043: *
044: * @ejb:transaction
045: * type="Required"
046: *
047: * @jonas:bean
048: * ejb-name="WfEventAuditIteratorSS"
049: * jndi-name="org/enhydra/shark/ejb/WfEventAuditIteratorSS"
050: *
051: * OMG definition: The WfEventAuditIterator interface specializes the WfBase::BaseIterator
052: * interface and adds the event audit specific operations.
053: * All of the attributes described for the WfEventAudit interface can be used in query
054: * expressions.
055: * <p>We extended OMG's interface by duplicating methods, and adding additional
056: * parameter that represents transaction. If you use methods without SharkTransaction
057: * parameter, the transaction will be implicitly created, and if you use it with
058: * SharkTransaction parameter you must obey to some rules explained in HowTo documentation.
059: * <p> Also, look at our implementation API documentation of this interface to see
060: * which additional attributes can be used in query expressions.
061: *
062: * @author V.Puskas
063: * @author S.Bojanic
064: * @author T.Jovanovic
065: * @version 0.1
066: */
067: public abstract class WfEventAuditIteratorSSBean extends
068: BaseIteratorSSBean implements WfEventAuditIterator, SessionBean {
069:
070: private SessionContext context;
071:
072: /**
073: * @ejb:interface-method
074: * view-type="both"
075: */
076: public WfEventAudit get_next_object() throws Exception {
077: WfEventAudit wfshark = ((WfEventAuditIterator) sharkObj)
078: .get_next_object();
079: return SharkEJBUtilities.makeSSEventAudit(wfshark);
080: /*
081: WfEventAuditSS wf = null;
082: try {
083: Context initialContext = EJBJNDIContext.getInstance().getInitialContext();
084: wf = ((org.enhydra.shark.ejb.WfEventAuditSSHome) PortableRemoteObject.narrow(
085: initialContext.lookup("org/enhydra/shark/ejb/WfEventAuditSS"),
086: org.enhydra.shark.ejb.WfEventAuditSSHome.class)).create(wfshark);
087: return (WfEventAuditSS)wf.getPassedEJBObject();
088: } catch (Exception ex) {
089: throw new EJBException(ex);
090: }
091: */
092: }
093:
094: /**
095: * @ejb:interface-method
096: * view-type="both"
097: */
098: public WfEventAudit get_previous_object() throws Exception {
099: WfEventAudit wfshark = ((WfEventAuditIterator) sharkObj)
100: .get_previous_object();
101: return SharkEJBUtilities.makeSSEventAudit(wfshark);
102: /*
103: WfEventAuditSS wf = null;
104: try {
105: Context initialContext = EJBJNDIContext.getInstance().getInitialContext();
106: wf = ((org.enhydra.shark.ejb.WfEventAuditSSHome) PortableRemoteObject.narrow(
107: initialContext.lookup("org/enhydra/shark/ejb/WfEventAuditSS"),
108: org.enhydra.shark.ejb.WfEventAuditSSHome.class)).create(wfshark);
109: return (WfEventAuditSS)wf.getPassedEJBObject();
110: } catch (Exception ex) {
111: throw new EJBException(ex);
112: }
113: */
114: }
115:
116: /**
117: * @ejb:interface-method
118: * view-type="both"
119: */
120: public WfEventAudit[] get_next_n_sequence(int max_number)
121: throws Exception {
122: WfEventAudit[] wfsshark = ((WfEventAuditIterator) sharkObj)
123: .get_next_n_sequence(max_number);
124: return SharkEJBUtilities.makeSSEventAudits(wfsshark);
125: /*
126: WfEventAuditSSHome home = null;
127: InitialContext initialContext = EJBJNDIContext.getInstance().getInitialContext();
128: home = (WfEventAuditSSHome) PortableRemoteObject.narrow(
129: initialContext.lookup("org/enhydra/shark/ejb/WfEventAuditSS"),
130: org.enhydra.shark.ejb.WfEventAuditSSHome.class);
131: int len = wfsshark.length;
132: WfEventAuditSS[] remotes = new WfEventAuditSS[len];
133: for (int i=0;i<len;i++){
134: remotes[i]= (WfEventAuditSS)(home.create(wfsshark[i])).getPassedEJBObject();
135: }
136: return remotes;
137: */
138: }
139:
140: /**
141: * @ejb:interface-method
142: * view-type="both"
143: */
144: public WfEventAudit[] get_previous_n_sequence(int max_number)
145: throws Exception {
146: WfEventAudit[] wfsshark = ((WfEventAuditIterator) sharkObj)
147: .get_previous_n_sequence(max_number);
148: return SharkEJBUtilities.makeSSEventAudits(wfsshark);
149: /*
150: WfEventAuditSSHome home = null;
151: InitialContext initialContext = EJBJNDIContext.getInstance().getInitialContext();
152: home = (WfEventAuditSSHome) PortableRemoteObject.narrow(
153: initialContext.lookup("org/enhydra/shark/ejb/WfEventAuditSS"),
154: org.enhydra.shark.ejb.WfEventAuditSSHome.class);
155: int len = wfsshark.length;
156: WfEventAuditSS[] remotes = new WfEventAuditSS[len];
157: for (int i=0;i<len;i++){
158: remotes[i]= (WfEventAuditSS)(home.create(wfsshark[i])).getPassedEJBObject();
159: }
160: return remotes;
161: */
162: }
163:
164: /**
165: * @ejb.interface-method
166: * view-type="both"
167: **/
168: public EJBObject getPassedEJBObject() throws EJBException {
169: try {
170: return context.getEJBObject();
171: } catch (Exception ex) {
172: throw new EJBException(ex);
173: }
174: }
175:
176: public void setSessionContext(SessionContext ctx)
177: throws EJBException, RemoteException {
178: context = ctx;
179: }
180:
181: /**
182: * @ejb:create-method
183: */
184: public void ejbCreate(
185: org.enhydra.shark.api.client.wfmodel.WfEventAuditIterator iter) {
186: sharkObj = iter;
187: }
188:
189: /* (non-Javadoc)
190: * @see javax.ejb.SessionBean#ejbActivate()
191: */
192: public void ejbActivate() throws EJBException, RemoteException {
193: }
194:
195: /* (non-Javadoc)
196: * @see javax.ejb.SessionBean#ejbPassivate()
197: */
198: public void ejbPassivate() throws EJBException, RemoteException {
199: }
200:
201: /* (non-Javadoc)
202: * @see javax.ejb.SessionBean#ejbRemove()
203: */
204: public void ejbRemove() throws EJBException, RemoteException {
205: }
206: }
|