Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Initial commit - RM code

  • Loading branch information...
commit 60bd00f3f0b338a7703867a03331cf7b16fc39ee 0 parents
@theterg theterg authored
Showing with 27,027 additions and 0 deletions.
  1. +8 −0 XBeeAPITest/.classpath
  2. +29 −0 XBeeAPITest/.project
  3. +7 −0 XBeeAPITest/.settings/org.eclipse.jdt.core.prefs
  4. +23 −0 XBeeAPITest/META-INF/MANIFEST.MF
  5. BIN  XBeeAPITest/xbeeapitest/Activator.class
  6. +50 −0 XBeeAPITest/xbeeapitest/Activator.java
  7. BIN  XBeeAPITest/xbeeapitest/XBeeAPITestApplication$PacketParser.class
  8. BIN  XBeeAPITest/xbeeapitest/XBeeAPITestApplication.class
  9. +120 −0 XBeeAPITest/xbeeapitest/XBeeAPITestApplication.java
  10. +8 −0 log4jlib_osgi/.classpath
  11. +29 −0 log4jlib_osgi/.project
  12. +7 −0 log4jlib_osgi/.settings/org.eclipse.jdt.core.prefs
  13. +10 −0 log4jlib_osgi/META-INF/MANIFEST.MF
  14. BIN  log4jlib_osgi/org/apache/log4j/Appender.class
  15. +142 −0 log4jlib_osgi/org/apache/log4j/Appender.java
  16. BIN  log4jlib_osgi/org/apache/log4j/AppenderSkeleton.class
  17. +304 −0 log4jlib_osgi/org/apache/log4j/AppenderSkeleton.java
  18. BIN  log4jlib_osgi/org/apache/log4j/AsyncAppender$DiscardSummary.class
  19. BIN  log4jlib_osgi/org/apache/log4j/AsyncAppender$Dispatcher.class
  20. BIN  log4jlib_osgi/org/apache/log4j/AsyncAppender.class
  21. +596 −0 log4jlib_osgi/org/apache/log4j/AsyncAppender.java
  22. BIN  log4jlib_osgi/org/apache/log4j/BasicConfigurator.class
  23. +73 −0 log4jlib_osgi/org/apache/log4j/BasicConfigurator.java
  24. BIN  log4jlib_osgi/org/apache/log4j/Category.class
  25. +1,062 −0 log4jlib_osgi/org/apache/log4j/Category.java
  26. BIN  log4jlib_osgi/org/apache/log4j/CategoryKey.class
  27. +52 −0 log4jlib_osgi/org/apache/log4j/CategoryKey.java
  28. BIN  log4jlib_osgi/org/apache/log4j/ConsoleAppender$SystemErrStream.class
  29. BIN  log4jlib_osgi/org/apache/log4j/ConsoleAppender$SystemOutStream.class
  30. BIN  log4jlib_osgi/org/apache/log4j/ConsoleAppender.class
  31. +220 −0 log4jlib_osgi/org/apache/log4j/ConsoleAppender.java
  32. BIN  log4jlib_osgi/org/apache/log4j/DailyRollingFileAppender.class
  33. +454 −0 log4jlib_osgi/org/apache/log4j/DailyRollingFileAppender.java
  34. BIN  log4jlib_osgi/org/apache/log4j/DefaultCategoryFactory.class
  35. +31 −0 log4jlib_osgi/org/apache/log4j/DefaultCategoryFactory.java
  36. BIN  log4jlib_osgi/org/apache/log4j/DefaultThrowableRenderer.class
  37. +83 −0 log4jlib_osgi/org/apache/log4j/DefaultThrowableRenderer.java
  38. BIN  log4jlib_osgi/org/apache/log4j/Dispatcher.class
  39. +125 −0 log4jlib_osgi/org/apache/log4j/Dispatcher.java
  40. BIN  log4jlib_osgi/org/apache/log4j/EnhancedPatternLayout.class
  41. +559 −0 log4jlib_osgi/org/apache/log4j/EnhancedPatternLayout.java
  42. BIN  log4jlib_osgi/org/apache/log4j/EnhancedThrowableRenderer.class
  43. +168 −0 log4jlib_osgi/org/apache/log4j/EnhancedThrowableRenderer.java
  44. BIN  log4jlib_osgi/org/apache/log4j/FileAppender.class
  45. +348 −0 log4jlib_osgi/org/apache/log4j/FileAppender.java
  46. BIN  log4jlib_osgi/org/apache/log4j/HTMLLayout.class
  47. +267 −0 log4jlib_osgi/org/apache/log4j/HTMLLayout.java
  48. BIN  log4jlib_osgi/org/apache/log4j/Hierarchy.class
  49. +577 −0 log4jlib_osgi/org/apache/log4j/Hierarchy.java
  50. BIN  log4jlib_osgi/org/apache/log4j/Layout.class
  51. +89 −0 log4jlib_osgi/org/apache/log4j/Layout.java
  52. BIN  log4jlib_osgi/org/apache/log4j/Level.class
  53. +224 −0 log4jlib_osgi/org/apache/log4j/Level.java
  54. BIN  log4jlib_osgi/org/apache/log4j/LogMF.class
  55. +1,677 −0 log4jlib_osgi/org/apache/log4j/LogMF.java
  56. BIN  log4jlib_osgi/org/apache/log4j/LogManager.class
  57. +276 −0 log4jlib_osgi/org/apache/log4j/LogManager.java
  58. BIN  log4jlib_osgi/org/apache/log4j/LogSF.class
  59. +1,541 −0 log4jlib_osgi/org/apache/log4j/LogSF.java
  60. BIN  log4jlib_osgi/org/apache/log4j/LogXF.class
  61. +371 −0 log4jlib_osgi/org/apache/log4j/LogXF.java
  62. BIN  log4jlib_osgi/org/apache/log4j/Logger.class
  63. +212 −0 log4jlib_osgi/org/apache/log4j/Logger.java
  64. BIN  log4jlib_osgi/org/apache/log4j/MDC.class
  65. +187 −0 log4jlib_osgi/org/apache/log4j/MDC.java
  66. BIN  log4jlib_osgi/org/apache/log4j/NDC$DiagnosticContext.class
  67. BIN  log4jlib_osgi/org/apache/log4j/NDC.class
  68. +436 −0 log4jlib_osgi/org/apache/log4j/NDC.java
  69. BIN  log4jlib_osgi/org/apache/log4j/NameValue.class
  70. BIN  log4jlib_osgi/org/apache/log4j/PatternLayout.class
  71. +511 −0 log4jlib_osgi/org/apache/log4j/PatternLayout.java
  72. BIN  log4jlib_osgi/org/apache/log4j/Priority.class
  73. +193 −0 log4jlib_osgi/org/apache/log4j/Priority.java
  74. BIN  log4jlib_osgi/org/apache/log4j/PropertyConfigurator.class
  75. +963 −0 log4jlib_osgi/org/apache/log4j/PropertyConfigurator.java
  76. BIN  log4jlib_osgi/org/apache/log4j/PropertyWatchdog.class
  77. BIN  log4jlib_osgi/org/apache/log4j/ProvisionNode.class
  78. +29 −0 log4jlib_osgi/org/apache/log4j/ProvisionNode.java
  79. BIN  log4jlib_osgi/org/apache/log4j/RollingCalendar.class
  80. BIN  log4jlib_osgi/org/apache/log4j/RollingFileAppender.class
  81. +284 −0 log4jlib_osgi/org/apache/log4j/RollingFileAppender.java
  82. BIN  log4jlib_osgi/org/apache/log4j/SimpleLayout.class
  83. +78 −0 log4jlib_osgi/org/apache/log4j/SimpleLayout.java
  84. BIN  log4jlib_osgi/org/apache/log4j/SortedKeyEnumeration.class
  85. BIN  log4jlib_osgi/org/apache/log4j/TTCCLayout.class
  86. +217 −0 log4jlib_osgi/org/apache/log4j/TTCCLayout.java
  87. BIN  log4jlib_osgi/org/apache/log4j/WriterAppender.class
  88. +387 −0 log4jlib_osgi/org/apache/log4j/WriterAppender.java
  89. BIN  log4jlib_osgi/org/apache/log4j/chainsaw/ControlPanel$1.class
  90. BIN  log4jlib_osgi/org/apache/log4j/chainsaw/ControlPanel$2.class
  91. BIN  log4jlib_osgi/org/apache/log4j/chainsaw/ControlPanel$3.class
  92. BIN  log4jlib_osgi/org/apache/log4j/chainsaw/ControlPanel$4.class
  93. BIN  log4jlib_osgi/org/apache/log4j/chainsaw/ControlPanel$5.class
  94. BIN  log4jlib_osgi/org/apache/log4j/chainsaw/ControlPanel$6.class
  95. BIN  log4jlib_osgi/org/apache/log4j/chainsaw/ControlPanel$7.class
  96. BIN  log4jlib_osgi/org/apache/log4j/chainsaw/ControlPanel.class
  97. +222 −0 log4jlib_osgi/org/apache/log4j/chainsaw/ControlPanel.java
  98. BIN  log4jlib_osgi/org/apache/log4j/chainsaw/DetailPanel.class
  99. +170 −0 log4jlib_osgi/org/apache/log4j/chainsaw/DetailPanel.java
  100. BIN  log4jlib_osgi/org/apache/log4j/chainsaw/EventDetails.class
  101. +135 −0 log4jlib_osgi/org/apache/log4j/chainsaw/EventDetails.java
  102. BIN  log4jlib_osgi/org/apache/log4j/chainsaw/ExitAction.class
  103. +48 −0 log4jlib_osgi/org/apache/log4j/chainsaw/ExitAction.java
  104. BIN  log4jlib_osgi/org/apache/log4j/chainsaw/LoadXMLAction.class
  105. +139 −0 log4jlib_osgi/org/apache/log4j/chainsaw/LoadXMLAction.java
  106. BIN  log4jlib_osgi/org/apache/log4j/chainsaw/LoggingReceiver$Slurper.class
  107. BIN  log4jlib_osgi/org/apache/log4j/chainsaw/LoggingReceiver.class
  108. +121 −0 log4jlib_osgi/org/apache/log4j/chainsaw/LoggingReceiver.java
  109. BIN  log4jlib_osgi/org/apache/log4j/chainsaw/Main$1.class
  110. BIN  log4jlib_osgi/org/apache/log4j/chainsaw/Main.class
  111. +192 −0 log4jlib_osgi/org/apache/log4j/chainsaw/Main.java
  112. BIN  log4jlib_osgi/org/apache/log4j/chainsaw/MyTableModel$1.class
  113. BIN  log4jlib_osgi/org/apache/log4j/chainsaw/MyTableModel$Processor.class
  114. BIN  log4jlib_osgi/org/apache/log4j/chainsaw/MyTableModel.class
  115. +390 −0 log4jlib_osgi/org/apache/log4j/chainsaw/MyTableModel.java
  116. BIN  log4jlib_osgi/org/apache/log4j/chainsaw/XMLFileHandler.class
  117. +170 −0 log4jlib_osgi/org/apache/log4j/chainsaw/XMLFileHandler.java
  118. BIN  log4jlib_osgi/org/apache/log4j/chainsaw/doc-files/screen_01.png
  119. +118 −0 log4jlib_osgi/org/apache/log4j/chainsaw/package.html
  120. BIN  log4jlib_osgi/org/apache/log4j/config/PropertyGetter$PropertyCallback.class
  121. BIN  log4jlib_osgi/org/apache/log4j/config/PropertyGetter.class
  122. +108 −0 log4jlib_osgi/org/apache/log4j/config/PropertyGetter.java
  123. BIN  log4jlib_osgi/org/apache/log4j/config/PropertyPrinter.class
  124. +168 −0 log4jlib_osgi/org/apache/log4j/config/PropertyPrinter.java
  125. BIN  log4jlib_osgi/org/apache/log4j/config/PropertySetter.class
  126. +310 −0 log4jlib_osgi/org/apache/log4j/config/PropertySetter.java
  127. BIN  log4jlib_osgi/org/apache/log4j/config/PropertySetterException.class
  128. +54 −0 log4jlib_osgi/org/apache/log4j/config/PropertySetterException.java
  129. +23 −0 log4jlib_osgi/org/apache/log4j/config/package.html
  130. BIN  log4jlib_osgi/org/apache/log4j/helpers/AbsoluteTimeDateFormat.class
  131. +145 −0 log4jlib_osgi/org/apache/log4j/helpers/AbsoluteTimeDateFormat.java
  132. BIN  log4jlib_osgi/org/apache/log4j/helpers/AppenderAttachableImpl.class
  133. +176 −0 log4jlib_osgi/org/apache/log4j/helpers/AppenderAttachableImpl.java
  134. BIN  log4jlib_osgi/org/apache/log4j/helpers/BoundedFIFO.class
  135. +181 −0 log4jlib_osgi/org/apache/log4j/helpers/BoundedFIFO.java
  136. BIN  log4jlib_osgi/org/apache/log4j/helpers/CountingQuietWriter.class
  137. +63 −0 log4jlib_osgi/org/apache/log4j/helpers/CountingQuietWriter.java
  138. BIN  log4jlib_osgi/org/apache/log4j/helpers/CyclicBuffer.class
  139. +159 −0 log4jlib_osgi/org/apache/log4j/helpers/CyclicBuffer.java
  140. BIN  log4jlib_osgi/org/apache/log4j/helpers/DateLayout.class
  141. +200 −0 log4jlib_osgi/org/apache/log4j/helpers/DateLayout.java
  142. BIN  log4jlib_osgi/org/apache/log4j/helpers/DateTimeDateFormat.class
  143. +85 −0 log4jlib_osgi/org/apache/log4j/helpers/DateTimeDateFormat.java
  144. BIN  log4jlib_osgi/org/apache/log4j/helpers/FileWatchdog.class
  145. +111 −0 log4jlib_osgi/org/apache/log4j/helpers/FileWatchdog.java
  146. BIN  log4jlib_osgi/org/apache/log4j/helpers/FormattingInfo.class
  147. +45 −0 log4jlib_osgi/org/apache/log4j/helpers/FormattingInfo.java
  148. BIN  log4jlib_osgi/org/apache/log4j/helpers/ISO8601DateFormat.class
  149. +155 −0 log4jlib_osgi/org/apache/log4j/helpers/ISO8601DateFormat.java
  150. BIN  log4jlib_osgi/org/apache/log4j/helpers/Loader.class
  151. +200 −0 log4jlib_osgi/org/apache/log4j/helpers/Loader.java
  152. BIN  log4jlib_osgi/org/apache/log4j/helpers/LogLog.class
  153. +189 −0 log4jlib_osgi/org/apache/log4j/helpers/LogLog.java
  154. BIN  log4jlib_osgi/org/apache/log4j/helpers/MDCKeySetExtractor.class
  155. +92 −0 log4jlib_osgi/org/apache/log4j/helpers/MDCKeySetExtractor.java
  156. BIN  log4jlib_osgi/org/apache/log4j/helpers/NullEnumeration.class
  157. +50 −0 log4jlib_osgi/org/apache/log4j/helpers/NullEnumeration.java
  158. BIN  log4jlib_osgi/org/apache/log4j/helpers/OnlyOnceErrorHandler.class
  159. +114 −0 log4jlib_osgi/org/apache/log4j/helpers/OnlyOnceErrorHandler.java
  160. BIN  log4jlib_osgi/org/apache/log4j/helpers/OptionConverter.class
  161. +485 −0 log4jlib_osgi/org/apache/log4j/helpers/OptionConverter.java
  162. BIN  log4jlib_osgi/org/apache/log4j/helpers/PatternConverter.class
  163. +111 −0 log4jlib_osgi/org/apache/log4j/helpers/PatternConverter.java
  164. BIN  log4jlib_osgi/org/apache/log4j/helpers/PatternParser$BasicPatternConverter.class
  165. BIN  log4jlib_osgi/org/apache/log4j/helpers/PatternParser$CategoryPatternConverter.class
  166. BIN  log4jlib_osgi/org/apache/log4j/helpers/PatternParser$ClassNamePatternConverter.class
  167. BIN  log4jlib_osgi/org/apache/log4j/helpers/PatternParser$DatePatternConverter.class
  168. BIN  log4jlib_osgi/org/apache/log4j/helpers/PatternParser$LiteralPatternConverter.class
  169. BIN  log4jlib_osgi/org/apache/log4j/helpers/PatternParser$LocationPatternConverter.class
  170. BIN  log4jlib_osgi/org/apache/log4j/helpers/PatternParser$MDCPatternConverter.class
  171. BIN  log4jlib_osgi/org/apache/log4j/helpers/PatternParser$NamedPatternConverter.class
  172. BIN  log4jlib_osgi/org/apache/log4j/helpers/PatternParser.class
  173. +570 −0 log4jlib_osgi/org/apache/log4j/helpers/PatternParser.java
  174. BIN  log4jlib_osgi/org/apache/log4j/helpers/QuietWriter.class
  175. +76 −0 log4jlib_osgi/org/apache/log4j/helpers/QuietWriter.java
  176. BIN  log4jlib_osgi/org/apache/log4j/helpers/RelativeTimeDateFormat.class
  177. +65 −0 log4jlib_osgi/org/apache/log4j/helpers/RelativeTimeDateFormat.java
  178. BIN  log4jlib_osgi/org/apache/log4j/helpers/SyslogQuietWriter.class
  179. +56 −0 log4jlib_osgi/org/apache/log4j/helpers/SyslogQuietWriter.java
  180. BIN  log4jlib_osgi/org/apache/log4j/helpers/SyslogWriter.class
  181. +145 −0 log4jlib_osgi/org/apache/log4j/helpers/SyslogWriter.java
  182. BIN  log4jlib_osgi/org/apache/log4j/helpers/ThreadLocalMap.class
  183. +42 −0 log4jlib_osgi/org/apache/log4j/helpers/ThreadLocalMap.java
  184. BIN  log4jlib_osgi/org/apache/log4j/helpers/Transform.class
  185. +113 −0 log4jlib_osgi/org/apache/log4j/helpers/Transform.java
  186. +33 −0 log4jlib_osgi/org/apache/log4j/helpers/package.html
  187. BIN  log4jlib_osgi/org/apache/log4j/jdbc/JDBCAppender.class
  188. +398 −0 log4jlib_osgi/org/apache/log4j/jdbc/JDBCAppender.java
  189. +23 −0 log4jlib_osgi/org/apache/log4j/jdbc/package.html
  190. BIN  log4jlib_osgi/org/apache/log4j/jmx/AbstractDynamicMBean.class
  191. +187 −0 log4jlib_osgi/org/apache/log4j/jmx/AbstractDynamicMBean.java
  192. BIN  log4jlib_osgi/org/apache/log4j/jmx/Agent.class
  193. +131 −0 log4jlib_osgi/org/apache/log4j/jmx/Agent.java
  194. BIN  log4jlib_osgi/org/apache/log4j/jmx/AppenderDynamicMBean.class
  195. +346 −0 log4jlib_osgi/org/apache/log4j/jmx/AppenderDynamicMBean.java
  196. BIN  log4jlib_osgi/org/apache/log4j/jmx/HierarchyDynamicMBean.class
  197. +302 −0 log4jlib_osgi/org/apache/log4j/jmx/HierarchyDynamicMBean.java
  198. BIN  log4jlib_osgi/org/apache/log4j/jmx/LayoutDynamicMBean.class
  199. +274 −0 log4jlib_osgi/org/apache/log4j/jmx/LayoutDynamicMBean.java
  200. BIN  log4jlib_osgi/org/apache/log4j/jmx/LoggerDynamicMBean.class
  201. +282 −0 log4jlib_osgi/org/apache/log4j/jmx/LoggerDynamicMBean.java
  202. BIN  log4jlib_osgi/org/apache/log4j/jmx/MethodUnion.class
  203. +32 −0 log4jlib_osgi/org/apache/log4j/jmx/MethodUnion.java
  204. +24 −0 log4jlib_osgi/org/apache/log4j/jmx/package.html
  205. BIN  log4jlib_osgi/org/apache/log4j/lf5/AppenderFinalizer.class
  206. +78 −0 log4jlib_osgi/org/apache/log4j/lf5/AppenderFinalizer.java
  207. BIN  log4jlib_osgi/org/apache/log4j/lf5/DefaultLF5Configurator.class
  208. +113 −0 log4jlib_osgi/org/apache/log4j/lf5/DefaultLF5Configurator.java
  209. BIN  log4jlib_osgi/org/apache/log4j/lf5/LF5Appender.class
  210. +266 −0 log4jlib_osgi/org/apache/log4j/lf5/LF5Appender.java
  211. BIN  log4jlib_osgi/org/apache/log4j/lf5/Log4JLogRecord.class
  212. +116 −0 log4jlib_osgi/org/apache/log4j/lf5/Log4JLogRecord.java
  213. BIN  log4jlib_osgi/org/apache/log4j/lf5/LogLevel.class
  214. +278 −0 log4jlib_osgi/org/apache/log4j/lf5/LogLevel.java
  215. BIN  log4jlib_osgi/org/apache/log4j/lf5/LogLevelFormatException.class
  216. +73 −0 log4jlib_osgi/org/apache/log4j/lf5/LogLevelFormatException.java
  217. BIN  log4jlib_osgi/org/apache/log4j/lf5/LogRecord.class
  218. +395 −0 log4jlib_osgi/org/apache/log4j/lf5/LogRecord.java
  219. BIN  log4jlib_osgi/org/apache/log4j/lf5/LogRecordFilter.class
  220. +46 −0 log4jlib_osgi/org/apache/log4j/lf5/LogRecordFilter.java
  221. BIN  log4jlib_osgi/org/apache/log4j/lf5/PassingLogRecordFilter.class
  222. +74 −0 log4jlib_osgi/org/apache/log4j/lf5/PassingLogRecordFilter.java
  223. BIN  log4jlib_osgi/org/apache/log4j/lf5/StartLogFactor5.class
  224. +81 −0 log4jlib_osgi/org/apache/log4j/lf5/StartLogFactor5.java
  225. BIN  log4jlib_osgi/org/apache/log4j/lf5/util/AdapterLogRecord.class
  226. +114 −0 log4jlib_osgi/org/apache/log4j/lf5/util/AdapterLogRecord.java
  227. BIN  log4jlib_osgi/org/apache/log4j/lf5/util/DateFormatManager.class
  228. +243 −0 log4jlib_osgi/org/apache/log4j/lf5/util/DateFormatManager.java
  229. BIN  log4jlib_osgi/org/apache/log4j/lf5/util/LogFileParser$1.class
  230. BIN  log4jlib_osgi/org/apache/log4j/lf5/util/LogFileParser.class
  231. +301 −0 log4jlib_osgi/org/apache/log4j/lf5/util/LogFileParser.java
  232. BIN  log4jlib_osgi/org/apache/log4j/lf5/util/LogMonitorAdapter.class
  233. +289 −0 log4jlib_osgi/org/apache/log4j/lf5/util/LogMonitorAdapter.java
  234. BIN  log4jlib_osgi/org/apache/log4j/lf5/util/Resource.class
  235. +156 −0 log4jlib_osgi/org/apache/log4j/lf5/util/Resource.java
  236. BIN  log4jlib_osgi/org/apache/log4j/lf5/util/ResourceUtils.class
  237. +133 −0 log4jlib_osgi/org/apache/log4j/lf5/util/ResourceUtils.java
  238. BIN  log4jlib_osgi/org/apache/log4j/lf5/util/StreamUtils.class
  239. +124 −0 log4jlib_osgi/org/apache/log4j/lf5/util/StreamUtils.java
  240. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/FilteredLogTableModel.class
  241. +263 −0 log4jlib_osgi/org/apache/log4j/lf5/viewer/FilteredLogTableModel.java
  242. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LF5SwingUtils$1.class
  243. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LF5SwingUtils.class
  244. +153 −0 log4jlib_osgi/org/apache/log4j/lf5/viewer/LF5SwingUtils.java
  245. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogBrokerMonitor$1.class
  246. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogBrokerMonitor$10.class
  247. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogBrokerMonitor$11.class
  248. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogBrokerMonitor$12.class
  249. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogBrokerMonitor$13.class
  250. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogBrokerMonitor$14.class
  251. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogBrokerMonitor$15.class
  252. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogBrokerMonitor$16.class
  253. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogBrokerMonitor$17.class
  254. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogBrokerMonitor$18.class
  255. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogBrokerMonitor$19.class
  256. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogBrokerMonitor$2.class
  257. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogBrokerMonitor$20.class
  258. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogBrokerMonitor$21.class
  259. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogBrokerMonitor$22.class
  260. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogBrokerMonitor$23.class
  261. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogBrokerMonitor$24.class
  262. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogBrokerMonitor$25.class
  263. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogBrokerMonitor$26.class
  264. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogBrokerMonitor$27.class
  265. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogBrokerMonitor$28.class
  266. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogBrokerMonitor$29.class
  267. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogBrokerMonitor$3.class
  268. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogBrokerMonitor$30.class
  269. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogBrokerMonitor$31.class
  270. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogBrokerMonitor$32.class
  271. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogBrokerMonitor$4.class
  272. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogBrokerMonitor$5.class
  273. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogBrokerMonitor$6.class
  274. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogBrokerMonitor$7.class
  275. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogBrokerMonitor$8.class
  276. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogBrokerMonitor$9.class
  277. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogBrokerMonitor$LogBrokerMonitorWindowAdaptor.class
  278. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogBrokerMonitor.class
  279. +1,612 −0 log4jlib_osgi/org/apache/log4j/lf5/viewer/LogBrokerMonitor.java
  280. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogFactor5Dialog.class
  281. +151 −0 log4jlib_osgi/org/apache/log4j/lf5/viewer/LogFactor5Dialog.java
  282. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogFactor5ErrorDialog$1.class
  283. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogFactor5ErrorDialog.class
  284. +92 −0 log4jlib_osgi/org/apache/log4j/lf5/viewer/LogFactor5ErrorDialog.java
  285. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogFactor5InputDialog$1.class
  286. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogFactor5InputDialog$2.class
  287. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogFactor5InputDialog$3.class
  288. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogFactor5InputDialog.class
  289. +145 −0 log4jlib_osgi/org/apache/log4j/lf5/viewer/LogFactor5InputDialog.java
  290. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogFactor5LoadingDialog.class
  291. +82 −0 log4jlib_osgi/org/apache/log4j/lf5/viewer/LogFactor5LoadingDialog.java
  292. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogTable$LogTableListSelectionListener.class
  293. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogTable.class
  294. +277 −0 log4jlib_osgi/org/apache/log4j/lf5/viewer/LogTable.java
  295. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogTableColumn.class
  296. +166 −0 log4jlib_osgi/org/apache/log4j/lf5/viewer/LogTableColumn.java
  297. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogTableColumnFormatException.class
  298. +74 −0 log4jlib_osgi/org/apache/log4j/lf5/viewer/LogTableColumnFormatException.java
  299. BIN  log4jlib_osgi/org/apache/log4j/lf5/viewer/LogTableModel.class
  300. +77 −0 log4jlib_osgi/org/apache/log4j/lf5/viewer/LogTableModel.java
