Java Doc for ModuleBase.java in  » Scripting » Pnuts » pnuts » ext » 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 » Pnuts » pnuts.ext 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   pnuts.ext.ModuleBase

All known Subclasses:   pnuts.security.init,  pnuts.nio.init,  pnuts.awt.init,  pnuts.multithread.init,  pnuts.text.init,  pnuts.regex.init,  pnuts.net.init,  org.pnuts.java_io.init,  pnuts.mail.init,  org.pnuts.java_net.init,  pnuts.jmx.init,  org.pnuts.java_util.init,  pnuts.io.init,  pnuts.math.init,  pnuts.beans.init,  pnuts.tools.init,  pnuts.util.init,  pnuts.lib.init,  pnuts.xml.init,  pnuts.servlet.init,  pnuts.jdbc.init,  pnuts.jdo.init,  pnuts.regex.jsr51.init,
ModuleBase
abstract public class ModuleBase implements Executable,Serializable(Code)
Base class of modules. This class provides convenient autloading functions and an error reporting function. Modules may (or may not) subclass this class.

Inner Class :class AutoloadFunction implements AutoloadHook,Serializable
Inner Class :static class AutoloadClass implements AutoloadHook,Serializable
Inner Class :static class ExportProperty implements Property,Serializable



Method Summary
protected  voidautoload(String[] functionNames, String file, Context context)
     Registers an autoloaded script for functionNames.
protected  voidautoloadClass(String javaPackage, String name, Context context)
     Registers an autoloaded Class object.
Parameters:
  javaPackage - Java package name, e.g.
protected  voidautoloadFunction(String functionName, Context context)
     Registers an autoloaded class for functionName.
static  PnutsFunctionerrorFunction()
    
protected  Objectexecute(Context context)
     Subclasses should override this method, instead of run(Context), to define the initialization process. If neither getSubModules() nor getRequiredModules() are redefined to return non-null value, execute() method should be implemented as the following steps. 1.
static  Propertyexports(Package pkg)
    
 AutoloadFunctiongetAutoloadFunctionHook(Package pkg)
    
protected  StringgetClassName(Package pkg, String name)
     Makes a class name for the specified package and the symbol's name.
protected  PackagegetPackage(Context context)
    
protected  StringgetPrefix()
     Defines the prefix of script class (resource) name.
protected  String[]getRequiredModules()
     This method is supposed to be redefined in a subclass to define a set of modules that are required to implement this module.
protected  String[]getSubModules()
     This method is supposed to be redefined in a subclass to define a set of modules that this module provides in the caller's context.
protected  ObjectnewInstance(Class cls)
     This method is redefined in subclasses so that package private classes can be used.
public  Objectrun(Context context)
     Defines ERROR and EXPORTS, and then call execute(Context).



Method Detail
autoload
protected void autoload(String[] functionNames, String file, Context context)(Code)
Registers an autoloaded script for functionNames. Also, functionNames are automatically exported.
Parameters:
  functionNames - the function names
Parameters:
  file - a script file to be loaded when one of the functionNames isfirst resolved.
Parameters:
  context - the context



autoloadClass
protected void autoloadClass(String javaPackage, String name, Context context)(Code)
Registers an autoloaded Class object.
Parameters:
  javaPackage - Java package name, e.g. "java.util"
Parameters:
  name - short Class name, e.g. "HashMap"
Parameters:
  context - the context



autoloadFunction
protected void autoloadFunction(String functionName, Context context)(Code)
Registers an autoloaded class for functionName. Also, the functionName is automatically exported.
Parameters:
  functionName - the function name
Parameters:
  context - the context



errorFunction
static PnutsFunction errorFunction()(Code)



execute
protected Object execute(Context context)(Code)
Subclasses should override this method, instead of run(Context), to define the initialization process. If neither getSubModules() nor getRequiredModules() are redefined to return non-null value, execute() method should be implemented as the following steps. 1. Call context.usePackage() to use the modules that this module provides 2. Call context.clearPackages() 3. Call context.usePackage() to use the module that this module requires 4. Define symbols (functions)
Parameters:
  context - the context



exports
static Property exports(Package pkg)(Code)



getAutoloadFunctionHook
AutoloadFunction getAutoloadFunctionHook(Package pkg)(Code)



getClassName
protected String getClassName(Package pkg, String name)(Code)
Makes a class name for the specified package and the symbol's name.
Parameters:
  pkg - the package
Parameters:
  name - the symbol the name of the class



getPackage
protected Package getPackage(Context context)(Code)



getPrefix
protected String getPrefix()(Code)
Defines the prefix of script class (resource) name. This method is overriden by subclasses.



getRequiredModules
protected String[] getRequiredModules()(Code)
This method is supposed to be redefined in a subclass to define a set of modules that are required to implement this module. If this method returns an array of module names (non-null), Context.clearPackages() is called, then the modules are used()'d, before calling execute() method.



getSubModules
protected String[] getSubModules()(Code)
This method is supposed to be redefined in a subclass to define a set of modules that this module provides in the caller's context. If this method returns an array of module names (non-null), they are use()'d, then Context.clearPackages() is called, before calling execute() method.



newInstance
protected Object newInstance(Class cls) throws IllegalAccessException, InstantiationException(Code)
This method is redefined in subclasses so that package private classes can be used.
Parameters:
  cls - the class to be instantiated an instance of the class



run
public Object run(Context context)(Code)
Defines ERROR and EXPORTS, and then call execute(Context).
Parameters:
  context - the context



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.