Source Code Cross Referenced for XLogger.java in  » XML » activexml » org » xdev » base » xssl » 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 » XML » activexml » org.xdev.base.xssl 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Created on Jan 8, 2004
003:         *
004:         * To change the template for this generated file go to
005:         * Window>Preferences>Java>Code Generation>Code and Comments
006:         */
007:        package org.xdev.base.xssl;
008:
009:        import java.util.HashMap;
010:
011:        import java.io.IOException;
012:        import java.io.ObjectOutput;
013:
014:        import org.apache.log4j.*;
015:
016:        import org.xdev.base.core.BASE;
017:
018:        /**
019:         * @author AYegorov
020:         *
021:         * To change the template for this generated type comment go to
022:         * Window>Preferences>Java>Code Generation>Code and Comments
023:         */
024:
025:        public class XLogger extends XSSLObject implements  ObjectOutput {
026:            public static final String LEVEL = "level";
027:            public static final String LOGGER_ID = "logger";
028:            public static final String RETURN_OBJECT = "return";
029:            public static final String MESSAGE = "message";
030:
031:            /**
032:             * @param id
033:             */
034:            public XLogger(String id) {
035:                super (id);
036:                // XXX Auto-generated constructor stub
037:            }
038:
039:            /**
040:             * @param id
041:             * @param properties
042:             */
043:            public XLogger(String id, HashMap properties) {
044:                super (id, properties);
045:                // XXX Auto-generated constructor stub
046:            }
047:
048:            /* (non-Javadoc)
049:             * @see org.xdev.base.xssl.XSSLObject#processObject(java.lang.Object)
050:             */
051:            protected Object processObject(Object obj) throws Exception {
052:                if (obj == null && this .getCount() > 0) {
053:                    XSSLReturn r = (XSSLReturn) this .getElement(0);
054:
055:                    if (r.execute()) {
056:                        obj = r.getObjectValue();
057:                    }
058:
059:                    this .logDebug("Logger has received value: " + obj);
060:
061:                    r = null;
062:                }
063:
064:                obj = (obj == null ? "" : obj);
065:
066:                String loggerId = this .getProperty(XLogger.LOGGER_ID);
067:                Object value = this .getProperty(XLogger.MESSAGE) + " "
068:                        + BASE.getValueFromObject(obj);
069:                Level level = (Level) this .getPropertyAsObject(XLogger.LEVEL);
070:
071:                level = level == null ? XLogger.DEBUG : level;
072:
073:                if ("".equals(loggerId)) {
074:                    this .logCustom(value, level);
075:                } else {
076:                    this .logCustom(loggerId, value, level);
077:                }
078:
079:                this .logDebug("Logger has logged message: [ " + value + " ]");
080:
081:                return this .getBooleanProperty(XLogger.RETURN_OBJECT) ? obj
082:                        : "";
083:            }
084:
085:            /* (non-Javadoc)
086:             * @see java.io.ObjectOutput#flush()
087:             */
088:            public void flush() throws IOException {
089:            }
090:
091:            /* (non-Javadoc)
092:             * @see java.io.ObjectOutput#write(int)
093:             */
094:            public void write(int b) throws IOException {
095:                this .writeObject(new Byte((byte) b));
096:            }
097:
098:            /* (non-Javadoc)
099:             * @see java.io.ObjectOutput#write(byte[])
100:             */
101:            public void write(byte[] b) throws IOException {
102:                this .writeObject(b);
103:            }
104:
105:            /* (non-Javadoc)
106:             * @see java.io.ObjectOutput#write(byte[], int, int)
107:             */
108:            public void write(byte[] b, int off, int len) throws IOException {
109:                for (int i = off; i < len; i++) {
110:                    this .write(b[i]);
111:                }
112:            }
113:
114:            /* (non-Javadoc)
115:             * @see java.io.ObjectOutput#writeObject(java.lang.Object)
116:             */
117:            public void writeObject(Object obj) throws IOException {
118:
119:                try {
120:
121:                    this .processObject(obj);
122:                } catch (Exception ex) {
123:                    throw new IOException(BASE.getValueFromObject(ex));
124:                }
125:            }
126:
127:            /* (non-Javadoc)
128:             * @see java.io.DataOutput#writeDouble(double)
129:             */
130:            public void writeDouble(double v) throws IOException {
131:                this .writeObject(new Double(v));
132:            }
133:
134:            /* (non-Javadoc)
135:             * @see java.io.DataOutput#writeFloat(float)
136:             */
137:            public void writeFloat(float v) throws IOException {
138:                this .writeObject(new Float(v));
139:            }
140:
141:            /* (non-Javadoc)
142:             * @see java.io.DataOutput#writeByte(int)
143:             */
144:            public void writeByte(int v) throws IOException {
145:                this .write(v);
146:            }
147:
148:            /* (non-Javadoc)
149:             * @see java.io.DataOutput#writeChar(int)
150:             */
151:            public void writeChar(int v) throws IOException {
152:                this .writeObject(String.valueOf(v));
153:            }
154:
155:            /* (non-Javadoc)
156:             * @see java.io.DataOutput#writeInt(int)
157:             */
158:            public void writeInt(int v) throws IOException {
159:                this .writeObject(new Integer(v));
160:            }
161:
162:            /* (non-Javadoc)
163:             * @see java.io.DataOutput#writeShort(int)
164:             */
165:            public void writeShort(int v) throws IOException {
166:                this .writeObject(new Short((short) v));
167:            }
168:
169:            /* (non-Javadoc)
170:             * @see java.io.DataOutput#writeLong(long)
171:             */
172:            public void writeLong(long v) throws IOException {
173:                this .writeObject(new Long(v));
174:            }
175:
176:            /* (non-Javadoc)
177:             * @see java.io.DataOutput#writeBoolean(boolean)
178:             */
179:            public void writeBoolean(boolean v) throws IOException {
180:                this .writeObject(new Boolean(v));
181:            }
182:
183:            /* (non-Javadoc)
184:             * @see java.io.DataOutput#writeBytes(java.lang.String)
185:             */
186:            public void writeBytes(String s) throws IOException {
187:                this .writeObject(s);
188:            }
189:
190:            /* (non-Javadoc)
191:             * @see java.io.DataOutput#writeChars(java.lang.String)
192:             */
193:            public void writeChars(String s) throws IOException {
194:                this .writeBytes(s);
195:            }
196:
197:            /* (non-Javadoc)
198:             * @see java.io.DataOutput#writeUTF(java.lang.String)
199:             */
200:            public void writeUTF(String str) throws IOException {
201:                this .writeBytes(str);
202:            }
203:
204:            public void close() throws IOException {
205:
206:                try {
207:
208:                    super .close();
209:                } catch (Exception ex) {
210:                    throw new IOException(BASE.getValueFromObject(ex));
211:                }
212:            }
213:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.