Java Doc for BSFEngine.java in  » Scripting » bsf-2.4.0 » org » apache » 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 » Scripting » bsf 2.4.0 » org.apache.bsf 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.bsf.BSFEngine

All known Subclasses:   org.apache.bsf.util.BSFEngineImpl,
BSFEngine
public interface BSFEngine extends PropertyChangeListener(Code)
This is the view of a scripting engine assumed by the Bean Scripting Framework. This interface is used when an application decides to run some script under application control. (This is the reverse of the more common situation, which is that of the scripting language calling into the application.)

When a scripting engine is first fired up, the initialize() method is called right after construction.

A scripting engine must provide two access points for applications to call into them: via function calls and via expression evaluation. It must also support loading scripts.

A scripting engine is a property change listener and will be notified when any of the relevant properties of the manager change. (See BSFManager to see which of its properties are bound.)
author:
   Sanjiva Weerawarana
author:
   Matthew J. Duftler





Method Summary
public  Objectapply(String source, int lineNo, int columnNo, Object funcBody, Vector paramNames, Vector arguments)
     This is used by an application to invoke an anonymous function.
public  Objectcall(Object object, String name, Object[] args)
     This is used by an application to call into the scripting engine to make a function/method call.
public  voidcompileApply(String source, int lineNo, int columnNo, Object funcBody, Vector paramNames, Vector arguments, CodeBuffer cb)
     This is used by an application to compile an anonymous function.
public  voidcompileExpr(String source, int lineNo, int columnNo, Object expr, CodeBuffer cb)
     This is used by an application to compile a value-returning expression. The expr may be string or some other type, depending on the language. The generated code is dumped into the CodeBuffer.
Parameters:
  source - (context info) the source of this expression(e.g., filename)
Parameters:
  lineNo - (context info) the line number in source for expr
Parameters:
  columnNo - (context info) the column number in source for expr
Parameters:
  expr - the expression to compile
Parameters:
  cb - the CodeBuffer to compile into
exception:
  BSFException - if anything goes wrong while compiling aBSFException is thrown.
public  voidcompileScript(String source, int lineNo, int columnNo, Object script, CodeBuffer cb)
     This is used by an application to compile some script.
public  voiddeclareBean(BSFDeclaredBean bean)
     Declare a bean after the engine has been started.
public  Objecteval(String source, int lineNo, int columnNo, Object expr)
     This is used by an application to evaluate an expression.
public  voidexec(String source, int lineNo, int columnNo, Object script)
     This is used by an application to execute some script.
public  voidiexec(String source, int lineNo, int columnNo, Object script)
     This is used by an application to execute some script, as though one were interacting with the language in an interactive session.
public  voidinitialize(BSFManager mgr, String lang, Vector declaredBeans)
     This method is used to initialize the engine right after construction. This method will be called before any calls to eval or call.
public  voidterminate()
    
public  voidundeclareBean(BSFDeclaredBean bean)
     Undeclare a previously declared bean.



Method Detail
apply
public Object apply(String source, int lineNo, int columnNo, Object funcBody, Vector paramNames, Vector arguments) throws BSFException(Code)
This is used by an application to invoke an anonymous function. An anonymous function is a multi-line script which when evaluated will produce a value. These are separated from expressions and scripts because the prior are spsed to be good 'ol expressions and scripts are not value returning. We allow anonymous functions to have parameters as well for completeness.
Parameters:
  source - (context info) the source of this expression(e.g., filename)
Parameters:
  lineNo - (context info) the line number in source for expr
Parameters:
  columnNo - (context info) the column number in source for expr
Parameters:
  funcBody - the multi-line, value returning script to evaluate
Parameters:
  paramNames - the names of the parameters above assumes
Parameters:
  arguments - values of the above parameters
exception:
  BSFException - if anything goes wrong while doin' it.



call
public Object call(Object object, String name, Object[] args) throws BSFException(Code)
This is used by an application to call into the scripting engine to make a function/method call. The "object" argument is the object whose method is to be called, if that applies. For non-OO languages, this is typically ignored and should be given as null. For pretend-OO languages such as VB, this would be the (String) name of the object. The arguments are given in the args array.
Parameters:
  object - object on which to make the call
Parameters:
  name - name of the method / procedure to call
Parameters:
  args - the arguments to be given to the procedure
exception:
  BSFException - if anything goes wrong while eval'ing aBSFException is thrown. The reason indicates the problem.



compileApply
public void compileApply(String source, int lineNo, int columnNo, Object funcBody, Vector paramNames, Vector arguments, CodeBuffer cb) throws BSFException(Code)
This is used by an application to compile an anonymous function. See comments in apply for more hdetails.
Parameters:
  source - (context info) the source of this expression(e.g., filename)
Parameters:
  lineNo - (context info) the line number in source for expr
