Source Code Cross Referenced for Program.java in  » Workflow-Engines » Dalma » dalma » 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 » Workflow Engines » Dalma » dalma 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package dalma;
002:
003:        import java.util.logging.Logger;
004:
005:        /**
006:         * Entry point of the user-implemented workflow application.
007:         *
008:         * <p>
009:         * A workflow application that runs inside the dalma container
010:         * needs to have a class that derives from this class. Such class
011:         * serves as the entry point to the workflow program, and its fully-qualified
012:         * class name must be <tt>Main</tt> (in the root package.)
013:         *
014:         * <h3>Configuring Program</h3>
015:         * <p>
016:         * A {@link Program} typically needs to be configured with environment-specific
017:         * information to function. For example, perhaps a program is some kind of e-mail
018:         * automation system and may use 2 e-mail endpoints and 1 IRC endpoint.
019:         *
020:         * A {@link Program} communicates these configuration requirements to the container
021:         * by using {@link Resource} annotation. In the above example, the {@link Program}
022:         * would be written something like:
023:         *
024:         * <pre>
025:         * class Main extends dalma.Program {
026:         *   &#x40;Resource
027:         *   public EmailEndPoint externalMail;
028:         *
029:         *   &#x40;Resource
030:         *   public EmailEndPoint maintananceMail;
031:         *
032:         *   &#x40;Resource
033:         *   public IRCEndPoint chatEndPoint;
034:         *
035:         *   &#x40;Resource
036:         *   public String greetingMessage;
037:         *
038:         *   ...
039:         * }
040:         * </pre>
041:         *
042:         * <p>
043:         * At runtime, the container invokes setters and sets fields to "inject" references
044:         * into the program before the {@link #init(Engine)} method
045:         * is invoked.
046:         *
047:         * @author Kohsuke Kawaguchi
048:         */
049:        public abstract class Program {
050:            /**
051:             * Called right after the {@link Engine} instance is created
052:             * and populated with the configured endpoints.
053:             *
054:             * <p>
055:             * This callback can be used to further configure endpoints,
056:             * for example by installing listeners and etc.
057:             *
058:             * <p>
059:             * In rare case, when a {@link Program} doesn't know statically
060:             * what endpoints it wants to use,
061:             * this callback can be also used to add additional endpoints
062:             * programatically if desired.
063:             *
064:             * <p>
065:             * Note that if kinds and endpoints are known statically,
066:             * then the {@link Program}-derived class can use a resource injection
067:             * to get access to those endpoints.
068:             *
069:             * @throws Exception
070:             *      Any exception thrown by this method is considered to indicate
071:             *      an error, and prevents the {@link Program} from running.
072:             */
073:            public void init(Engine engine) throws Exception {
074:                // noop
075:            }
076:
077:            /**
078:             * Called after the {@link Engine} is {@link Engine#start()} started.
079:             *
080:             * <p>
081:             * In rare case, when a {@link Program} wants to start a new
082:             * {@link Conversation} proactively, it can use this callback to do so.
083:             *
084:             * @throws Exception
085:             *      Any exception thrown by this method is considered to indicate
086:             *      an error, and prevents the {@link Program} from running.
087:             */
088:            public void main(Engine engine) throws Exception {
089:                // noop
090:            }
091:
092:            /**
093:             * Called right before the application is shut down,
094:             * to perform any optional clean up.
095:             *
096:             * @throws Exception
097:             *      Any exception thrown by this method is recorded
098:             *      but otherwise the shut down operation continues regardless. 
099:             */
100:            public void cleanup(Engine engine) throws Exception {
101:
102:            }
103:
104:            // start with the default logger instance so that the user program
105:            // can start using it even within the constructor.
106:            // we'll replace this with a real logger at some later stage
107:            // of initialization
108:            private Logger logger = Logger.getLogger(Program.class.getName());
109:
110:            /**
111:             * Gets the logger for this workflow application.
112:             *
113:             * <p>
114:             * Logs recorded by this logger will be made available
115:             * to the monitoring/management applications. 
116:             *
117:             * @return
118:             *      always non-null.
119:             */
120:            public Logger getLogger() {
121:                return logger;
122:            }
123:
124:            /**
125:             * Reserved for the container. Do not invoke this method.
126:             */
127:            public void setLogger(Logger logger) {
128:                this.logger = logger;
129:            }
130:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.