Java Doc for Engine.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 Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   dalma.Engine

All known Subclasses:   dalma.spi.EngineSPI,
Engine
abstract public class Engine (Code)
Workflow engine.
author:
   Kohsuke Kawaguchi




Method Summary
abstract public  voidaddEndPoint(EndPoint endPoint)
     Adds a new EndPoint to this engine.
abstract public  EndPointaddEndPoint(String endPointName, String endpointURL)
     Creates and adds a new EndPoint to this engine.

See this document for details.
Parameters:
  endPointName - name of the endpoint.

abstract public  Map<String, EndPoint>addEndPoints(Properties endpointURLs)
     Adds multiple EndPoint s to this engine at once.

Suppose you have a property file like this:

 email1=smtp://hangman@kohsuke.org!pop3://username:password@mail.kohsuke.org
 email2=smtp://oracle@kohsuke.org!pop3://username:password@mail.kohsuke.org
 

You can then read this file into Properties , and then pass that into this method to add two EndPoint s with one method call.

This is convenient when you are externalizing the endpoint configuration in a property file.
Parameters:
  endpointURLs - Properties that has the endpoint name as a key andendpoint URL as a value.

abstract public  voidaddListener(EngineListener listener)
     Adds an EngineListener to this engine.
abstract public  voidconfigureWithBSF(File scriptFile)
     Configures an engine by using Bean Scripting Framework.

This method is intended to run a script that configures endpoints. By moving the endpoint configuration to a script, you can allow it to be changed at runtime.

For this method to work, you need to have:

  1. bsf.jar in your classpath
  2. scripting language engine that you use in your classpath (for example, if you use BeanShell, you need bsh.jar)

The file extension is used to determine the scripting language engine. For the list of languages available out-of-box with BSF and their registered file extensions, see this document. For example, beanshell is ".bsh", groovy is ".groovy", JavaScript is ".js".

The Engine object is made available to the script with the name 'engine'.
Parameters:
  scriptFile - The file that contains the script to be run.

abstract public  ConversationcreateConversation(Workflow workflow)
     Creates a new managed workflow instance.

This method starts the given Workflow as a dalma-managed workflow instance inside this engine.
Parameters:
  workflow - The workflow program to be run.

abstract public  ConversationcreateConversation(Runnable workflow)
     Creates a new managed workflow instance.
abstract public  ConversationgetConversation(int id)
     Gets the Conversation of a specific ID.
abstract public  Collection<Conversation>getConversations()
     Returns the list of Conversation s in this engine. always return non-null collection.
abstract public  intgetConversationsSize()
     Gets the number of Conversation s in this engine.
abstract public  EndPointgetEndPoint(String name)
     Gets the EndPoint of the given name.
abstract public  Map<String, EndPoint>getEndPoints()
     Gets a read-only copy of all the EndPoint s in this engine.
abstract public  ErrorHandlergetErrorHandler()
     Gets the ErrorHandler . This method returns the value set by the last Engine.setErrorHandler(ErrorHandler) invocation.
abstract public  DategetLastActiveTime()
     Gets the timestamp when any of the conversations run last time.
abstract public  booleanisStarted()
     Returns true if the engine has already Engine.start() started .
abstract public  voidremoveListener(EngineListener listener)
     Removes an existing EngineListener to this engine.
abstract public  voidsetErrorHandler(ErrorHandler errorHandler)
     Sets the ErrorHandler .
abstract public  voidsetLogger(Logger logger)
     Sets the logger that this engine uses.
abstract public  voidstart()
     Starts the engine and activates all the EndPoint s.
abstract public  voidstop()
     Stops the engine and releases all the resources it acquired.
abstract public  voidwaitForCompletion()
     Waits until all the conversation in the engine exits.



Method Detail
addEndPoint
abstract public void addEndPoint(EndPoint endPoint)(Code)
Adds a new EndPoint to this engine.
throws:
  IllegalArgumentException - if there's already an EndPoint that has the same name.
throws:
  IllegalStateException - if the engine is already started.



addEndPoint
abstract public EndPoint addEndPoint(String endPointName, String endpointURL) throws ParseException(Code)
Creates and adds a new EndPoint to this engine.

See this document for details.
Parameters:
  endPointName - name of the endpoint. this will become the valuereturned from EndPoint.getName. Must not be null.
Parameters:
  endpointURL - configuration of an endpoint encoded in an URI form.must not be null.
throws:
  ParseException - if there's an error in the connection string.
throws:
  IllegalArgumentException - if there's already an EndPoint that has the same name.
throws:
  IllegalStateException - if the engine is already started.the endpoint created from the connection string.




addEndPoints
abstract public Map<String, EndPoint> addEndPoints(Properties endpointURLs) throws ParseException(Code)
Adds multiple EndPoint s to this engine at once.

Suppose you have a property file like this:

 email1=smtp://hangman@kohsuke.org!pop3://username:password@mail.kohsuke.org
 email2=smtp://oracle@kohsuke.org!pop3://username:password@mail.kohsuke.org
 

You can then read this file into Properties , and then pass that into this method to add two EndPoint s with one method call.

This is convenient when you are externalizing the endpoint configuration in a property file.
Parameters:
  endpointURLs - Properties that has the endpoint name as a key andendpoint URL as a value. Can be empty but must not be null.a map that contains the newly created EndPoints keyed by their names.
