Java Doc for ScriptEngineManager.java in  » Scripting » beanshell » javax » script » 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 » beanshell » javax.script 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.script.ScriptEngineManager

ScriptEngineManager
public class ScriptEngineManager (Code)
The ScriptEngineManager implements a discovery and instantiation mechanism for ScriptEngine classes and also maintains a collection of key/value pairs storing state shared by all engines created by the Manager.

The Discovery feature uses the Service Provider mechanism described in the Jar File Specification to enumerate all implementations of ScriptEngineFactory which can be loaded by the thread context ClassLoader. If the current security policy does not allow access to thread context ClassLoader, then bootstrap loader is used. The ScriptEngineManager provides a method to return an array of all these factories as well as utility methods which look up factories on the basis of language name, file extension and mime type.

The Bindings of key/value pairs, referred to as the "Global Scope" maintained by the manager is available to all instances of ScriptEngine created by the ScriptEngineManager. The values in the Bindings are generally exposed in all scripts.
author:
   Mike Grogan
author:
   A. Sundararajan
since:
   1.6




Constructor Summary
public  ScriptEngineManager()
     The constructor checks for implementors of ScriptEngineFactory using the mechanism for discovering service providers described in the Jar File Specification.

Namely, it looks for resources named META-INF/services/javax.script.ScriptEngineFactory in the thread context ClassLoader.
public  ScriptEngineManager(ClassLoader loader)
     The constructor checks for implementors of ScriptEngineFactory using the mechanism for discovering service providers described in the Jar File Specification.

Namely, it looks for resources named META-INF/services/javax.script.ScriptEngineFactory in the given ClassLoader.

Method Summary
public  Objectget(String key)
     Gets the value for the specified key in the Global Scope
Parameters:
  key - The key whose value is to be returned.
public  BindingsgetBindings()
     getBindings returns the value of the globalScope field.
public  ScriptEnginegetEngineByExtension(String extension)
     Look up and create a ScriptEngine for a given extension.
public  ScriptEnginegetEngineByMimeType(String mimeType)
     Look up and create a ScriptEngine for a given mime type.
public  ScriptEnginegetEngineByName(String shortName)
     Looks up and creates a ScriptEngine for a given name. The algorithm first searches for a ScriptEngineFactory that has been registered as a handler for the specified name using the registerEngineName method.

If one is not found, it searches the array of ScriptEngineFactory instances stored by the constructor for one with the specified name.
public  List<ScriptEngineFactory>getEngineFactories()
     Returns an array whose elements are instances of all the ScriptEngineFactory classes found by the discovery mechanism.
public  voidput(String key, Object value)
     Sets the specified key/value pair in the Global Scope.
public  voidregisterEngineExtension(String extension, ScriptEngineFactory factory)
     Registers a ScriptEngineFactory to handle an extension.
public  voidregisterEngineMimeType(String type, ScriptEngineFactory factory)
     Registers a ScriptEngineFactory to handle a mime type.
public  voidregisterEngineName(String name, ScriptEngineFactory factory)
     Registers a ScriptEngineFactory to handle a language name.
public  voidsetBindings(Bindings bindings)
     setBindings stores the specified Bindings in the globalScope field.


Constructor Detail
ScriptEngineManager
public ScriptEngineManager()(Code)
The constructor checks for implementors of ScriptEngineFactory using the mechanism for discovering service providers described in the Jar File Specification.

Namely, it looks for resources named META-INF/services/javax.script.ScriptEngineFactory in the thread context ClassLoader. Each line in such a resource names a class implementing ScriptEngineFactory. An instance of each of these classes is created and stored in the engineSpis HashSet field. Invalid or incorrect entries are ignored. If thread context loader is not accessible by current security policy, then bootstrap loader will be used.



ScriptEngineManager
public ScriptEngineManager(ClassLoader loader)(Code)
The constructor checks for implementors of ScriptEngineFactory using the mechanism for discovering service providers described in the Jar File Specification.