Parameters:
  columnNo - (context info) the column number in source for expr
Parameters:
  funcBody - the multi-line, value returning script to evaluate
Parameters:
  paramNames - the names of the parameters above assumes
Parameters:
  arguments - values of the above parameters
Parameters:
  cb - the CodeBuffer to compile into
exception:
  BSFException - if anything goes wrong while doin' it.



compileExpr
public void compileExpr(String source, int lineNo, int columnNo, Object expr, CodeBuffer cb) throws BSFException(Code)
This is used by an application to compile a value-returning expression. The expr may be string or some other type, depending on the language. The generated code is dumped into the CodeBuffer.
Parameters:
  source - (context info) the source of this expression(e.g., filename)
Parameters:
  lineNo - (context info) the line number in source for expr
Parameters:
  columnNo - (context info) the column number in source for expr
Parameters:
  expr - the expression to compile
Parameters:
  cb - the CodeBuffer to compile into
exception:
  BSFException - if anything goes wrong while compiling aBSFException is thrown. The reason indicates the problem.



compileScript
public void compileScript(String source, int lineNo, int columnNo, Object script, CodeBuffer cb) throws BSFException(Code)
This is used by an application to compile some script. The script may be string or some other type, depending on the language. The generated code is dumped into the CodeBuffer.
Parameters:
  source - (context info) the source of this script(e.g., filename)
Parameters:
  lineNo - (context info) the line number in source for script
Parameters:
  columnNo - (context info) the column number in source for script
Parameters:
  script - the script to compile
Parameters:
  cb - the CodeBuffer to compile into
exception:
  BSFException - if anything goes wrong while compiling aBSFException is thrown. The reason indicates the problem.



declareBean
public void declareBean(BSFDeclaredBean bean) throws BSFException(Code)
Declare a bean after the engine has been started. Declared beans are beans that are named and which the engine must make available to the scripts it runs in the most first class way possible.
Parameters:
  bean - the bean to declare
exception:
  BSFException - if the engine cannot do this operation



eval
public Object eval(String source, int lineNo, int columnNo, Object expr) throws BSFException(Code)
This is used by an application to evaluate an expression. The expression may be string or some other type, depending on the language. (For example, for BML it'll be an org.w3c.dom.Element object.)
Parameters:
  source - (context info) the source of this expression(e.g., filename)
Parameters:
  lineNo - (context info) the line number in source for expr
Parameters:
  columnNo - (context info) the column number in source for expr
Parameters:
  expr - the expression to evaluate
exception:
  BSFException - if anything goes wrong while eval'ing aBSFException is thrown. The reason indicates the problem.



exec
public void exec(String source, int lineNo, int columnNo, Object script) throws BSFException(Code)
This is used by an application to execute some script. The expression may be string or some other type, depending on the language. Returns nothing but if something goes wrong it excepts (of course).
Parameters:
  source - (context info) the source of this expression(e.g., filename)
Parameters:
  lineNo - (context info) the line number in source for expr
Parameters:
  columnNo - (context info) the column number in source for expr
Parameters:
  script - the script to execute
exception:
  BSFException - if anything goes wrong while exec'ing aBSFException is thrown. The reason indicates the problem.



iexec
public void iexec(String source, int lineNo, int columnNo, Object script) throws BSFException(Code)
This is used by an application to execute some script, as though one were interacting with the language in an interactive session. The expression may be string or some other type, depending on the language. Returns nothing but if something goes wrong it excepts (of course).
Parameters:
  source - (context info) the source of this expression(e.g., filename)
Parameters:
  lineNo - (context info) the line number in source for expr
Parameters:
  columnNo - (context info) the column number in source for expr
Parameters:
  script - the script to execute
exception:
  BSFException - if anything goes wrong while exec'ing aBSFException is thrown. The reason indicates the problem.



initialize
public void initialize(BSFManager mgr, String lang, Vector declaredBeans) throws BSFException(Code)
This method is used to initialize the engine right after construction. This method will be called before any calls to eval or call. At this time the engine should capture the current values of interesting properties from the manager. In the future, any changes to those will be mirrored to me by the manager via a property change event.
Parameters:
  mgr - The BSFManager that's hosting this engine.
Parameters:
  lang - Language string which this engine is handling.
Parameters:
  declaredBeans - Vector of BSFDeclaredObject containing beansthat should be declared into the language runtime at inittime as best as possible.
exception:
  BSFException - if anything goes wrong while init'ing aBSFException is thrown. The reason indicates the problem.



terminate
public void terminate()(Code)
Graceful termination



undeclareBean
public void undeclareBean(BSFDeclaredBean bean) throws BSFException(Code)
Undeclare a previously declared bean.
Parameters:
  bean - the bean to undeclare
exception:
  BSFException - if the engine cannot do this operation



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