Source Code Cross Referenced for Fiber.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) 


01:        package dalma;
02:
03:        import dalma.impl.FiberImpl;
04:
05:        /**
06:         * @author Kohsuke Kawaguchi
07:         */
08:        public abstract class Fiber<T extends Runnable> {
09:            /**
10:             * Gets the {@link Runnable} object that represents the entry point of this fiber.
11:             *
12:             * <p>
13:             * The state of {@link Fiber} is not always kept in memory. For example,
14:             * if a conversation is blocking on an event, its state is purged to the disk.
15:             * Because of this, this method can be only invoked from other {@link Fiber}s
16:             * in the same {@link Conversation}.
17:             *
18:             * @return
19:             *      never null. Always return the same {@link Runnable} object
20:             *      given to create a new {@link Fiber}.
21:             *
22:             * @throws IllegalStateException
23:             *      if this method is not invoked from a {@link Fiber} that belongs
24:             *      to the same {@link Conversation}.
25:             */
26:            public abstract T getRunnable();
27:
28:            /**
29:             * Starts executing this {@link Fiber}.
30:             *
31:             * This method works just like {@link Thread#start()}.
32:             *
33:             * @throws IllegalStateException
34:             *      if this fiber is already started.
35:             */
36:            public abstract void start();
37:
38:            /**
39:             * Waits until the execution of the fiber completes.
40:             * This method works like {@link Thread#join()}
41:             *
42:             * <p>
43:             * If called from another fiber, the calling fiber
44:             * suspends and blocks until this fiber exits (and
45:             * the thread will be reused to execute other fibers.)
46:             *
47:             * <p>
48:             * If called from outside conversations, the calling
49:             * method simply {@link #wait() waits}.
50:             *
51:             * @throws IllegalStateException
52:             *      If a fiber tries to join itself.
53:             * @throws InterruptedException
54:             *      If this thread is interrupted while waiting.
55:             */
56:            public abstract void join() throws InterruptedException;
57:
58:            /**
59:             * Gets the current state of the fiber.
60:             *
61:             * @return never null
62:             */
63:            public abstract FiberState getState();
64:
65:            /**
66:             * Gets the {@link Conversation} that this fiber belongs to.
67:             *
68:             * A {@link Fiber} always belongs to the same {@link Conversation}.
69:             *
70:             * @return never null
71:             */
72:            public abstract Conversation getOwner();
73:
74:            /**
75:             * Creates a new {@link Fiber} within the current conversation.
76:             */
77:            public static <T extends Runnable> Fiber<T> create(T entryPoint) {
78:                return FiberImpl.create(entryPoint);
79:            }
80:
81:            /**
82:             * Returns the {@link Fiber} that the current thread is executing.
83:             *
84:             * <p>
85:             * This mehtod can be only called from within the workflow.
86:             *
87:             * @throws IllegalStateException
88:             *      if the calling thread isn't a workflow thread.
89:             */
90:            public static Fiber<?> currentFiber() {
91:                return FiberImpl.currentFiber(true);
92:            }
93:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.