Source Code Cross Referenced for WorkerEnv.java in  » Sevlet-Container » apache-tomcat-6.0.14 » org » apache » jk » core » 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 » Sevlet Container » apache tomcat 6.0.14 » org.apache.jk.core 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *  Licensed to the Apache Software Foundation (ASF) under one or more
003:         *  contributor license agreements.  See the NOTICE file distributed with
004:         *  this work for additional information regarding copyright ownership.
005:         *  The ASF licenses this file to You under the Apache License, Version 2.0
006:         *  (the "License"); you may not use this file except in compliance with
007:         *  the License.  You may obtain a copy of the License at
008:         *
009:         *      http://www.apache.org/licenses/LICENSE-2.0
010:         *
011:         *  Unless required by applicable law or agreed to in writing, software
012:         *  distributed under the License is distributed on an "AS IS" BASIS,
013:         *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         *  See the License for the specific language governing permissions and
015:         *  limitations under the License.
016:         */
017:
018:        package org.apache.jk.core;
019:
020:        import java.util.Hashtable;
021:        import javax.management.ObjectName;
022:
023:        /**
024:         * The controller object. It manages all other jk objects, acting as the root of
025:         * the jk object model.
026:         *
027:         * @author Gal Shachor
028:         * @author Henri Gomez [hgomez@apache.org]
029:         * @author Dan Milstein [danmil@shore.net]
030:         * @author Keith Wannamaker [Keith@Wannamaker.org]
031:         * @author Kevin Seguin
032:         * @author Costin Manolache
033:         */
034:        public class WorkerEnv {
035:
036:            Hashtable properties;
037:
038:            public static final int ENDPOINT_NOTE = 0;
039:            public static final int REQUEST_NOTE = 1;
040:            public static final int SSL_CERT_NOTE = 16;
041:            int noteId[] = new int[4];
042:            String noteName[][] = new String[4][];
043:            private Object notes[] = new Object[32];
044:
045:            Hashtable handlersMap = new Hashtable();
046:            JkHandler handlersTable[] = new JkHandler[20];
047:            int handlerCount = 0;
048:
049:            // base dir for the jk webapp
050:            String home;
051:            int localId = 0;
052:
053:            public WorkerEnv() {
054:                for (int i = 0; i < noteId.length; i++) {
055:                    noteId[i] = 7;
056:                    noteName[i] = new String[20];
057:                }
058:            }
059:
060:            public void setLocalId(int id) {
061:                localId = id;
062:            }
063:
064:            public int getLocalId() {
065:                return localId;
066:            }
067:
068:            public void setJkHome(String s) {
069:                home = s;
070:            }
071:
072:            public String getJkHome() {
073:                return home;
074:            }
075:
076:            public final Object getNote(int i) {
077:                return notes[i];
078:            }
079:
080:            public final void setNote(int i, Object o) {
081:                notes[i] = o;
082:            }
083:
084:            public int getNoteId(int type, String name) {
085:                for (int i = 0; i < noteId[type]; i++) {
086:                    if (name.equals(noteName[type][i]))
087:                        return i;
088:                }
089:                int id = noteId[type]++;
090:                noteName[type][id] = name;
091:                return id;
092:            }
093:
094:            public void addHandler(String name, JkHandler w) {
095:                JkHandler oldH = getHandler(name);
096:                if (oldH == w) {
097:                    // Already added
098:                    return;
099:                }
100:                w.setWorkerEnv(this );
101:                w.setName(name);
102:                handlersMap.put(name, w);
103:                if (handlerCount > handlersTable.length) {
104:                    JkHandler newT[] = new JkHandler[2 * handlersTable.length];
105:                    System.arraycopy(handlersTable, 0, newT, 0,
106:                            handlersTable.length);
107:                    handlersTable = newT;
108:                }
109:                if (oldH == null) {
110:                    handlersTable[handlerCount] = w;
111:                    w.setId(handlerCount);
112:                    handlerCount++;
113:                } else {
114:                    handlersTable[oldH.getId()] = w;
115:                    w.setId(oldH.getId());
116:                }
117:
118:                // Notify all other handlers of the new one
119:                // XXX Could be a Coyote action ?
120:                for (int i = 0; i < handlerCount; i++) {
121:                    handlersTable[i].addHandlerCallback(w);
122:                }
123:            }
124:
125:            public final JkHandler getHandler(String name) {
126:                return (JkHandler) handlersMap.get(name);
127:            }
128:
129:            public final JkHandler getHandler(int id) {
130:                return handlersTable[id];
131:            }
132:
133:            public final int getHandlerCount() {
134:                return handlerCount;
135:            }
136:
137:            public ObjectName[] getHandlersObjectName() {
138:
139:                ObjectName onames[] = new ObjectName[handlerCount];
140:                for (int i = 0; i < handlerCount; i++) {
141:                    onames[i] = handlersTable[i].getObjectName();
142:                }
143:                return onames;
144:            }
145:
146:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.