throws:
  ParseException - if Dalma fails to parse any of the endpoint URLs.
throws:
  IllegalStateException - if the engine is already started.




addListener
abstract public void addListener(EngineListener listener)(Code)
Adds an EngineListener to this engine.
Parameters:
  listener - must not be null.



configureWithBSF
abstract public void configureWithBSF(File scriptFile) throws IOException(Code)
Configures an engine by using Bean Scripting Framework.

This method is intended to run a script that configures endpoints. By moving the endpoint configuration to a script, you can allow it to be changed at runtime.

For this method to work, you need to have:

  1. bsf.jar in your classpath
  2. scripting language engine that you use in your classpath (for example, if you use BeanShell, you need bsh.jar)

The file extension is used to determine the scripting language engine. For the list of languages available out-of-box with BSF and their registered file extensions, see this document. For example, beanshell is ".bsh", groovy is ".groovy", JavaScript is ".js".

The Engine object is made available to the script with the name 'engine'.
Parameters:
  scriptFile - The file that contains the script to be run. Must not be null.
See Also:    http://dalma.dev.java.net/nonav/maven/configure.html#Configuring_with_Bean_Scripting_Framework




createConversation
abstract public Conversation createConversation(Workflow workflow) throws IOException(Code)
Creates a new managed workflow instance.

This method starts the given Workflow as a dalma-managed workflow instance inside this engine.
Parameters:
  workflow - The workflow program to be run. Must not be null.A Conversation object that represents the started workflow.Always non-null.
throws:
  IllegalStateException - if the engine has not Engine.start() stareted yet.




createConversation
abstract public Conversation createConversation(Runnable workflow) throws IOException(Code)
Creates a new managed workflow instance.

This method is similar to Engine.createConversation(Workflow) , but it allows you to run any Runnable as a Workflow .
throws:
  IllegalStateException - if the engine has not Engine.start() stareted yet.




getConversation
abstract public Conversation getConversation(int id)(Code)
Gets the Conversation of a specific ID. null if no such conversation exists.
throws:
  IllegalStateException - if the engine has not Engine.start() stareted yet.



getConversations
abstract public Collection<Conversation> getConversations()(Code)
Returns the list of Conversation s in this engine. always return non-null collection. The returned objectis a snapshot of the conversations.
throws:
  IllegalStateException - if the engine has not Engine.start() stareted yet.



getConversationsSize
abstract public int getConversationsSize()(Code)
Gets the number of Conversation s in this engine.

Short for getConversations().size(), but more efficient. a non-negative integer.




getEndPoint
abstract public EndPoint getEndPoint(String name)(Code)
Gets the EndPoint of the given name. null if no such EndPoint is found.



getEndPoints
abstract public Map<String, EndPoint> getEndPoints()(Code)
Gets a read-only copy of all the EndPoint s in this engine. always retrun non-null (but possibly empty) collection.



getErrorHandler
abstract public ErrorHandler getErrorHandler()(Code)
Gets the ErrorHandler . This method returns the value set by the last Engine.setErrorHandler(ErrorHandler) invocation. The property is initially null, in which case the engine uses ErrorHandler.DEFAULT .



getLastActiveTime
abstract public Date getLastActiveTime()(Code)
Gets the timestamp when any of the conversations run last time.

For example, if all the conversations are blocked on a particular condition for 15 minutes, this method returns "now-15min".

This information is persisted and carried across engine lifespan, but due to a performance reason, it's only persisted lazily, and as a consequence it may fail to report a correct value when the engine terminated abnormally.

If nothing has ever run before (such as right after a new engine is instanciated), this method returns new Date(0). always non-null.




isStarted
abstract public boolean isStarted()(Code)
Returns true if the engine has already Engine.start() started .



removeListener
abstract public void removeListener(EngineListener listener)(Code)
Removes an existing EngineListener to this engine.
Parameters:
  listener - must not be null.
throws:
  IllegalArgumentException - if the given listener was not registered to this engine.



setErrorHandler
abstract public void setErrorHandler(ErrorHandler errorHandler)(Code)
Sets the ErrorHandler .

This ErrorHandler receives uncaught exceptions thrown from conversations.
See Also:   ErrorHandler




setLogger
abstract public void setLogger(Logger logger)(Code)
Sets the logger that this engine uses.

The default logger, if this method is not invoked, is "dalma.impl.....".
Parameters:
  logger - if null, the engine will stop logging.




start
abstract public void start()(Code)
Starts the engine and activates all the EndPoint s.

This method must be called after all the EndPoint s are added to the engine, and before a conversation is submitted.

This method may throw an exception if any of the dalma components (such as the engine and endpoints) fail to start correctly.
throws:
  IllegalStateException - if the engin has already been started.




stop
abstract public void stop()(Code)
Stops the engine and releases all the resources it acquired.

This method blocks until all the running Conversation suspends/completes, so it may take some time.




waitForCompletion
abstract public void waitForCompletion() throws InterruptedException(Code)
Waits until all the conversation in the engine exits.

This is different from the Engine.stop() method; this method simply blocks the calling thread until all the conversations in this engine completes. Just because there's no conversation in the engine doesn't mean that the engine is going to shutdown.




Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.