Source Code Cross Referenced for ResinELContext.java in  » EJB-Server-resin-3.1.5 » resin » com » caucho » server » resin » 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 » EJB Server resin 3.1.5 » resin » com.caucho.server.resin 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (c) 1998-2008 Caucho Technology -- all rights reserved
003:         *
004:         * This file is part of Resin(R) Open Source
005:         *
006:         * Each copy or derived work must preserve the copyright notice and this
007:         * notice unmodified.
008:         *
009:         * Resin Open Source is free software; you can redistribute it and/or modify
010:         * it under the terms of the GNU General Public License as published by
011:         * the Free Software Foundation; either version 2 of the License, or
012:         * (at your option) any later version.
013:         *
014:         * Resin Open Source is distributed in the hope that it will be useful,
015:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
016:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
017:         * of NON-INFRINGEMENT.  See the GNU General Public License for more
018:         * details.
019:         *
020:         * You should have received a copy of the GNU General Public License
021:         * along with Resin Open Source; if not, write to the
022:         *
023:         *   Free Software Foundation, Inc.
024:         *   59 Temple Place, Suite 330
025:         *   Boston, MA 02111-1307  USA
026:         *
027:         * @author Sam
028:         */
029:
030:        package com.caucho.server.resin;
031:
032:        import com.caucho.config.ConfigELContext;
033:        import com.caucho.config.ConfigException;
034:        import com.caucho.naming.Jndi;
035:        import com.caucho.server.util.CauchoSystem;
036:        import com.caucho.util.Alarm;
037:        import com.caucho.vfs.Path;
038:
039:        import java.net.InetAddress;
040:        import java.util.logging.Level;
041:        import java.util.logging.Logger;
042:
043:        abstract public class ResinELContext {
044:            private final JavaVar _javaVar = new JavaVar();
045:            private final ResinVar _resinVar = new ResinVar();
046:            private final ServerVar _serverVar = new ServerVar();
047:
048:            public ResinELContext() {
049:            }
050:
051:            public JavaVar getJavaVar() {
052:                return _javaVar;
053:            }
054:
055:            public ResinVar getResinVar() {
056:                return _resinVar;
057:            }
058:
059:            public ServerVar getServerVar() {
060:                return _serverVar;
061:            }
062:
063:            public String toString() {
064:                return getClass().getSimpleName() + "[]";
065:            }
066:
067:            abstract public Path getResinHome();
068:
069:            abstract public Path getRootDirectory();
070:
071:            abstract public Path getResinConf();
072:
073:            abstract public String getServerId();
074:
075:            abstract public boolean isResinProfessional();
076:
077:            /**
078:             * Java variables
079:             */
080:            public class JavaVar {
081:                /**
082:                 * Returns true for JDK 5
083:                 */
084:                public boolean isJava5() {
085:                    return CauchoSystem.isJdk15();
086:                }
087:
088:                /**
089:                 * Returns the JDK version
090:                 */
091:                public String getVersion() {
092:                    return System.getProperty("java.version");
093:                }
094:            }
095:
096:            public class ResinVar {
097:                /**
098:                 * Returns the -server id
099:                 */
100:                public String getServerId() {
101:                    return ResinELContext.this .getServerId();
102:                }
103:
104:                /**
105:                 * @deprecated use {@link #getServerId()}
106:                 */
107:                public String getId() {
108:                    return getServerId();
109:                }
110:
111:                /**
112:                 * Returns the local address
113:                 *
114:                 * @return IP address
115:                 */
116:                public String getAddress() {
117:                    try {
118:                        if (Alarm.isTest())
119:                            return "127.0.0.1";
120:                        else
121:                            return InetAddress.getLocalHost().getHostAddress();
122:                    } catch (Exception e) {
123:                        Logger.getLogger(ResinELContext.class.getName()).log(
124:                                Level.FINE, e.toString(), e);
125:
126:                        return "localhost";
127:                    }
128:                }
129:
130:                /**
131:                 * Returns the resin config.
132:                 */
133:                public Path getConf() {
134:                    return ResinELContext.this .getResinConf();
135:                }
136:
137:                /**
138:                 * Returns the resin home.
139:                 */
140:                public Path getHome() {
141:                    return ResinELContext.this .getResinHome();
142:                }
143:
144:                /**
145:                 * Returns the root directory.
146:                 *
147:                 * @return the root directory
148:                 */
149:                public Path getRoot() {
150:                    return ResinELContext.this .getRootDirectory();
151:                }
152:
153:                /**
154:                 * @deprecated use {@link #getRoot()}
155:                 */
156:                public Path getRootDir() {
157:                    return getRoot();
158:                }
159:
160:                /**
161:                 * @deprecated use {@link #getRoot()}
162:                 */
163:                public Path getRootDirectory() {
164:                    return getRoot();
165:                }
166:
167:                /**
168:                 * Returns the version
169:                 *
170:                 * @return version
171:                 */
172:                public String getVersion() {
173:                    if (Alarm.isTest())
174:                        return "3.1.test";
175:                    else
176:                        return com.caucho.Version.VERSION;
177:                }
178:
179:                /**
180:                 * Returns the local hostname
181:                 *
182:                 * @return version
183:                 */
184:                public String getHostName() {
185:                    try {
186:                        if (Alarm.isTest())
187:                            return "localhost";
188:                        else
189:                            return InetAddress.getLocalHost().getHostName();
190:                    } catch (Exception e) {
191:                        Logger.getLogger(ResinELContext.class.getName()).log(
192:                                Level.FINE, e.toString(), e);
193:
194:                        return "localhost";
195:                    }
196:                }
197:
198:                /**
199:                 * Returns true for Resin professional.
200:                 */
201:                public boolean isProfessional() {
202:                    return ResinELContext.this .isResinProfessional();
203:                }
204:            }
205:
206:            public class ServerVar {
207:                public String getId() {
208:                    return ResinELContext.this .getServerId();
209:                }
210:
211:                /**
212:                 * Returns the root directory.
213:                 *
214:                 * @return the root directory
215:                 */
216:                public Path getRoot() {
217:                    return ResinELContext.this .getRootDirectory();
218:                }
219:
220:                /**
221:                 * @deprecated use {@link #getRoot()}
222:                 */
223:                public Path getRootDir() {
224:                    return getRoot();
225:                }
226:
227:                /**
228:                 * @deprecated use {@link #getRoot()}
229:                 */
230:                public Path getRootDirectory() {
231:                    return getRoot();
232:                }
233:            }
234:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.