Source Code Cross Referenced for AbstractEnhancer.java in  » Database-ORM » Speedo_1.4.5 » org » objectweb » speedo » generation » 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 » Database ORM » Speedo_1.4.5 » org.objectweb.speedo.generation 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * Copyright (C) 2001-2005 France Telecom R&D
003:         */package org.objectweb.speedo.generation;
004:
005:        import org.objectweb.speedo.ant.AntSpeedoScriptGenerator;
006:        import org.objectweb.speedo.api.SpeedoException;
007:        import org.objectweb.speedo.api.SpeedoProperties;
008:        import org.objectweb.speedo.generation.api.GeneratorComponent;
009:        import org.objectweb.speedo.generation.api.SpeedoCompilerParameter;
010:        import org.objectweb.speedo.generation.lib.AbstractGeneratorComponent;
011:        import org.objectweb.speedo.lib.Personality;
012:        import org.objectweb.speedo.metadata.SpeedoDefaults;
013:        import org.objectweb.util.monolog.Monolog;
014:        import org.objectweb.util.monolog.api.BasicLevel;
015:
016:        import java.util.HashMap;
017:
018:        /**
019:         * Is the global engine of the Speedo enhancer/Compiler. This engine launches
020:         * the different steps of the enhancement. Each step is realized by a 
021:         * GeneratorComponent implementation. This implementation is a GeneratorComponent
022:         * itself. The list of used generator component is defined by the abstract 
023:         * method #getGeneratorComponents()
024:         * 
025:         * @author S.Chassande-Barrioz
026:         */
027:        public abstract class AbstractEnhancer extends
028:                AbstractGeneratorComponent {
029:
030:            private final static String LOGGER_NAME = SpeedoProperties.LOGGER_NAME
031:                    + ".generation.SpeedoCompiler";
032:
033:            /**
034:             * @return the array of GeneratorComponent class to use. This array defines
035:             * the different step of the Speedo enhancer.
036:             * @see GeneratorComponent
037:             */
038:            protected abstract GeneratorComponent[] getGeneratorComponents();
039:
040:            public AbstractEnhancer(Personality p) {
041:                super (p);
042:            }
043:
044:            // IMPLEMENTATION OF THE GeneratorComponent INTERFACE //
045:            //----------------------------------------------------//
046:            public SpeedoCompilerParameter getSpeedoCompilerParameter() {
047:                if (scp == null) {
048:                    scp = new SpeedoCompilerParameter();
049:                    scp.personality = personality;
050:                }
051:                return scp;
052:            }
053:
054:            public boolean init() throws SpeedoException {
055:                // Initialize the logger factory if necessary
056:                if (scp.loggerFactory == null) {
057:                    if (scp.logPropFile == null) {
058:                        scp.loggerFactory = Monolog.initialize();
059:                    } else {
060:                        scp.loggerFactory = Monolog
061:                                .getMonologFactory(scp.logPropFile);
062:                    }
063:                    logger = scp.loggerFactory.getLogger(LOGGER_NAME);
064:                } else if (logger == null) {
065:                    logger = scp.loggerFactory.getLogger(LOGGER_NAME);
066:                }
067:                scp.nmf.setLogger(scp.loggerFactory
068:                        .getLogger(SpeedoProperties.LOGGER_NAME + ".naming"));
069:                scp.setXmldescriptor(new HashMap());
070:                SpeedoDefaults.init(scp.personality);
071:                return true;
072:            }
073:
074:            public void process() throws SpeedoException {
075:                if (scp.xml.isEmpty())
076:                    return;
077:                long time = System.currentTimeMillis();
078:                final GeneratorComponent[] gcs = getGeneratorComponents();
079:
080:                // Launch all steps of the speedo compiler
081:                boolean run = true;
082:                for (int i = 0; i < gcs.length && run; i++) {
083:                    long actionTime = System.currentTimeMillis();
084:                    gcs[i].setSpeedoCompilerParameter(scp);
085:                    if (gcs[i].init()) {
086:                        final String title = gcs[i].getTitle();
087:                        if (title != null) {
088:                            logger.log(BasicLevel.INFO, title);
089:                        }
090:                        gcs[i].process();
091:                        final String summary = gcs[i].getSummary();
092:                        if (summary != null) {
093:                            actionTime = System.currentTimeMillis()
094:                                    - actionTime;
095:                            logger.log(BasicLevel.DEBUG, "=>"
096:                                    + summary
097:                                    + ", "
098:                                    + AntSpeedoScriptGenerator
099:                                            .duration2str(actionTime));
100:                        }
101:                    } else {
102:                        run = false;
103:                    }
104:                }
105:                time = System.currentTimeMillis() - time;
106:                logger.log(BasicLevel.INFO, "All Done in "
107:                        + AntSpeedoScriptGenerator.duration2str(time));
108:            }
109:
110:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.