01: /*
02: * Created on Dec 2, 2003
03: *
04: * To change the template for this generated file go to
05: * Window>Preferences>Java>Code Generation>Code and Comments
06: */
07: package org.xdev.base.xssl.manage;
08:
09: import java.util.List;
10: import java.util.HashMap;
11:
12: import org.xdev.base.xssl.XSSLAction;
13: import org.xdev.base.xssl.XSSLActionIterator;
14:
15: import org.xdev.base.xssl.*;
16: import org.xdev.base.xssl.collection.XSSLCollectionIterator;
17:
18: /**
19: * @author AYegorov
20: *
21: * To change the template for this generated type comment go to
22: * Window>Preferences>Java>Code Generation>Code and Comments
23: */
24: public class TransactionDefine extends XSSLActionIterator {
25: public static final String TX_DEFINE_TAG_NAME = "define";
26:
27: private int scope = -1;
28:
29: /**
30: * @param id
31: */
32: public TransactionDefine(String id) {
33: super (id);
34: // TODO Auto-generated constructor stub
35: }
36:
37: /**
38: * @param id
39: * @param properties
40: */
41: public TransactionDefine(String id, HashMap properties) {
42: super (id, properties);
43: // TODO Auto-generated constructor stub
44: }
45:
46: /* (non-Javadoc)
47: * @see org.xdev.base.transaction.AbstractTransactionIterator#invoke(org.xdev.base.transaction.AbstractTransaction)
48: */
49: protected void invoke(XSSLAction component) throws Exception {
50:
51: this .logDebug("Is component " + component.getClass()
52: + " definable? "
53: + (component instanceof ITransactionDefinable));
54:
55: if (component instanceof ITransactionDefinable) {
56: ((ITransactionDefinable) component).define(this .scope);
57: }
58: }
59:
60: protected Object executeIteratingElement(XSSLAction c,
61: boolean lastElement) throws Exception {
62: Object obj = null;
63:
64: if (((c instanceof XSSLReturn) && !((XSSLReturn) c)
65: .isPersisted(true))
66: || !(c instanceof XSSLReturn)) {
67: obj = super .executeIteratingElement(c, lastElement);
68: }
69:
70: return obj;
71: }
72:
73: /* (non-Javadoc)
74: * @seeResult#set()
75: */
76: protected void set() throws Exception {
77:
78: String scopeCd = this .getProperty(XSSLReturn.SCOPE);
79:
80: this .logDebug("Evaluating scope code: " + scopeCd);
81:
82: this .scope = this .evaluateScope(scopeCd);
83:
84: this .logDebug("Components will be defined in scope of: "
85: + this .scope);
86: }
87:
88: protected String setTagName() {
89: return TransactionDefine.TX_DEFINE_TAG_NAME;
90: }
91: }
|