Source Code Cross Referenced for WebManThread.java in  » Content-Management-System » webman » com » teamkonzept » webman » mainint » 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 » Content Management System » webman » com.teamkonzept.webman.mainint 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package com.teamkonzept.webman.mainint;
002:
003:        import com.teamkonzept.webman.*;
004:        import com.teamkonzept.webman.db.*;
005:
006:        import com.teamkonzept.webman.mainint.db.*;
007:        import com.teamkonzept.webman.mainint.db.queries.*;
008:
009:        import com.teamkonzept.field.*;
010:        import com.teamkonzept.field.db.*;
011:        import com.teamkonzept.field.db.queries.*;
012:
013:        import com.teamkonzept.publishing.markups.*;
014:
015:        import com.teamkonzept.db.*;
016:        import com.teamkonzept.web.*;
017:        import com.teamkonzept.lib.*;
018:        import com.teamkonzept.webman.mainint.events.CachedEventDistributor;
019:        import com.teamkonzept.webman.mainint.events.ParameterTypes;
020:        import com.teamkonzept.webman.mainint.events.*;
021:
022:        import com.oroinc.text.regex.*;
023:
024:        import de.webman.util.log4j.WebmanCategory;
025:        import de.webman.acl.ACEventDistributor;
026:        import de.webman.generator.GREventDistributor;
027:        import de.webman.content.CEEventDistributor;
028:        import de.webman.template.TEEventDistributor;
029:        import de.webman.form.CTEventDistributor;
030:        import de.webman.sitetree.STEventDistributor;
031:        import de.webman.duplication.DUEventDistributor;
032:        import de.webman.documenttype.DTEventDistributor;
033:        import de.webman.config.COEventDistributor;
034:
035:        import java.io.*;
036:        import java.util.*;
037:        import java.sql.*;
038:
039:        /**
040:         * zentrale Eventverteilungsklasse
041:         * enthaelt auch einiges an Initialisierungsroutinen
042:         * @author  $Author: alex $
043:         * @version $Revision: 1.61 $
044:         */
045:        public class WebManThread extends CachedEventDistributor implements 
046:                FrameConstants, DatabaseDefaults, ParameterTypes {
047:            /**
048:             * Liste aller Feldklassen
049:             **/
050:            private static TKVector classVector = null;
051:
052:            static boolean initialized = false;
053:
054:            /** Singleton Instanz */
055:            private static WebManThread instance = new WebManThread();
056:
057:            /** Log4J Kategorie */
058:            private static WebmanCategory cat = (WebmanCategory) WebmanCategory
059:                    .getInstance(WebManThread.class.getName());
060:
061:            /**
062:             *  Zugriff auf Singleton
063:             * @return Singleton Instanz
064:             */
065:            public static WebManThread getInstance() {
066:                return instance;
067:            }
068:
069:            public static TKVector getClassVector() {
070:                try {
071:                    if (classVector == null)
072:                        classVector = registerAllFields();
073:                } catch (Throwable t) {
074:                    cat.fatal("registerFields", t);
075:                }
076:                return classVector;
077:            }
078:
079:            private WebManThread() {
080:                /*try
081:                {
082:                	TKWebmanDBManager.initConnection("/webmandb.ini", !initialized);
083:                }
084:                catch (TKException e)
085:                {
086:                	cat.error("Exception during pre init : " , e);
087:                }             */
088:                // EventHandler registrieren
089:                addEventHandler(StartEventHandler.getInstance());
090:                addEventHandler(EmptyEventHandler.getInstance());
091:                addEventHandler(new CEEventDistributor());
092:                addEventHandler(new COEventDistributor());
093:                addEventHandler(new CTEventDistributor());
094:                addEventHandler(new MEEventHandler());
095:                addEventHandler(new DTEventDistributor());
096:                addEventHandler(new TEEventDistributor());
097:                addEventHandler(new STEventDistributor());
098:                addEventHandler(new ACEventDistributor());
099:                addEventHandler(new GREventDistributor());
100:                addEventHandler(new DUEventDistributor());
101:                addEventHandler(new FrameOrientationHandler());
102:                addEventHandler(WebmanExceptionHandler.getInstance());
103:            }
104:
105:            /**
106:            	returns true, because it is the top level handler
107:             */
108:            public boolean isHandler(TKEvent evt) {
109:                return true;
110:            }
111:
112:            /**
113:             * Creates an event object.
114:             *
115:             * @param http the responsible HTTP interface.
116:             * @return an event object.
117:             */
118:            public TKEvent createEvent(TKHttpInterface http) {
119:                return new TKUserEvent(http);
120:            }
121:
122:            /**
123:            	villeicht noch irgendwo hin verschieben, gehört das nicht eher ins field Package ???
124:             */
125:            public static TKVector registerAllFields() throws TKException {
126:                try {
127:                    //---- Die Tabelle FIELD_CLASS ausleisen und in einem Vector speichern ----//
128:                    TKQuery q = TKWebmanDBManager
129:                            .newQuery(TKDBFormFieldClassGet.class);
130:                    q.execute();
131:                    ResultSet rs = q.fetchResultSet();
132:
133:                    //---- FIELD_TYPE = CLASS_ID  FIELD_CLASS = PATH ----//
134:                    classVector = new TKVector();
135:                    while (rs.next()) {
136:                        String rowArray[] = { rs.getString("FIELD_TYPE"),
137:                                rs.getString("FIELD_CLASS") };
138:                        classVector.addElement(rowArray);
139:                    }
140:
141:                    //---- Alle Fields registrieren ----//
142:                    for (int i = 0; i < classVector.size(); i++) {
143:                        Object element = classVector.elementAt(i);
144:                        String classInfoArray[] = (String[]) element;
145:                        TKFieldRegistry.registry.registerClass(
146:                                classInfoArray[0], classInfoArray[1]);
147:                    }
148:                } catch (SQLException e) {
149:                    throw WebmanExceptionHandler.getException(e);
150:                }
151:                return classVector;
152:            }
153:
154:            public void traceHttpEnv(TKEvent evt) {
155:                cat.info("getOwnName() = "
156:                        + evt.getHttpInterface().getOwnName());
157:                cat.info("getOwnURL() = " + evt.getHttpInterface().getOwnURL());
158:                cat.info("getOwnPath() = "
159:                        + evt.getHttpInterface().getOwnPath());
160:                cat.info("getDocumentRoot() = "
161:                        + evt.getHttpInterface().getDocumentRoot());
162:                cat.info("getServerName() = "
163:                        + evt.getHttpInterface().getServerName());
164:                cat.info("getRemoteUser() = "
165:                        + evt.getHttpInterface().getRemoteUser());
166:            }
167:
168:            public static synchronized void init(TKEvent evt)
169:                    throws TKException {
170:                if (initialized)
171:                    return;
172:                //TKWebmanInit.init(evt.getHttpInterface().getDocumentRoot());
173:                TKUploadField.initStaticsForUpload(evt.getHttpInterface()
174:                        .getDocumentRoot());
175:
176:                /*
177:                de.webman.generator.GeneratorContext.setupSharing (evt.getHttpInterface().getDocumentRoot()+File.separator+"servlets"+File.separator+
178:                					"preview.ini");      auf Properties umgestellt */
179:                if (classVector == null)
180:                    classVector = registerAllFields();
181:                TKMarkupAdmin.setup();
182:                initialized = true;
183:            }
184:
185:            public void handleEvent(TKEvent evt) throws TKException {
186:                try {
187:                    cat.access("Event : " + evt.getName());
188:                    TKWebmanDBManager.initConnection("/webmandb.ini",
189:                            !initialized);
190:                    TKPrepQuery.enableCleanup();
191:                    if (!initialized)
192:                        init(evt);
193:                    // ist der request vollstaendig da ?
194:                    evt.checkChecker();
195:                    super .handleEvent(evt);
196:                } catch (Throwable t) {
197:                    boolean close = false;
198:                    // CHANGE !!
199:
200:                    if (t instanceof  TKException)
201:                        close = WebmanExceptionHandler.handleException(
202:                                (TKException) t, evt);
203:                    else
204:                        close = WebmanExceptionHandler.handleException(
205:                                WebmanExceptionHandler.getException(t), evt);
206:                    // t.printStackTrace(System.err);
207:                    deRegister(close);
208:                    initialized = false;
209:                    // deregistrieren nur bei SQL Exception !!!
210:
211:                }
212:                deRegister(false);
213:            }
214:
215:            void deRegister(boolean close) throws TKDatabaseException {
216:                try {
217:                    TKWebmanDBManager.deregister(close);
218:                } catch (SQLException e) {
219:                    throw new TKDatabaseException(e.toString(), UNDEFINED,
220:                            NORMAL_SEVERITY, false, e);
221:                }
222:            }
223:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.