Namely, it looks for resources named META-INF/services/javax.script.ScriptEngineFactory in the given ClassLoader. Each line in such a resource names a class implementing ScriptEngineFactory. An instance of each of these classes is created and stored in the engineSpis HashSet field. Invalid or incorrect entries are ignored.
Parameters:
  loader - ClassLoader used to discover factory resources.




Method Detail
get
public Object get(String key)(Code)
Gets the value for the specified key in the Global Scope
Parameters:
  key - The key whose value is to be returned. The value for the specified key.



getBindings
public Bindings getBindings()(Code)
getBindings returns the value of the globalScope field. The globalScope field.



getEngineByExtension
public ScriptEngine getEngineByExtension(String extension)(Code)
Look up and create a ScriptEngine for a given extension. The algorithm used by getEngineByName is used except that the search starts by looking for a ScriptEngineFactory registered to handle the given extension using registerEngineExtension.
Parameters:
  extension - The given extension The engine to handle scripts with this extension. Returns nullif not found.



getEngineByMimeType
public ScriptEngine getEngineByMimeType(String mimeType)(Code)
Look up and create a ScriptEngine for a given mime type. The algorithm used by getEngineByName is used except that the search starts by looking for a ScriptEngineFactory registered to handle the given mime type using registerEngineMimeType.
Parameters:
  mimeType - The given mime type The engine to handle scripts with this mime type. Returns nullif not found.



getEngineByName
public ScriptEngine getEngineByName(String shortName)(Code)
Looks up and creates a ScriptEngine for a given name. The algorithm first searches for a ScriptEngineFactory that has been registered as a handler for the specified name using the registerEngineName method.

If one is not found, it searches the array of ScriptEngineFactory instances stored by the constructor for one with the specified name. If a ScriptEngineFactory is found by either method, it is used to create instance of ScriptEngine.
Parameters:
  shortName - The short name of the ScriptEngine implementation.returned by the getName method of its ScriptEngineFactory. A ScriptEngine created by the factory located in the search. Returns nullif no such factory was found. The ScriptEngineManager sets its own globalScopeBindings as the GLOBAL_SCOPE Bindings of the newlycreated ScriptEngine.



getEngineFactories
public List<ScriptEngineFactory> getEngineFactories()(Code)
Returns an array whose elements are instances of all the ScriptEngineFactory classes found by the discovery mechanism. List of all discovered ScriptEngineFactorys.



put
public void put(String key, Object value)(Code)
Sets the specified key/value pair in the Global Scope.
Parameters:
  key - Key to set
Parameters:
  value - Value to set.
throws:
  NullPointerException - if key is null



registerEngineExtension
public void registerEngineExtension(String extension, ScriptEngineFactory factory)(Code)
Registers a ScriptEngineFactory to handle an extension. Overrides any such association found using the Discovery mechanism.
Parameters:
  extension - The extension type to be associated with theScriptEngineFactory.
Parameters:
  factory - The class to associate with the given extension.



registerEngineMimeType
public void registerEngineMimeType(String type, ScriptEngineFactory factory)(Code)
Registers a ScriptEngineFactory to handle a mime type. Overrides any such association found using the Discovery mechanism.
Parameters:
  type - The mime type to be associated with theScriptEngineFactory.
Parameters:
  factory - The class to associate with the given mime type.



registerEngineName
public void registerEngineName(String name, ScriptEngineFactory factory)(Code)
Registers a ScriptEngineFactory to handle a language name. Overrides any such association found using the Discovery mechanism.
Parameters:
  name - The name to be associated with the ScriptEngineFactory.
Parameters:
  factory - The class to associate with the given name.



setBindings
public void setBindings(Bindings bindings)(Code)
setBindings stores the specified Bindings in the globalScope field.
Parameters:
  bindings - The specified Bindings



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.