Java Doc for BSFCondition.java in  » Workflow-Engines » osbl-1_0 » org » concern » library » bsf » 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 » osbl 1_0 » org.concern.library.bsf 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.concern.controller.AbstractCondition
   org.concern.library.bsf.BSFCondition

BSFCondition
public class BSFCondition extends AbstractCondition (Code)
Allows any BSF script to be used as a con:cern condition. Two environment variables must be set in order for this to concern: language and script. "language" should contain the BSF name for the scripting language of the script, and "script" should contain the script itself. As a convenience, you may set the "default-script-language" environment variable at the process level if you plan on using the same scripting language throughout your process.

This implementation assumes that you have already configured BSFManager with any additional languages you need. This implementation will declare the following additional beans before executing the script:

  • subject = the subject instance, as passed into the condition
  • condition = the condition instance
  • environment = the java.util.Map representing the environment for this condition.
  • controller = the controller instance
For most scripting languages, these beans will be made available for direct use. For example (in groovy):
  subject.approval == subject.ACCEPTED

Note: for those using the Groovy scripting language, testing has shown that Groovy's current implementation of the BSF scripting engine (org.codehaus.groovy.bsf.GroovyEngine) is extremely slow, probably because it is parsing the script for every invocation (by slow, we mean that we have observed 500-1100 ms execution time per invocation of a condition). We've found that a good workaround is to use Groovy's caching BSF scripting engine (org.codehaus.groovy.bsf.CachingGroovyEngine). Obviously, since this engine caches based on the script String, it will consume more memory. However, Con:cern processes tend to use a fairly static set of small script Strings, which fits well with the caching strategy, bringing memory consumption in line with typical expectations. Here is an example configuration:


 BSFManager.registerScriptingEngine("groovy",
 "org.codehaus.groovy.bsf.CachingGroovyEngine",
 new String[] { "groovy", "gy" });
 

author:
   Andy DePue


Field Summary
final public static  StringENV_KEY_LANGUAGE
    
final public static  StringENV_KEY_SCRIPT
    
final public static  StringPROCESS_ENV_KEY_LANGUAGE
    


Method Summary
protected  BSFManagercreateBsfManager()
    
protected  voiddeclareAdditionalBeans(BSFManager bsfm, Object subject)
     Subclasses can override this method to further prepare the BSFManager before script execution takes place.
public  booleaneval(Object subject)
    
public  BSFManagergetBsfManager()
    
public  StringgetLanguage()
    
public  ObjectgetScript()
    
public  StringgetSourceName()
    
public  voidsetBsfManager(BSFManager bsfManager)
    
public  voidsetLanguage(String language)
    
public  voidsetScript(String script)
    

Field Detail
ENV_KEY_LANGUAGE
final public static String ENV_KEY_LANGUAGE(Code)



ENV_KEY_SCRIPT
final public static String ENV_KEY_SCRIPT(Code)



PROCESS_ENV_KEY_LANGUAGE
final public static String PROCESS_ENV_KEY_LANGUAGE(Code)





Method Detail
createBsfManager
protected BSFManager createBsfManager()(Code)



declareAdditionalBeans
protected void declareAdditionalBeans(BSFManager bsfm, Object subject) throws ConditionEvaluationException, BSFException(Code)
Subclasses can override this method to further prepare the BSFManager before script execution takes place.
Parameters:
  bsfm -
Parameters:
  subject -
throws:
  ConditionEvaluationException -
throws:
  BSFException -



eval
public boolean eval(Object subject) throws ConditionEvaluationException(Code)



getBsfManager
public BSFManager getBsfManager()(Code)



getLanguage
public String getLanguage()(Code)



getScript
public Object getScript()(Code)



getSourceName
public String getSourceName()(Code)



setBsfManager
public void setBsfManager(BSFManager bsfManager)(Code)



setLanguage
public void setLanguage(String language)(Code)



setScript
public void setScript(String script)(Code)



Methods inherited from org.concern.controller.AbstractCondition
final public String getName()(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.