Source Code Cross Referenced for BlendExtension.java in  » Scripting » jacl » tcl » lang » 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 » jacl » tcl.lang 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* 
002:         * BlendExtension.java --
003:         *
004:         *	This extension encapsulates the java::* commands.
005:         *
006:         * Copyright (c) 1997-1998 by Sun Microsystems, Inc.
007:         *
008:         * See the file "license.terms" for information on usage and redistribution
009:         * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
010:         *
011:         * RCS: @(#) $Id: BlendExtension.java,v 1.26 2007/06/07 20:52:15 mdejong Exp $
012:         */
013:
014:        package tcl.lang;
015:
016:        public class BlendExtension extends Extension {
017:
018:            /*
019:             *----------------------------------------------------------------------
020:             *
021:             * init --
022:             *
023:             *	Initialize the java pacakge.
024:             *
025:             * Results:
026:             *	None.
027:             *
028:             * Side effects:
029:             *	Creates the java namespace and java::* commands.
030:             *
031:             *----------------------------------------------------------------------
032:             */
033:
034:            public void init(Interp interp) // Interpreter to intialize.
035:                    throws TclException {
036:                if (interp.getCommand("java::new") != null) {
037:                    throw new TclRuntimeError(
038:                            "BlendExtension.init() invoked twice in same interp");
039:                }
040:
041:                // Create the commands in the Java package
042:
043:                loadOnDemand(interp, "java::bind", "tcl.lang.JavaBindCmd");
044:                loadOnDemand(interp, "java::call", "tcl.lang.JavaCallCmd");
045:                loadOnDemand(interp, "java::cast", "tcl.lang.JavaCastCmd");
046:                loadOnDemand(interp, "java::defineclass",
047:                        "tcl.lang.JavaDefineClassCmd");
048:                loadOnDemand(interp, "java::event", "tcl.lang.JavaEventCmd");
049:                loadOnDemand(interp, "java::field", "tcl.lang.JavaFieldCmd");
050:                loadOnDemand(interp, "java::for", "tcl.lang.JavaForCmd");
051:                loadOnDemand(interp, "java::getinterp",
052:                        "tcl.lang.JavaGetInterpCmd");
053:                loadOnDemand(interp, "java::import", "tcl.lang.JavaImportCmd");
054:                loadOnDemand(interp, "java::info", "tcl.lang.JavaInfoCmd");
055:                loadOnDemand(interp, "java::instanceof",
056:                        "tcl.lang.JavaInstanceofCmd");
057:                loadOnDemand(interp, "java::isnull", "tcl.lang.JavaIsNullCmd");
058:                loadOnDemand(interp, "java::load", "tcl.lang.JavaLoadCmd");
059:                loadOnDemand(interp, "java::new", "tcl.lang.JavaNewCmd");
060:                loadOnDemand(interp, "java::null", "tcl.lang.JavaNullCmd");
061:                loadOnDemand(interp, "java::prop", "tcl.lang.JavaPropCmd");
062:                loadOnDemand(interp, "java::throw", "tcl.lang.JavaThrowCmd");
063:                loadOnDemand(interp, "java::try", "tcl.lang.JavaTryCmd");
064:
065:                // Set up namespace exporting of these java commands.
066:                // FIXME : double check that this works with one demand loaded clases.
067:
068:                interp
069:                        .eval("namespace eval ::java {namespace export bind call cast defineclass event field getinterp import info instanceof isnull load new null prop throw try}");
070:
071:                // load unsupported command(s)
072:                loadOnDemand(interp, "unsupported::jdetachcall",
073:                        "tcl.lang.UnsupportedJDetachCallCmd");
074:
075:                // Part of the java package is defined in Tcl code.  We source
076:                // in that code now.
077:
078:                interp.evalResource("/tcl/lang/library/java/javalock.tcl");
079:
080:                // Set up the tcljava array which will store info about
081:                // The system that scripts may want to access to.
082:
083:                // Set tcljava(tcljava) to jacl or tclblend
084:
085:                TclObject plat = interp.getVar("tcl_platform", "platform",
086:                        TCL.GLOBAL_ONLY);
087:
088:                if (plat.toString().equals("java")) {
089:                    interp.setVar("tcljava", "tcljava", TclString
090:                            .newInstance("jacl"), TCL.GLOBAL_ONLY);
091:                } else {
092:                    interp.setVar("tcljava", "tcljava", TclString
093:                            .newInstance("tclblend"), TCL.GLOBAL_ONLY);
094:                }
095:
096:                // set tcljava(java.version) to the JVM version number
097:
098:                interp.setVar("tcljava", "java.version", TclString
099:                        .newInstance(System.getProperty("java.version")),
100:                        TCL.GLOBAL_ONLY);
101:
102:                // set tcljava(java.home) to the root of the JVM install
103:
104:                interp.setVar("tcljava", "java.home", TclString
105:                        .newInstance(System.getProperty("java.home")),
106:                        TCL.GLOBAL_ONLY);
107:
108:                // set tcljava(java.vendor) to the info from the JVM provider
109:
110:                interp.setVar("tcljava", "java.vendor", TclString
111:                        .newInstance(System.getProperty("java.vendor")),
112:                        TCL.GLOBAL_ONLY);
113:
114:                // set tcljava(java.vendor.url) to the info from the JVM provider
115:
116:                interp.setVar("tcljava", "java.vendor.url", TclString
117:                        .newInstance(System.getProperty("java.vendor.url")),
118:                        TCL.GLOBAL_ONLY);
119:
120:                // set tcljava(java.vendor.url.bug) to the info from the JVM provider
121:
122:                interp.setVar("tcljava", "java.vendor.url.bug",
123:                        TclString.newInstance(System
124:                                .getProperty("java.vendor.url.bug")),
125:                        TCL.GLOBAL_ONLY);
126:
127:                // Provide the Tcl/Java package with the version info.
128:                // The version is also set in:
129:                // src/jacl/tcl/lang/Interp.java
130:                // src/pkgIndex.tcl
131:                // win/makefile.vc
132:                // unix/configure.in
133:
134:                interp.eval("package provide java 1.4.1");
135:
136:            }
137:
138:        } // end BlendExtension
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.