Sorry, we could not display the entire diff because too many files (701) changed.
8 XBeeAPITest/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path=""/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="con" path="com.buglabs.dragonfly.jdt.BugClasspathContainerInitializer"/>
+ <classpathentry kind="output" path=""/>
+</classpath>
29 XBeeAPITest/.project
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>XBeeAPITest</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>com.buglabs.dragonfly.BugApplicationNature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
7 XBeeAPITest/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+#Wed Sep 21 17:39:04 EDT 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.source=1.6
23 XBeeAPITest/META-INF/MANIFEST.MF
@@ -0,0 +1,23 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: XBeeAPITest
+Bundle-Activator: xbeeapitest.Activator
+Bundle-SymbolicName: XBeeAPITest
+Bundle-Version: 1.0.0
+Bundle-Vendor: terg
+Bug-Bundle-Type: Application
+BUG-API-Version: 2.0.2
+Import-Package: com.buglabs.application,
+ com.buglabs.util,
+ com.rapplogic.xbee,
+ com.rapplogic.xbee.api,
+ com.rapplogic.xbee.api.wpan,
+ com.rapplogic.xbee.api.zigbee,
+ com.rapplogic.xbee.examples,
+ com.rapplogic.xbee.examples.wpan,
+ com.rapplogic.xbee.examples.zigbee,
+ com.rapplogic.xbee.test,
+ com.rapplogic.xbee.util,
+ org.osgi.framework,
+ org.osgi.service.log,
+ org.osgi.util.tracker
BIN  XBeeAPITest/xbeeapitest/Activator.class
Binary file not shown
50 XBeeAPITest/xbeeapitest/Activator.java
@@ -0,0 +1,50 @@
+/**
+ * Generated by Dragonfly SDK.
+ */
+package xbeeapitest;
+
+
+import org.osgi.service.log.LogService;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.util.tracker.ServiceTracker;
+
+import com.buglabs.application.ServiceTrackerHelper;
+
+
+/**
+ * BundleActivator for XBeeAPITest. The OSGi entry point to the application.
+ *
+ */
+public class Activator implements BundleActivator {
+ /**
+ * OSGi services the application depends on.
+ */
+ private static final String [] services = {
+ LogService.class.getName(),
+ };
+ private ServiceTracker serviceTracker;
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ //Begin tracking services, and when all services are available, create thread and call ManagedRunnable.run().
+ serviceTracker = ServiceTrackerHelper.openServiceTracker(context, services, new XBeeAPITestApplication());
+
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+
+ //Will cause the ManagedRunnable.shutdown() to be called.
+ serviceTracker.close();
+ }
+
+
+}
BIN  XBeeAPITest/xbeeapitest/XBeeAPITestApplication$PacketParser.class
Binary file not shown
BIN  XBeeAPITest/xbeeapitest/XBeeAPITestApplication.class
Binary file not shown
120 XBeeAPITest/xbeeapitest/XBeeAPITestApplication.java
@@ -0,0 +1,120 @@
+package xbeeapitest;
+
+import java.util.Map;
+import java.util.Properties;
+
+import org.osgi.service.log.LogService;
+
+import com.buglabs.application.ServiceTrackerHelper.ManagedRunnable;
+import com.rapplogic.xbee.api.ApiId;
+import com.rapplogic.xbee.api.AtCommand;
+import com.rapplogic.xbee.api.AtCommandResponse;
+import com.rapplogic.xbee.api.PacketListener;
+import com.rapplogic.xbee.api.XBee;
+import com.rapplogic.xbee.api.XBeeAddress;
+import com.rapplogic.xbee.api.XBeeException;
+import com.rapplogic.xbee.api.XBeeResponse;
+import com.rapplogic.xbee.api.wpan.RxBaseResponse;
+import com.rapplogic.xbee.api.wpan.RxResponse;
+import com.rapplogic.xbee.api.wpan.RxResponseIoSample;
+import com.rapplogic.xbee.util.ByteUtils;
+/**
+ * This class represents the running application when all service dependencies are fulfilled.
+ *
+ * The run() method will be called with a map containing all the services specified in ServiceTrackerHelper.openServiceTracker().
+ * The application will run in a separate thread than the caller of start() in the Activator. See
+ * ManagedInlineRunnable for a thread-less application.
+ *
+ * By default, the application will only be started when all service dependencies are fulfilled. For
+ * finer grained service binding logic, see ServiceTrackerHelper.openServiceTracker(BundleContext context, String[] services, Filter filter, ServiceTrackerCustomizer customizer)
+ */
+public class XBeeAPITestApplication implements ManagedRunnable {
+ private LogService ls;
+ private XBee xb;
+
+ @Override
+ public void run(Map<Object, Object> services) {
+ ls = (LogService) services.get(LogService.class.getName());
+ ilog("Start, connecting");
+ System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyUSB0");
+ xb = new XBee();
+ try {
+ xb.open("/dev/ttyUSB0",9600);
+ dlog("Opened, requesting data");
+ AtCommandResponse res = (AtCommandResponse) xb.sendSynchronous(new AtCommand("MY"), 10000);
+ if (res.isOk()){
+ ilog("Addr of attached XBee: "+ByteUtils.toBase16(res.getValue()));
+ }
+ } catch (XBeeException e) {
+ e.printStackTrace();
+ shutdown();
+ return;
+ }
+ xb.addPacketListener(new PacketParser());
+ }
+
+ @Override
+ public void shutdown() {
+ ilog("Stop.");
+ xb.close();
+ }
+
+ private class PacketParser implements PacketListener{
+
+ @Override
+ public void processResponse(XBeeResponse res) {
+ //If the incoming data is a serial data packet
+ if (res.getApiId() == ApiId.RX_16_RESPONSE){
+ RxResponse pkt = (RxResponse) res;
+ String data = ByteUtils.toString(pkt.getData());
+ //dlog("Incoming data "+pkt.getSourceAddress().getAddress()[1]+": "+data);
+ if (pkt.getSourceAddress().getAddress()[1] == 1){
+ //Data from the Sonar mote
+ if (data.charAt(0) == 'R'){
+ ilog("Range: "+data.substring(1)+"(cm)");
+ } else {
+ dlog("Sonar data: "+data);
+ }
+ } else if (pkt.getSourceAddress().getAddress()[1] == 2){
+ //Serial data from the Motion mote (must be in serial mode)
+ if (data.contains("M")){
+ ilog("Motion detected!");
+ } else {
+ dlog("Motion data: "+data);
+ }
+ } else if (pkt.getSourceAddress().getAddress()[1] == 3){
+ //Data from the weatherboard
+ if (data.charAt(0) == '$'){
+ data = data.substring(2,data.length()-2);
+ String[] values = data.split(",");
+ ilog("Temperature: "+values[0]+" (F)");
+ ilog("Humidity: "+values[1]+" (%)");
+ ilog("Dewpoint: "+values[2]+" (F)");
+ ilog("Pressure: "+values[3]+" (in/hg)");
+ ilog("Light: "+values[4]+" (%)");
+ ilog("Wind Speed: "+values[5]+" (mph)");
+ ilog("Wind Direction: "+values[6]+" (deg)");
+ ilog("Rainfall: "+values[7]+" (in)");
+ ilog("Battery: "+values[8]+" (V)");
+ } else {
+ dlog("Weatherboard info: "+data);
+ }
+ } else {
+ dlog("Data from "+pkt.getSourceAddress().getAddress()[1]+": "+data);
+ }
+ } else if (res.getApiId() == ApiId.RX_16_IO_RESPONSE){
+ //If incoming data is an IO packet
+ //Assume this was from a Motion module
+ RxResponseIoSample pkt = (RxResponseIoSample) res;
+ ilog("Motion detected: "+ByteUtils.toBase16(pkt.getSamples()[0].getDioMsb())+","+ByteUtils.toBase16(pkt.getSamples()[0].getDioLsb()));
+ }
+ }
+
+ }
+
+ //Wrappers for the log service (to standardize logged messages)
+ void ilog(String message){ ls.log(ls.LOG_INFO, "["+this.getClass().getSimpleName()+"] "+message); }
+ void dlog(String message){ ls.log(ls.LOG_DEBUG, "["+this.getClass().getSimpleName()+"] "+message); }
+ void elog(String message){ ls.log(ls.LOG_ERROR, "["+this.getClass().getSimpleName()+"] "+message); }
+ void wlog(String message){ ls.log(ls.LOG_WARNING, "["+this.getClass().getSimpleName()+"] "+message); }
+}
8 log4jlib_osgi/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path=""/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="con" path="com.buglabs.dragonfly.jdt.BugClasspathContainerInitializer"/>
+ <classpathentry kind="output" path=""/>
+</classpath>
29 log4jlib_osgi/.project
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>log4jlib_osgi</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>com.buglabs.dragonfly.BugApplicationNature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
7 log4jlib_osgi/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+#Wed Oct 27 14:43:26 EDT 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.source=1.6
10 log4jlib_osgi/META-INF/MANIFEST.MF
@@ -0,0 +1,10 @@
+Manifest-Version: 1.0
+Export-Package: org.apache.log4j
+Bug-Bundle-Type: Application
+Bundle-Vendor: jconnolly
+Bundle-Version: 1.0.0
+BUG-API-Version: 1.4.4
+Bundle-Name: log4jlib_osgi
+Import-Package: org.osgi.framework
+Bundle-SymbolicName: log4jlib_osgi
+
BIN  log4jlib_osgi/org/apache/log4j/Appender.class
Binary file not shown
142 log4jlib_osgi/org/apache/log4j/Appender.java
@@ -0,0 +1,142 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.log4j;
+
+import org.apache.log4j.spi.Filter;
+import org.apache.log4j.spi.ErrorHandler;
+import org.apache.log4j.spi.LoggingEvent;
+
+/**
+ Implement this interface for your own strategies for outputting log
+ statements.
+
+ @author Ceki G&uuml;lc&uuml;
+*/
+public interface Appender {
+
+ /**
+ Add a filter to the end of the filter list.
+
+ @since 0.9.0
+ */
+ void addFilter(Filter newFilter);
+
+ /**
+ Returns the head Filter. The Filters are organized in a linked list
+ and so all Filters on this Appender are available through the result.
+
+ @return the head Filter or null, if no Filters are present
+ @since 1.1
+ */
+ public
+ Filter getFilter();
+
+ /**
+ Clear the list of filters by removing all the filters in it.
+
+ @since 0.9.0
+ */
+ public
+ void clearFilters();
+
+ /**
+ Release any resources allocated within the appender such as file
+ handles, network connections, etc.
+
+ <p>It is a programming error to append to a closed appender.
+
+ @since 0.8.4
+ */
+ public
+ void close();
+
+ /**
+ Log in <code>Appender</code> specific way. When appropriate,
+ Loggers will call the <code>doAppend</code> method of appender
+ implementations in order to log. */
+ public
+ void doAppend(LoggingEvent event);
+
+
+ /**
+ Get the name of this appender.
+ @return name, may be null.*/
+ public
+ String getName();
+
+
+ /**
+ Set the {@link ErrorHandler} for this appender.
+
+ @since 0.9.0
+ */
+ public
+ void setErrorHandler(ErrorHandler errorHandler);
+
+ /**
+ Returns the {@link ErrorHandler} for this appender.
+
+ @since 1.1
+ */
+ public
+ ErrorHandler getErrorHandler();
+
+ /**
+ Set the {@link Layout} for this appender.
+
+ @since 0.8.1
+ */
+ public
+ void setLayout(Layout layout);
+
+ /**
+ Returns this appenders layout.
+
+ @since 1.1
+ */
+ public
+ Layout getLayout();
+
+
+ /**
+ Set the name of this appender. The name is used by other
+ components to identify this appender.
+
+ @since 0.8.1
+ */
+ public
+ void setName(String name);
+
+ /**
+ Configurators call this method to determine if the appender
+ requires a layout. If this method returns <code>true</code>,
+ meaning that layout is required, then the configurator will
+ configure an layout using the configuration information at its
+ disposal. If this method returns <code>false</code>, meaning that
+ a layout is not required, then layout configuration will be
+ skipped even if there is available layout configuration
+ information at the disposal of the configurator..
+
+ <p>In the rather exceptional case, where the appender
+ implementation admits a layout but can also work without it, then
+ the appender should return <code>true</code>.
+
+ @since 0.8.4 */
+ public
+ boolean requiresLayout();
+}
BIN  log4jlib_osgi/org/apache/log4j/AppenderSkeleton.class
Binary file not shown
304 log4jlib_osgi/org/apache/log4j/AppenderSkeleton.java
@@ -0,0 +1,304 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.log4j;
+
+import org.apache.log4j.spi.Filter;
+import org.apache.log4j.spi.ErrorHandler;
+import org.apache.log4j.spi.OptionHandler;
+import org.apache.log4j.spi.LoggingEvent;
+import org.apache.log4j.helpers.OnlyOnceErrorHandler;
+import org.apache.log4j.helpers.LogLog;
+
+
+/**
+ * Abstract superclass of the other appenders in the package.
+ *
+ * This class provides the code for common functionality, such as
+ * support for threshold filtering and support for general filters.
+ *
+ * @since 0.8.1
+ * @author Ceki G&uuml;lc&uuml;
+ * */
+public abstract class AppenderSkeleton implements Appender, OptionHandler {
+
+ /** The layout variable does not need to be set if the appender
+ implementation has its own layout. */
+ protected Layout layout;
+
+ /** Appenders are named. */
+ protected String name;
+
+ /**
+ There is no level threshold filtering by default. */
+ protected Priority threshold;
+
+ /**
+ It is assumed and enforced that errorHandler is never null.
+ */
+ protected ErrorHandler errorHandler = new OnlyOnceErrorHandler();
+
+ /** The first filter in the filter chain. Set to <code>null</code>
+ initially. */
+ protected Filter headFilter;
+ /** The last filter in the filter chain. */
+ protected Filter tailFilter;
+
+ /**
+ Is this appender closed?
+ */
+ protected boolean closed = false;
+
+ /**
+ * Create new instance.
+ */
+ public AppenderSkeleton() {
+ super();
+ }
+
+ /**
+ * Create new instance.
+ * Provided for compatibility with log4j 1.3.
+ *
+ * @param isActive true if appender is ready for use upon construction.
+ * Not used in log4j 1.2.x.
+ * @since 1.2.15
+ */
+ protected AppenderSkeleton(final boolean isActive) {
+ super();
+ }
+
+
+
+ /**
+ Derived appenders should override this method if option structure
+ requires it. */
+ public
+ void activateOptions() {
+ }
+
+
+ /**
+ Add a filter to end of the filter list.
+
+ @since 0.9.0
+ */
+ public
+ void addFilter(Filter newFilter) {
+ if(headFilter == null) {
+ headFilter = tailFilter = newFilter;
+ } else {
+ tailFilter.setNext(newFilter);
+ tailFilter = newFilter;
+ }
+ }
+
+ /**
+ Subclasses of <code>AppenderSkeleton</code> should implement this
+ method to perform actual logging. See also {@link #doAppend
+ AppenderSkeleton.doAppend} method.
+
+ @since 0.9.0
+ */
+ abstract
+ protected
+ void append(LoggingEvent event);
+
+
+ /**
+ Clear the filters chain.
+
+ @since 0.9.0 */
+ public
+ void clearFilters() {
+ headFilter = tailFilter = null;
+ }
+
+ /**
+ Finalize this appender by calling the derived class'
+ <code>close</code> method.
+
+ @since 0.8.4 */
+ public
+ void finalize() {
+ // An appender might be closed then garbage collected. There is no
+ // point in closing twice.
+ if(this.closed)
+ return;
+
+ LogLog.debug("Finalizing appender named ["+name+"].");
+ close();
+ }
+
+
+ /**
+ Return the currently set {@link ErrorHandler} for this
+ Appender.
+
+ @since 0.9.0 */
+ public
+ ErrorHandler getErrorHandler() {
+ return this.errorHandler;
+ }
+
+
+ /**
+ Returns the head Filter.
+
+ @since 1.1
+ */
+ public
+ Filter getFilter() {
+ return headFilter;
+ }
+
+ /**
+ Return the first filter in the filter chain for this
+ Appender. The return value may be <code>null</code> if no is
+ filter is set.
+
+ */
+ public
+ final
+ Filter getFirstFilter() {
+ return headFilter;
+ }
+
+ /**
+ Returns the layout of this appender. The value may be null.
+ */
+ public
+ Layout getLayout() {
+ return layout;
+ }
+
+
+ /**
+ Returns the name of this appender.
+ @return name, may be null.
+ */
+ public
+ final
+ String getName() {
+ return this.name;
+ }
+
+ /**
+ Returns this appenders threshold level. See the {@link
+ #setThreshold} method for the meaning of this option.
+
+ @since 1.1 */
+ public
+ Priority getThreshold() {
+ return threshold;
+ }
+
+
+ /**
+ Check whether the message level is below the appender's
+ threshold. If there is no threshold set, then the return value is
+ always <code>true</code>.
+
+ */
+ public
+ boolean isAsSevereAsThreshold(Priority priority) {
+ return ((threshold == null) || priority.isGreaterOrEqual(threshold));
+ }
+
+
+ /**
+ * This method performs threshold checks and invokes filters before
+ * delegating actual logging to the subclasses specific {@link
+ * AppenderSkeleton#append} method.
+ * */
+ public
+ synchronized
+ void doAppend(LoggingEvent event) {
+ if(closed) {
+ LogLog.error("Attempted to append to closed appender named ["+name+"].");
+ return;
+ }
+
+ if(!isAsSevereAsThreshold(event.getLevel())) {
+ return;
+ }
+
+ Filter f = this.headFilter;
+
+ FILTER_LOOP:
+ while(f != null) {
+ switch(f.decide(event)) {
+ case Filter.DENY: return;
+ case Filter.ACCEPT: break FILTER_LOOP;
+ case Filter.NEUTRAL: f = f.getNext();
+ }
+ }
+
+ this.append(event);
+ }
+
+ /**
+ Set the {@link ErrorHandler} for this Appender.
+ @since 0.9.0
+ */
+ public
+ synchronized
+ void setErrorHandler(ErrorHandler eh) {
+ if(eh == null) {
+ // We do not throw exception here since the cause is probably a
+ // bad config file.
+ LogLog.warn("You have tried to set a null error-handler.");
+ } else {
+ this.errorHandler = eh;
+ }
+ }
+
+ /**
+ Set the layout for this appender. Note that some appenders have
+ their own (fixed) layouts or do not use one. For example, the
+ {@link org.apache.log4j.net.SocketAppender} ignores the layout set
+ here.
+ */
+ public
+ void setLayout(Layout layout) {
+ this.layout = layout;
+ }
+
+
+ /**
+ Set the name of this Appender.
+ */
+ public
+ void setName(String name) {
+ this.name = name;
+ }
+
+
+ /**
+ Set the threshold level. All log events with lower level
+ than the threshold level are ignored by the appender.
+
+ <p>In configuration files this option is specified by setting the
+ value of the <b>Threshold</b> option to a level
+ string, such as "DEBUG", "INFO" and so on.
+
+ @since 0.8.3 */
+ public
+ void setThreshold(Priority threshold) {
+ this.threshold = threshold;
+ }
+}
BIN  log4jlib_osgi/org/apache/log4j/AsyncAppender$DiscardSummary.class
Binary file not shown
BIN  log4jlib_osgi/org/apache/log4j/AsyncAppender$Dispatcher.class
Binary file not shown
BIN  log4jlib_osgi/org/apache/log4j/AsyncAppender.class
Binary file not shown
596 log4jlib_osgi/org/apache/log4j/AsyncAppender.java
@@ -0,0 +1,596 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Contibutors: Aaron Greenhouse <aarong@cs.cmu.edu>
+// Thomas Tuft Muller <ttm@online.no>
+package org.apache.log4j;
+
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.log4j.helpers.AppenderAttachableImpl;
+import org.apache.log4j.spi.AppenderAttachable;
+import org.apache.log4j.spi.LoggingEvent;
+
+
+/**
+ * The AsyncAppender lets users log events asynchronously.
+ * <p/>
+ * <p/>
+ * The AsyncAppender will collect the events sent to it and then dispatch them
+ * to all the appenders that are attached to it. You can attach multiple
+ * appenders to an AsyncAppender.
+ * </p>
+ * <p/>
+ * <p/>
+ * The AsyncAppender uses a separate thread to serve the events in its buffer.
+ * </p>
+ * <p/>
+ * <b>Important note:</b> The <code>AsyncAppender</code> can only be script
+ * configured using the {@link org.apache.log4j.xml.DOMConfigurator}.
+ * </p>
+ *
+ * @author Ceki G&uuml;lc&uuml;
+ * @author Curt Arnold
+ * @since 0.9.1
+ */
+public class AsyncAppender extends AppenderSkeleton
+ implements AppenderAttachable {
+ /**
+ * The default buffer size is set to 128 events.
+ */
+ public static final int DEFAULT_BUFFER_SIZE = 128;
+
+ /**
+ * Event buffer, also used as monitor to protect itself and
+ * discardMap from simulatenous modifications.
+ */
+ private final List buffer = new ArrayList();
+
+ /**
+ * Map of DiscardSummary objects keyed by logger name.
+ */
+ private final Map discardMap = new HashMap();
+
+ /**
+ * Buffer size.
+ */
+ private int bufferSize = DEFAULT_BUFFER_SIZE;
+
+ /** Nested appenders. */
+ AppenderAttachableImpl aai;
+
+ /**
+ * Nested appenders.
+ */
+ private final AppenderAttachableImpl appenders;
+
+ /**
+ * Dispatcher.
+ */
+ private final Thread dispatcher;
+
+ /**
+ * Should location info be included in dispatched messages.
+ */
+ private boolean locationInfo = false;
+
+ /**
+ * Does appender block when buffer is full.
+ */
+ private boolean blocking = true;
+
+ /**
+ * Create new instance.
+ */
+ public AsyncAppender() {
+ appenders = new AppenderAttachableImpl();
+
+ //
+ // only set for compatibility
+ aai = appenders;
+
+ dispatcher =
+ new Thread(new Dispatcher(this, buffer, discardMap, appenders));
+
+ // It is the user's responsibility to close appenders before
+ // exiting.
+ dispatcher.setDaemon(true);
+
+ // set the dispatcher priority to lowest possible value
+ // dispatcher.setPriority(Thread.MIN_PRIORITY);
+ dispatcher.setName("AsyncAppender-Dispatcher-" + dispatcher.getName());
+ dispatcher.start();
+ }
+
+ /**
+ * Add appender.
+ *
+ * @param newAppender appender to add, may not be null.
+ */
+ public void addAppender(final Appender newAppender) {
+ synchronized (appenders) {
+ appenders.addAppender(newAppender);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void append(final LoggingEvent event) {
+ //
+ // if dispatcher thread has died then
+ // append subsequent events synchronously
+ // See bug 23021
+ if ((dispatcher == null) || !dispatcher.isAlive() || (bufferSize <= 0)) {
+ synchronized (appenders) {
+ appenders.appendLoopOnAppenders(event);
+ }
+
+ return;
+ }
+
+ // Set the NDC and thread name for the calling thread as these
+ // LoggingEvent fields were not set at event creation time.
+ event.getNDC();
+ event.getThreadName();
+ // Get a copy of this thread's MDC.
+ event.getMDCCopy();
+ if (locationInfo) {
+ event.getLocationInformation();
+ }
+ event.getRenderedMessage();
+ event.getThrowableStrRep();
+
+ synchronized (buffer) {
+ while (true) {
+ int previousSize = buffer.size();
+
+ if (previousSize < bufferSize) {
+ buffer.add(event);
+
+ //
+ // if buffer had been empty
+ // signal all threads waiting on buffer
+ // to check their conditions.
+ //
+ if (previousSize == 0) {
+ buffer.notifyAll();
+ }
+
+ break;
+ }
+
+ //
+ // Following code is only reachable if buffer is full
+ //
+ //
+ // if blocking and thread is not already interrupted
+ // and not the dispatcher then
+ // wait for a buffer notification
+ boolean discard = true;
+ if (blocking
+ && !Thread.interrupted()
+ && Thread.currentThread() != dispatcher) {
+ try {
+ buffer.wait();
+ discard = false;
+ } catch (InterruptedException e) {
+ //
+ // reset interrupt status so
+ // calling code can see interrupt on
+ // their next wait or sleep.
+ Thread.currentThread().interrupt();
+ }
+ }
+
+ //
+ // if blocking is false or thread has been interrupted
+ // add event to discard map.
+ //
+ if (discard) {
+ String loggerName = event.getLoggerName();
+ DiscardSummary summary = (DiscardSummary) discardMap.get(loggerName);
+
+ if (summary == null) {
+ summary = new DiscardSummary(event);
+ discardMap.put(loggerName, summary);
+ } else {
+ summary.add(event);
+ }
+
+ break;
+ }
+ }
+ }
+ }
+
+ /**
+ * Close this <code>AsyncAppender</code> by interrupting the dispatcher
+ * thread which will process all pending events before exiting.
+ */
+ public void close() {
+ /**
+ * Set closed flag and notify all threads to check their conditions.
+ * Should result in dispatcher terminating.
+ */
+ synchronized (buffer) {
+ closed = true;
+ buffer.notifyAll();
+ }
+
+ try {
+ dispatcher.join();
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ org.apache.log4j.helpers.LogLog.error(
+ "Got an InterruptedException while waiting for the "
+ + "dispatcher to finish.", e);
+ }
+
+ //
+ // close all attached appenders.
+ //
+ synchronized (appenders) {
+ Enumeration iter = appenders.getAllAppenders();
+
+ if (iter != null) {
+ while (iter.hasMoreElements()) {
+ Object next = iter.nextElement();
+
+ if (next instanceof Appender) {
+ ((Appender) next).close();
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Get iterator over attached appenders.
+ * @return iterator or null if no attached appenders.
+ */
+ public Enumeration getAllAppenders() {
+ synchronized (appenders) {
+ return appenders.getAllAppenders();
+ }
+ }
+
+ /**
+ * Get appender by name.
+ *
+ * @param name name, may not be null.
+ * @return matching appender or null.
+ */
+ public Appender getAppender(final String name) {
+ synchronized (appenders) {
+ return appenders.getAppender(name);
+ }
+ }
+
+ /**
+ * Gets whether the location of the logging request call
+ * should be captured.
+ *
+ * @return the current value of the <b>LocationInfo</b> option.
+ */
+ public boolean getLocationInfo() {
+ return locationInfo;
+ }
+
+ /**
+ * Determines if specified appender is attached.
+ * @param appender appender.
+ * @return true if attached.
+ */
+ public boolean isAttached(final Appender appender) {
+ synchronized (appenders) {
+ return appenders.isAttached(appender);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean requiresLayout() {
+ return false;
+ }
+
+ /**
+ * Removes and closes all attached appenders.
+ */
+ public void removeAllAppenders() {
+ synchronized (appenders) {
+ appenders.removeAllAppenders();
+ }
+ }
+
+ /**
+ * Removes an appender.
+ * @param appender appender to remove.
+ */
+ public void removeAppender(final Appender appender) {
+ synchronized (appenders) {
+ appenders.removeAppender(appender);
+ }
+ }
+
+ /**
+ * Remove appender by name.
+ * @param name name.
+ */
+ public void removeAppender(final String name) {
+ synchronized (appenders) {
+ appenders.removeAppender(name);
+ }
+ }
+
+ /**
+ * The <b>LocationInfo</b> option takes a boolean value. By default, it is
+ * set to false which means there will be no effort to extract the location
+ * information related to the event. As a result, the event that will be
+ * ultimately logged will likely to contain the wrong location information
+ * (if present in the log format).
+ * <p/>
+ * <p/>
+ * Location information extraction is comparatively very slow and should be
+ * avoided unless performance is not a concern.
+ * </p>
+ * @param flag true if location information should be extracted.
+ */
+ public void setLocationInfo(final boolean flag) {
+ locationInfo = flag;
+ }
+
+ /**
+ * Sets the number of messages allowed in the event buffer
+ * before the calling thread is blocked (if blocking is true)
+ * or until messages are summarized and discarded. Changing
+ * the size will not affect messages already in the buffer.
+ *
+ * @param size buffer size, must be positive.
+ */
+ public void setBufferSize(final int size) {
+ //
+ // log4j 1.2 would throw exception if size was negative
+ // and deadlock if size was zero.
+ //
+ if (size < 0) {
+ throw new java.lang.NegativeArraySizeException("size");
+ }
+
+ synchronized (buffer) {
+ //
+ // don't let size be zero.
+ //
+ bufferSize = (size < 1) ? 1 : size;
+ buffer.notifyAll();
+ }
+ }
+
+ /**
+ * Gets the current buffer size.
+ * @return the current value of the <b>BufferSize</b> option.
+ */
+ public int getBufferSize() {
+ return bufferSize;
+ }
+
+ /**
+ * Sets whether appender should wait if there is no
+ * space available in the event buffer or immediately return.
+ *
+ * @since 1.2.14
+ * @param value true if appender should wait until available space in buffer.
+ */
+ public void setBlocking(final boolean value) {
+ synchronized (buffer) {
+ blocking = value;
+ buffer.notifyAll();
+ }
+ }
+
+ /**
+ * Gets whether appender should block calling thread when buffer is full.
+ * If false, messages will be counted by logger and a summary
+ * message appended after the contents of the buffer have been appended.
+ *
+ * @since 1.2.14
+ * @return true if calling thread will be blocked when buffer is full.
+ */
+ public boolean getBlocking() {
+ return blocking;
+ }
+
+ /**
+ * Summary of discarded logging events for a logger.
+ */
+ private static final class DiscardSummary {
+ /**
+ * First event of the highest severity.
+ */
+ private LoggingEvent maxEvent;
+
+ /**
+ * Total count of messages discarded.
+ */
+ private int count;
+
+ /**
+ * Create new instance.
+ *
+ * @param event event, may not be null.
+ */
+ public DiscardSummary(final LoggingEvent event) {
+ maxEvent = event;
+ count = 1;
+ }
+
+ /**
+ * Add discarded event to summary.
+ *
+ * @param event event, may not be null.
+ */
+ public void add(final LoggingEvent event) {
+ if (event.getLevel().toInt() > maxEvent.getLevel().toInt()) {
+ maxEvent = event;
+ }
+
+ count++;
+ }
+
+ /**
+ * Create event with summary information.
+ *
+ * @return new event.
+ */
+ public LoggingEvent createEvent() {
+ String msg =
+ MessageFormat.format(
+ "Discarded {0} messages due to full event buffer including: {1}",
+ new Object[] { new Integer(count), maxEvent.getMessage() });
+
+ return new LoggingEvent(
+ "org.apache.log4j.AsyncAppender.DONT_REPORT_LOCATION",
+ Logger.getLogger(maxEvent.getLoggerName()),
+ maxEvent.getLevel(),
+ msg,
+ null);
+ }
+ }
+
+ /**
+ * Event dispatcher.
+ */
+ private static class Dispatcher implements Runnable {
+ /**
+ * Parent AsyncAppender.
+ */
+ private final AsyncAppender parent;
+
+ /**
+ * Event buffer.
+ */
+ private final List buffer;
+
+ /**
+ * Map of DiscardSummary keyed by logger name.
+ */
+ private final Map discardMap;
+
+ /**
+ * Wrapped appenders.
+ */
+ private final AppenderAttachableImpl appenders;
+
+ /**
+ * Create new instance of dispatcher.
+ *
+ * @param parent parent AsyncAppender, may not be null.
+ * @param buffer event buffer, may not be null.
+ * @param discardMap discard map, may not be null.
+ * @param appenders appenders, may not be null.
+ */
+ public Dispatcher(
+ final AsyncAppender parent, final List buffer, final Map discardMap,
+ final AppenderAttachableImpl appenders) {
+
+ this.parent = parent;
+ this.buffer = buffer;
+ this.appenders = appenders;
+ this.discardMap = discardMap;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void run() {
+ boolean isActive = true;
+
+ //
+ // if interrupted (unlikely), end thread
+ //
+ try {
+ //
+ // loop until the AsyncAppender is closed.
+ //
+ while (isActive) {
+ LoggingEvent[] events = null;
+
+ //
+ // extract pending events while synchronized
+ // on buffer
+ //
+ synchronized (buffer) {
+ int bufferSize = buffer.size();
+ isActive = !parent.closed;
+
+ while ((bufferSize == 0) && isActive) {
+ buffer.wait();
+ bufferSize = buffer.size();
+ isActive = !parent.closed;
+ }
+
+ if (bufferSize > 0) {
+ events = new LoggingEvent[bufferSize + discardMap.size()];
+ buffer.toArray(events);
+
+ //
+ // add events due to buffer overflow
+ //
+ int index = bufferSize;
+
+ for (
+ Iterator iter = discardMap.values().iterator();
+ iter.hasNext();) {
+ events[index++] = ((DiscardSummary) iter.next()).createEvent();
+ }
+
+ //
+ // clear buffer and discard map
+ //
+ buffer.clear();
+ discardMap.clear();
+
+ //
+ // allow blocked appends to continue
+ buffer.notifyAll();
+ }
+ }
+
+ //
+ // process events after lock on buffer is released.
+ //
+ if (events != null) {
+ for (int i = 0; i < events.length; i++) {
+ synchronized (appenders) {
+ appenders.appendLoopOnAppenders(events[i]);
+ }
+ }
+ }
+ }
+ } catch (InterruptedException ex) {
+ Thread.currentThread().interrupt();
+ }
+ }
+ }
+}
BIN  log4jlib_osgi/org/apache/log4j/BasicConfigurator.class
Binary file not shown
73 log4jlib_osgi/org/apache/log4j/BasicConfigurator.java
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Contibutors: "Luke Blanshard" <Luke@quiq.com>
+// "Mark DONSZELMANN" <Mark.Donszelmann@cern.ch>
+// "Muly Oved" <mulyoved@hotmail.com>
+
+package org.apache.log4j;
+
+
+/**
+ Use this class to quickly configure the package.
+
+ <p>For file based configuration see {@link
+ PropertyConfigurator}. For XML based configuration see {@link
+ org.apache.log4j.xml.DOMConfigurator DOMConfigurator}.
+
+ @since 0.8.1
+ @author Ceki G&uuml;lc&uuml; */
+public class BasicConfigurator {
+
+ protected BasicConfigurator() {
+ }
+
+ /**
+ Add a {@link ConsoleAppender} that uses {@link PatternLayout}
+ using the {@link PatternLayout#TTCC_CONVERSION_PATTERN} and
+ prints to <code>System.out</code> to the root category. */
+ static
+ public
+ void configure() {
+ Logger root = Logger.getRootLogger();
+ root.addAppender(new ConsoleAppender(
+ new PatternLayout(PatternLayout.TTCC_CONVERSION_PATTERN)));
+ }
+
+ /**
+ Add <code>appender</code> to the root category.
+ @param appender The appender to add to the root category.
+ */
+ static
+ public
+ void configure(Appender appender) {
+ Logger root = Logger.getRootLogger();
+ root.addAppender(appender);
+ }
+
+ /**
+ Reset the default hierarchy to its defaut. It is equivalent to
+ calling
+ <code>Category.getDefaultHierarchy().resetConfiguration()</code>.
+
+ See {@link Hierarchy#resetConfiguration()} for more details. */
+ public
+ static
+ void resetConfiguration() {
+ LogManager.resetConfiguration();
+ }
+}
BIN  log4jlib_osgi/org/apache/log4j/Category.class
Binary file not shown
1,062 log4jlib_osgi/org/apache/log4j/Category.java
@@ -0,0 +1,1062 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Contibutors: Alex Blewitt <Alex.Blewitt@ioshq.com>
+// Markus Oestreicher <oes@zurich.ibm.com>
+// Frank Hoering <fhr@zurich.ibm.com>
+// Nelson Minar <nelson@media.mit.edu>
+// Jim Cakalic <jim_cakalic@na.biomerieux.com>
+// Avy Sharell <asharell@club-internet.fr>
+// Ciaran Treanor <ciaran@xelector.com>
+// Jeff Turner <jeff@socialchange.net.au>
+// Michael Horwitz <MHorwitz@siemens.co.za>
+// Calvin Chan <calvin.chan@hic.gov.au>
+// Aaron Greenhouse <aarong@cs.cmu.edu>
+// Beat Meier <bmeier@infovia.com.ar>
+// Colin Sampaleanu <colinml1@exis.com>
+
+package org.apache.log4j;
+
+import org.apache.log4j.spi.AppenderAttachable;
+import org.apache.log4j.spi.LoggingEvent;
+import org.apache.log4j.spi.LoggerRepository;
+import org.apache.log4j.spi.HierarchyEventListener;
+import org.apache.log4j.helpers.NullEnumeration;
+import org.apache.log4j.helpers.AppenderAttachableImpl;
+
+import java.util.Enumeration;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+import java.util.Vector;
+
+
+/**
+ * <font color="#AA2222"><b>This class has been deprecated and
+ * replaced by the {@link Logger} <em>subclass</em></b></font>. It
+ * will be kept around to preserve backward compatibility until mid
+ * 2003.
+ *
+ * <p><code>Logger</code> is a subclass of Category, i.e. it extends
+ * Category. In other words, a logger <em>is</em> a category. Thus,
+ * all operations that can be performed on a category can be
+ * performed on a logger. Internally, whenever log4j is asked to
+ * produce a Category object, it will instead produce a Logger
+ * object. Log4j 1.2 will <em>never</em> produce Category objects but
+ * only <code>Logger</code> instances. In order to preserve backward
+ * compatibility, methods that previously accepted category objects
+ * still continue to accept category objects.
+ *
+ * <p>For example, the following are all legal and will work as
+ * expected.
+ *
+ <pre>
+ &nbsp;&nbsp;&nbsp;// Deprecated form:
+ &nbsp;&nbsp;&nbsp;Category cat = Category.getInstance("foo.bar")
+
+ &nbsp;&nbsp;&nbsp;// Preferred form for retrieving loggers:
+ &nbsp;&nbsp;&nbsp;Logger logger = Logger.getLogger("foo.bar")
+ </pre>
+
+ * <p>The first form is deprecated and should be avoided.
+ *
+ * <p><b>There is absolutely no need for new client code to use or
+ * refer to the <code>Category</code> class.</b> Whenever possible,
+ * please avoid referring to it or using it.
+ *
+ * <p>See the <a href="../../../../manual.html">short manual</a> for an
+ * introduction on this class.
+ * <p>
+ * See the document entitled <a href="http://www.qos.ch/logging/preparingFor13.html">preparing
+ * for log4j 1.3</a> for a more detailed discussion.
+ *
+ * @author Ceki G&uuml;lc&uuml;
+ * @author Anders Kristensen
+ */
+public class Category implements AppenderAttachable {
+
+ /**
+ The hierarchy where categories are attached to by default.
+ */
+ //static
+ //public
+ //final Hierarchy defaultHierarchy = new Hierarchy(new
+ // RootCategory(Level.DEBUG));
+
+ /**
+ The name of this category.
+ */
+ protected String name;
+
+ /**
+ The assigned level of this category. The
+ <code>level</code> variable need not be assigned a value in
+ which case it is inherited form the hierarchy. */
+ volatile protected Level level;
+
+ /**
+ The parent of this category. All categories have at least one
+ ancestor which is the root category. */
+ volatile protected Category parent;
+
+ /**
+ The fully qualified name of the Category class. See also the
+ getFQCN method. */
+ private static final String FQCN = Category.class.getName();
+
+ protected ResourceBundle resourceBundle;
+
+ // Categories need to know what Hierarchy they are in
+ protected LoggerRepository repository;
+
+
+ AppenderAttachableImpl aai;
+
+ /** Additivity is set to true by default, that is children inherit
+ the appenders of their ancestors by default. If this variable is
+ set to <code>false</code> then the appenders found in the
+ ancestors of this category are not used. However, the children
+ of this category will inherit its appenders, unless the children
+ have their additivity flag set to <code>false</code> too. See
+ the user manual for more details. */
+ protected boolean additive = true;
+
+ /**
+ This constructor created a new <code>Category</code> instance and
+ sets its name.
+
+ <p>It is intended to be used by sub-classes only. You should not
+ create categories directly.
+
+ @param name The name of the category.
+ */
+ protected
+ Category(String name) {
+ this.name = name;
+ }
+
+ /**
+ Add <code>newAppender</code> to the list of appenders of this
+ Category instance.
+
+ <p>If <code>newAppender</code> is already in the list of
+ appenders, then it won't be added again.
+ */
+ synchronized
+ public
+ void addAppender(Appender newAppender) {
+ if(aai == null) {
+ aai = new AppenderAttachableImpl();
+ }
+ aai.addAppender(newAppender);
+ repository.fireAddAppenderEvent(this, newAppender);
+ }
+
+ /**
+ If <code>assertion</code> parameter is <code>false</code>, then
+ logs <code>msg</code> as an {@link #error(Object) error} statement.
+
+ <p>The <code>assert</code> method has been renamed to
+ <code>assertLog</code> because <code>assert</code> is a language
+ reserved word in JDK 1.4.
+
+ @param assertion
+ @param msg The message to print if <code>assertion</code> is
+ false.
+
+ @since 1.2 */
+ public
+ void assertLog(boolean assertion, String msg) {
+ if(!assertion)
+ this.error(msg);
+ }
+
+
+ /**
+ Call the appenders in the hierrachy starting at
+ <code>this</code>. If no appenders could be found, emit a
+ warning.
+
+ <p>This method calls all the appenders inherited from the
+ hierarchy circumventing any evaluation of whether to log or not
+ to log the particular log request.
+
+ @param event the event to log. */
+ public
+ void callAppenders(LoggingEvent event) {
+ int writes = 0;
+
+ for(Category c = this; c != null; c=c.parent) {
+ // Protected against simultaneous call to addAppender, removeAppender,...
+ synchronized(c) {
+ if(c.aai != null) {
+ writes += c.aai.appendLoopOnAppenders(event);
+ }
+ if(!c.additive) {
+ break;
+ }
+ }
+ }
+
+ if(writes == 0) {
+ repository.emitNoAppenderWarning(this);
+ }
+ }
+
+ /**
+ Close all attached appenders implementing the AppenderAttachable
+ interface.
+ @since 1.0
+ */
+ synchronized
+ void closeNestedAppenders() {
+ Enumeration enumeration = this.getAllAppenders();
+ if(enumeration != null) {
+ while(enumeration.hasMoreElements()) {
+ Appender a = (Appender) enumeration.nextElement();
+ if(a instanceof AppenderAttachable) {
+ a.close();
+ }
+ }
+ }
+ }
+
+ /**
+ Log a message object with the {@link Level#DEBUG DEBUG} level.
+
+ <p>This method first checks if this category is <code>DEBUG</code>
+ enabled by comparing the level of this category with the {@link
+ Level#DEBUG DEBUG} level. If this category is
+ <code>DEBUG</code> enabled, then it converts the message object
+ (passed as parameter) to a string by invoking the appropriate
+ {@link org.apache.log4j.or.ObjectRenderer}. It then proceeds to call all the
+ registered appenders in this category and also higher in the
+ hierarchy depending on the value of the additivity flag.
+
+ <p><b>WARNING</b> Note that passing a {@link Throwable} to this
+ method will print the name of the <code>Throwable</code> but no
+ stack trace. To print a stack trace use the {@link #debug(Object,
+ Throwable)} form instead.
+
+ @param message the message object to log. */
+ public
+ void debug(Object message) {
+ if(repository.isDisabled(Level.DEBUG_INT))
+ return;
+ if(Level.DEBUG.isGreaterOrEqual(this.getEffectiveLevel())) {
+ forcedLog(FQCN, Level.DEBUG, message, null);
+ }
+ }
+
+
+ /**
+ Log a message object with the <code>DEBUG</code> level including
+ the stack trace of the {@link Throwable} <code>t</code> passed as
+ parameter.
+
+ <p>See {@link #debug(Object)} form for more detailed information.
+
+ @param message the message object to log.
+ @param t the exception to log, including its stack trace. */
+ public
+ void debug(Object message, Throwable t) {
+ if(repository.isDisabled(Level.DEBUG_INT))
+ return;
+ if(Level.DEBUG.isGreaterOrEqual(this.getEffectiveLevel()))
+ forcedLog(FQCN, Level.DEBUG, message, t);
+ }
+
+ /**
+ Log a message object with the {@link Level#ERROR ERROR} Level.
+
+ <p>This method first checks if this category is <code>ERROR</code>
+ enabled by comparing the level of this category with {@link
+ Level#ERROR ERROR} Level. If this category is <code>ERROR</code>
+ enabled, then it converts the message object passed as parameter
+ to a string by invoking the appropriate {@link
+ org.apache.log4j.or.ObjectRenderer}. It proceeds to call all the
+ registered appenders in this category and also higher in the
+ hierarchy depending on the value of the additivity flag.
+
+ <p><b>WARNING</b> Note that passing a {@link Throwable} to this
+ method will print the name of the <code>Throwable</code> but no
+ stack trace. To print a stack trace use the {@link #error(Object,
+ Throwable)} form instead.
+
+ @param message the message object to log */
+ public
+ void error(Object message) {
+ if(repository.isDisabled(Level.ERROR_INT))
+ return;
+ if(Level.ERROR.isGreaterOrEqual(this.getEffectiveLevel()))
+ forcedLog(FQCN, Level.ERROR, message, null);
+ }
+
+ /**
+ Log a message object with the <code>ERROR</code> level including
+ the stack trace of the {@link Throwable} <code>t</code> passed as
+ parameter.
+
+ <p>See {@link #error(Object)} form for more detailed information.
+
+ @param message the message object to log.
+ @param t the exception to log, including its stack trace. */
+ public
+ void error(Object message, Throwable t) {
+ if(repository.isDisabled(Level.ERROR_INT))
+ return;
+ if(Level.ERROR.isGreaterOrEqual(this.getEffectiveLevel()))
+ forcedLog(FQCN, Level.ERROR, message, t);
+
+ }
+
+
+ /**
+ If the named category exists (in the default hierarchy) then it
+ returns a reference to the category, otherwise it returns
+ <code>null</code>.
+
+ @deprecated Please use {@link LogManager#exists} instead.
+
+ @since 0.8.5 */
+ public
+ static
+ Logger exists(String name) {
+ return LogManager.exists(name);
+ }
+
+ /**
+ Log a message object with the {@link Level#FATAL FATAL} Level.
+
+ <p>This method first checks if this category is <code>FATAL</code>
+ enabled by comparing the level of this category with {@link
+ Level#FATAL FATAL} Level. If the category is <code>FATAL</code>
+ enabled, then it converts the message object passed as parameter
+ to a string by invoking the appropriate
+ {@link org.apache.log4j.or.ObjectRenderer}. It
+ proceeds to call all the registered appenders in this category and
+ also higher in the hierarchy depending on the value of the
+ additivity flag.
+
+ <p><b>WARNING</b> Note that passing a {@link Throwable} to this
+ method will print the name of the Throwable but no stack trace. To
+ print a stack trace use the {@link #fatal(Object, Throwable)} form
+ instead.
+
+ @param message the message object to log */
+ public
+ void fatal(Object message) {
+ if(repository.isDisabled(Level.FATAL_INT))
+ return;
+ if(Level.FATAL.isGreaterOrEqual(this.getEffectiveLevel()))
+ forcedLog(FQCN, Level.FATAL, message, null);
+ }
+
+ /**
+ Log a message object with the <code>FATAL</code> level including
+ the stack trace of the {@link Throwable} <code>t</code> passed as
+ parameter.
+
+ <p>See {@link #fatal(Object)} for more detailed information.
+
+ @param message the message object to log.
+ @param t the exception to log, including its stack trace. */
+ public
+ void fatal(Object message, Throwable t) {
+ if(repository.isDisabled(Level.FATAL_INT))
+ return;
+ if(Level.FATAL.isGreaterOrEqual(this.getEffectiveLevel()))
+ forcedLog(FQCN, Level.FATAL, message, t);
+ }
+
+
+ /**
+ This method creates a new logging event and logs the event
+ without further checks. */
+ protected
+ void forcedLog(String fqcn, Priority level, Object message, Throwable t) {
+ callAppenders(new LoggingEvent(fqcn, this, level, message, t));
+ }
+
+
+ /**
+ Get the additivity flag for this Category instance.
+ */
+ public
+ boolean getAdditivity() {
+ return additive;
+ }
+
+ /**
+ Get the appenders contained in this category as an {@link
+ Enumeration}. If no appenders can be found, then a {@link NullEnumeration}
+ is returned.
+
+ @return Enumeration An enumeration of the appenders in this category. */
+ synchronized
+ public
+ Enumeration getAllAppenders() {
+ if(aai == null)
+ return NullEnumeration.getInstance();
+ else
+ return aai.getAllAppenders();
+ }
+
+ /**
+ Look for the appender named as <code>name</code>.
+
+ <p>Return the appender with that name if in the list. Return
+ <code>null</code> otherwise. */
+ synchronized
+ public
+ Appender getAppender(String name) {
+ if(aai == null || name == null)
+ return null;
+
+ return aai.getAppender(name);
+ }
+
+ /**
+ Starting from this category, search the category hierarchy for a
+ non-null level and return it. Otherwise, return the level of the
+ root category.
+
+ <p>The Category class is designed so that this method executes as
+ quickly as possible.
+ */
+ public
+ Level getEffectiveLevel() {
+ for(Category c = this; c != null; c=c.parent) {
+ if(c.level != null)
+ return c.level;
+ }
+ return null; // If reached will cause an NullPointerException.
+ }
+
+ /**
+ *
+ * @deprecated Please use the the {@link #getEffectiveLevel} method
+ * instead.
+ * */
+ public
+ Priority getChainedPriority() {
+ for(Category c = this; c != null; c=c.parent) {
+ if(c.level != null)
+ return c.level;
+ }
+ return null; // If reached will cause an NullPointerException.
+ }
+
+
+ /**
+ Returns all the currently defined categories in the default
+ hierarchy as an {@link java.util.Enumeration Enumeration}.
+
+ <p>The root category is <em>not</em> included in the returned
+ {@link Enumeration}.
+
+ @deprecated Please use {@link LogManager#getCurrentLoggers()} instead.
+ */
+ public
+ static
+ Enumeration getCurrentCategories() {
+ return LogManager.getCurrentLoggers();
+ }
+
+
+ /**
+ Return the default Hierarchy instance.
+
+ @deprecated Please use {@link LogManager#getLoggerRepository()} instead.
+
+ @since 1.0
+ */
+ public
+ static
+ LoggerRepository getDefaultHierarchy() {
+ return LogManager.getLoggerRepository();
+ }
+
+ /**
+ Return the the {@link Hierarchy} where this <code>Category</code>
+ instance is attached.
+
+ @deprecated Please use {@link #getLoggerRepository} instead.
+
+ @since 1.1 */
+ public
+ LoggerRepository getHierarchy() {
+ return repository;
+ }
+
+ /**
+ Return the the {@link LoggerRepository} where this
+ <code>Category</code> is attached.
+
+ @since 1.2 */
+ public
+ LoggerRepository getLoggerRepository() {
+ return repository;
+ }
+
+
+ /**
+ * @deprecated Make sure to use {@link Logger#getLogger(String)} instead.
+ */
+ public
+ static
+ Category getInstance(String name) {
+ return LogManager.getLogger(name);
+ }
+
+ /**
+ * @deprecated Please make sure to use {@link Logger#getLogger(Class)} instead.
+ */
+ public
+ static
+ Category getInstance(Class clazz) {
+ return LogManager.getLogger(clazz);
+ }
+
+
+ /**
+ Return the category name. */
+ public
+ final
+ String getName() {
+ return name;
+ }
+
+
+ /**
+ Returns the parent of this category. Note that the parent of a
+ given category may change during the lifetime of the category.
+
+ <p>The root category will return <code>null</code>.
+
+ @since 1.2
+ */
+ final
+ public
+ Category getParent() {
+ return this.parent;
+ }
+
+
+ /**
+ Returns the assigned {@link Level}, if any, for this Category.
+
+ @return Level - the assigned Level, can be <code>null</code>.
+ */
+ final
+ public
+ Level getLevel() {
+ return this.level;
+ }
+
+ /**
+ @deprecated Please use {@link #getLevel} instead.
+ */
+ final
+ public
+ Level getPriority() {
+ return this.level;
+ }
+
+
+ /**
+ * @deprecated Please use {@link Logger#getRootLogger()} instead.
+ */
+ final
+ public
+ static
+ Category getRoot() {
+ return LogManager.getRootLogger();
+ }
+
+ /**
+ Return the <em>inherited</em> {@link ResourceBundle} for this
+ category.
+
+ <p>This method walks the hierarchy to find the appropriate
+ resource bundle. It will return the resource bundle attached to
+ the closest ancestor of this category, much like the way
+ priorities are searched. In case there is no bundle in the
+ hierarchy then <code>null</code> is returned.
+
+ @since 0.9.0 */
+ public
+ ResourceBundle getResourceBundle() {
+ for(Category c = this; c != null; c=c.parent) {
+ if(c.resourceBundle != null)
+ return c.resourceBundle;
+ }
+ // It might be the case that there is no resource bundle
+ return null;
+ }