Source Code Cross Referenced for TransactionTrigger.java in  » XML » activexml » org » xdev » base » xssl » manage » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » XML » activexml » org.xdev.base.xssl.manage 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Created on Jan 8, 2004
003:         *
004:         * To change the template for this generated file go to
005:         * Window>Preferences>Java>Code Generation>Code and Comments
006:         */
007:        package org.xdev.base.xssl.manage;
008:
009:        import java.util.HashMap;
010:        import java.util.Observable;
011:        import java.util.Observer;
012:
013:        import org.xdev.base.core.object.Configuration;
014:        import org.xdev.base.core.object.ConfigurationObserver;
015:        import org.xdev.base.xssl.XReference;
016:        import org.xdev.base.xssl.XSSLAction;
017:        import org.xdev.base.xssl.XSSLReturn;
018:        import org.xdev.base.xssl.XPointer;
019:
020:        /**
021:         * @author AYegorov
022:         *
023:         * To change the template for this generated type comment go to
024:         * Window>Preferences>Java>Code Generation>Code and Comments
025:         */
026:        public class TransactionTrigger extends XSSLReturn implements 
027:                ConfigurationObserver {
028:            public static final String TRIGGER_TARGET = "target";
029:            public static final String TRIGGER_SOURCE = "source";
030:            public static final String TRIGGER_ON = "on";
031:
032:            private Object returnedObject = null;
033:
034:            private ITransactionTriggerable triggered = null;
035:
036:            /**
037:             * @param id
038:             */
039:            public TransactionTrigger(String id) {
040:                super (id);
041:                // XXX Auto-generated constructor stub
042:            }
043:
044:            /**
045:             * @param id
046:             * @param properties
047:             */
048:            public TransactionTrigger(String id, HashMap properties) {
049:                super (id, properties);
050:                // XXX Auto-generated constructor stub
051:            }
052:
053:            /* (non-Javadoc)
054:             * @see org.xdev.base.xssl.XSSLReturn#getValue()
055:             */
056:            public Object getObjectValue() {
057:                // XXX Auto-generated method stub
058:                return this .returnedObject;
059:            }
060:
061:            /* (non-Javadoc)
062:             * @see org.xdev.base.xssl.XSSLAction#set()
063:             */
064:            protected void set() throws Exception {
065:                TransactionTrigger trigger = (TransactionTrigger) this 
066:                        .getReference();
067:
068:                this .logDebug("Triggering..." + trigger);
069:
070:                if (trigger == null
071:                        || TransactionTrigger.TRIGGER_TARGET.equals(this 
072:                                .getProperty(TransactionTrigger.TRIGGER_ON))) {
073:
074:                    if (trigger == null) {
075:
076:                        trigger = this ;
077:
078:                        this .setReference(this );
079:
080:                    }
081:
082:                    XSSLAction action = (XSSLAction) this .getElement(0);
083:
084:                    if (this .getBooleanProperty("passive")
085:                            || action.execute(this )) {
086:
087:                        this .logDebug("Action " + action.getClass()
088:                                + " is transaction triggerable: "
089:                                + (action instanceof  ITransactionTriggerable));
090:
091:                        if (action instanceof  XReference) {
092:                            action = (XSSLAction) ((XReference) action)
093:                                    .getObjectValue();
094:                        }
095:
096:                        this .triggered = (ITransactionTriggerable) action;
097:                    }
098:                } else if ((trigger != null || TransactionTrigger.TRIGGER_SOURCE
099:                        .equals(this .getProperty(TransactionTrigger.TRIGGER_ON))
100:                        && this .getCount() > 0)) {
101:
102:                    //trigger = this;
103:
104:                    this .setReference(this );
105:
106:                    XSSLAction ob = (XSSLAction) this .getElement(0);
107:
108:                    if (ob instanceof  XReference) {
109:                        ob = (XSSLAction) ((XSSLReturn) ob).getObjectValue();
110:                    }
111:
112:                    ob.addObserver(trigger);
113:
114:                    ob.execute(this );
115:                }
116:            }
117:
118:            /* (non-Javadoc)
119:             * @see java.util.Observer#update(java.util.Observable, java.lang.Object)
120:             */
121:            public void update(Configuration o, Object arg) throws Exception {
122:
123:                if (this .eventList.contains(arg)) {
124:
125:                    try {
126:                        ((XSSLAction) this .triggered)
127:                                .issueTrigger(XSSLAction.TRIGGER_START_EVENT);
128:
129:                        if (((XSSLAction) this .triggered)
130:                                .getBooleanProperty("passive")) {
131:                            ((XSSLAction) this .triggered).execute(this );
132:
133:                            if (this .triggered instanceof  XSSLReturn) {
134:
135:                                this .returnedObject = ((XSSLReturn) this .triggered)
136:                                        .getObjectValue();
137:
138:                            }
139:                        }
140:
141:                        this .triggered.trigger(o, arg);
142:
143:                        ((XSSLAction) this .triggered)
144:                                .issueTrigger(XSSLAction.TRIGGER_END_EVENT);
145:                    } catch (Exception ex) {
146:                        ((XSSLAction) this .triggered)
147:                                .issueTrigger(XSSLAction.TRIGGER_ERROR_EVENT);
148:                        this .logDebug(ex);
149:                    }
150:
151:                    this .logDebug("Action " + this .triggered
152:                            + " triggered by: " + o + " with argument: " + arg);
153:
154:                    ((XSSLAction) this .triggered).issueTrigger(
155:                            XSSLAction.TRIGGER_BEFORE_REMOVE_EVENT, o);
156:
157:                    o.deleteObserver(this );
158:
159:                    ((XSSLAction) this .triggered)
160:                            .issueTrigger(XSSLAction.TRIGGER_AFTER_REMOVE_EVENT);
161:                }
162:            }
163:
164:            /**
165:             * @return Returns the returnedObject.
166:             */
167:            public Object getReturnedObject() {
168:                return returnedObject;
169:            }
170:
171:            /**
172:             * @return Returns the triggered.
173:             */
174:            public ITransactionTriggerable getTriggered() {
175:                return triggered;
176:            }
177:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.