01: /*
02: * Created on Feb 17, 2004
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.HashMap;
10:
11: import org.xdev.base.core.AbstractPersistance;
12: import org.xdev.base.xssl.XSSLAction;
13: import org.xdev.base.xssl.XSSLReference;
14:
15: /**
16: * @author AYegorov
17: *
18: * To change the template for this generated type comment go to
19: * Window>Preferences>Java>Code Generation>Code and Comments
20: */
21: public class TransactionReturn extends XSSLReference {
22:
23: public static final String RETURN_NAME = "return-name";
24:
25: /**
26: * @param id
27: */
28: public TransactionReturn(String id) {
29: super (id);
30: // XXX Auto-generated constructor stub
31: }
32:
33: /**
34: * @param id
35: * @param properties
36: */
37: public TransactionReturn(String id, HashMap properties) {
38: super (id, properties);
39: // XXX Auto-generated constructor stub
40: }
41:
42: /* (non-Javadoc)
43: * @see org.xdev.base.xssl.XSSLReference#processReference(java.lang.Object)
44: */
45: protected Object processReference(Object reference)
46: throws Exception {
47: Object obj = null;
48:
49: if (reference == null && this .getCount() > 0) {
50: reference = this .getElement(0);
51: ((XSSLAction) reference).execute(this );
52: }
53:
54: this .logDebug("Return reference received: " + reference);
55:
56: if (reference != null && reference instanceof XSSLAction) {
57: AbstractPersistance p = ((XSSLAction) reference)
58: .getPersistance();
59:
60: this .logDebug("Persistance received to process return: "
61: + p);
62:
63: String returnName = this
64: .getProperty(TransactionReturn.RETURN_NAME);
65:
66: if (returnName != null && !"".equals(returnName)) {
67:
68: obj = p.get(returnName);
69:
70: this .logDebug("Return object " + returnName
71: + " received: " + obj);
72: } else {
73: obj = p;
74: }
75: }
76:
77: return obj;
78: }
79: }
|