Interceptor実装サービス jp.ossc.nimbus.service.aop.interceptor.servlet.AccessJournalInterceptorService

jp.ossc.nimbus.service.aop.interceptor.servlet.AccessJournalInterceptorServiceは、サーブレットへのアクセスジャーナルを取得するInterceptor実装サービスです。

このサービスは、複合的なサービスで、以下のサービスを下位サービスとして使用します。

下位サービスインタフェース用途
jp.ossc.nimbus.service.journal.Journalジャーナルを出力する。
jp.ossc.nimbus.service.journal.editorfinder.EditorFinderジャーナルを編集するjp.ossc.nimbus.service.journal.JournalEditorを見つける。
jp.ossc.nimbus.service.context.ContextリクエストIDを取得するコンテキスト。
jp.ossc.nimbus.service.sequence.SequenceリクエストIDを発番する。

以下に簡単なサービス定義を示します。

  1. <?xml version="1.0" encoding="Shift_JIS"?>
  2. <!DOCTYPE server PUBLIC
  3. "-//Nimbus//DTD Nimbus 1.0//JA"
  4. "http://nimbus.sourceforge.jp/dtd/nimbus-service_1_0.dtd">
  5. <server>
  6. <manager>
  7. <!-- アクセスジャーナルを取得するInterceptorサービス -->
  8. <service name="AccessJournalInterceptor"
  9. code="jp.ossc.nimbus.service.aop.interceptor.servlet.AccessJournalInterceptorService">
  10. <attribute name="JournalServiceName">#Journal</attribute>
  11. <depends>Journal</depends>
  12. </service>
  13. <!-- 以下はジャーナルサービス定義 -->
  14. <service name="Journal"
  15. code="jp.ossc.nimbus.service.journal.ThreadManagedJournalService">
  16. <attribute name="EditorFinderName">#JournalEditorFinder</attribute>
  17. <attribute name="WritableElementKey">AccessJournal</attribute>
  18. <attribute name="CategoryServiceNames">#JournalCategory</attribute>
  19. <depends>JournalEditorFinder</depends>
  20. <depends>JournalCategory</depends>
  21. </service>
  22. <service name="JournalCategory"
  23. code="jp.ossc.nimbus.service.writer.SimpleCategoryService">
  24. <attribute name="MessageWriterServiceName">#JournalWriter</attribute>
  25. <attribute name="WritableRecordFactoryServiceName">#JournalWritableRecordFactory</attribute>
  26. <attribute name="CategoryServiceNames">#JournalCategory</attribute>
  27. <depends>JournalWriter</depends>
  28. <depends>JournalWritableRecordFactory</depends>
  29. </service>
  30. <service name="JournalWritableRecordFactory"
  31. code="jp.ossc.nimbus.service.writer.PropertyWritableRecordFactoryService">
  32. <attribute name="FormatKeyMapping">
  33. DATE=AccessJournal.StartTime
  34. REQUEST_ID=AccessJournal.RequestID
  35. CLIENT=AccessJournal.JournalRecords.Request[0].JournalRecords.ServletRequest[0].RemoteAddress
  36. SESSION_ID=AccessJournal.JournalRecords.Request[0].JournalRecords.ServletRequest[0].RequestSessionID
  37. REQUEST_URL=AccessJournal.JournalRecords.Request[0].JournalRecords.ServletRequest[0].RequestURL
  38. REQUEST_HEADERS=AccessJournal.JournalRecords.Request[0].JournalRecords.ServletRequest[0].HTTPHeaders
  39. REQUEST_PARAMS=AccessJournal.JournalRecords.Request[0].JournalRecords.ServletRequest[0].Parameters
  40. RESPONSE_STATUS=AccessJournal.JournalRecords.Response[0].JournalRecords.ServletResponse[0].Status
  41. PERFORMANCE=AccessJournal.Performance
  42. </attribute>
  43. <attribute name="Format">""%DATE%","%REQUEST_ID%","%CLIENT%","%SESSION_ID%","%REQUEST_URL%","%REQUEST_HEADERS%","%REQUEST_PARAMS%","%RESPONSE_STATUS%","%PERFORMANCE%""</attribute>
  44. <attribute name="ImplementServiceNames">
  45. DATE=#DateElement
  46. </attribute>
  47. <depends>
  48. <service name="DateElement"
  49. code="jp.ossc.nimbus.service.writer.DateElement"
  50. instance="factory">
  51. <attribute name="Format">yyyy/MM/dd HH:mm:ss.SSS</attribute>
  52. </service>
  53. </depends>
  54. </service>
  55. <service name="JournalWriter"
  56. code="jp.ossc.nimbus.service.writer.ConsoleWriterService"/>
  57. <service name="AccessJournalEditorFinder"
  58. code="jp.ossc.nimbus.service.journal.editorfinder.ObjectMappedEditorFinderService">
  59. <attribute name="EditorProperties">
  60. java.lang.Object=#MutableObjectJournalEditor
  61. [Ljava.lang.String;=#ObjectArrayJournalEditor
  62. java.util.Enumeration=#EnumerationJournalEditor
  63. javax.servlet.http.HttpServletRequest=#HttpServletRequestJournalEditor
  64. javax.servlet.http.HttpServletResponse=#HttpServletResponseJournalEditor
  65. jp.ossc.nimbus.service.journal.RequestJournal=#RequestJournalEditor
  66. </attribute>
  67. <depends>MutableObjectJournalEditor</depends>
  68. <depends>ObjectArrayJournalEditor</depends>
  69. <depends>EnumerationJournalEditor</depends>
  70. <depends>HttpServletRequestJournalEditor</depends>
  71. <depends>HttpServletResponseJournalEditor</depends>
  72. <depends>RequestJournalEditor</depends>
  73. </service>
  74. <service name="RequestJournalEditor"
  75. code="jp.ossc.nimbus.service.journal.editor.SimpleRequestMapJournalEditorService">
  76. <attribute name="OutputRequestId">true</attribute>
  77. <attribute name="OutputStartTime">true</attribute>
  78. <attribute name="OutputRecords">true</attribute>
  79. <attribute name="OutputEndTime">false</attribute>
  80. <attribute name="OutputPerformance">true</attribute>
  81. </service>
  82. <service name="MutableObjectJournalEditor"
  83. code="jp.ossc.nimbus.service.journal.editor.MutableObjectJournalEditorService"/>
  84. <service name="ObjectArrayJournalEditor"
  85. code="jp.ossc.nimbus.service.journal.editor.ObjectArrayJournalEditorService">
  86. <attribute name="StartValueDelimiter">'</attribute>
  87. <attribute name="EndValueDelimiter">'</attribute>
  88. </service>
  89. <service name="EnumerationJournalEditor"
  90. code="jp.ossc.nimbus.service.journal.editor.EnumerationJournalEditorService"/>
  91. <service name="HttpServletRequestJournalEditor"
  92. code="jp.ossc.nimbus.service.journal.editor.HttpServletRequestMapJournalEditorService">
  93. <attribute name="OutputRemoteAddress">true</attribute>
  94. <attribute name="OutputRemotePort">false</attribute>
  95. <attribute name="OutputRemoteHost">false</attribute>
  96. <attribute name="OutputLocalAddress">false</attribute>
  97. <attribute name="OutputLocalPort">false</attribute>
  98. <attribute name="OutputLocalName">false</attribute>
  99. <attribute name="OutputServerName">false</attribute>
  100. <attribute name="OutputServerPort">false</attribute>
  101. <attribute name="OutputProtocol">false</attribute>
  102. <attribute name="OutputScheme">false</attribute>
  103. <attribute name="OutputLocale">false</attribute>
  104. <attribute name="OutputContentType">false</attribute>
  105. <attribute name="OutputContentLength">false</attribute>
  106. <attribute name="OutputCharacterEncoding">false</attribute>
  107. <attribute name="OutputAttributes">false</attribute>
  108. <attribute name="SecretAttributes"></attribute>
  109. <attribute name="EnabledAttributes"></attribute>
  110. <attribute name="OutputParameters">true</attribute>
  111. <attribute name="SecretParameters">:Header.password</attribute>
  112. <attribute name="EnabledParameters"></attribute>
  113. <attribute name="OutputRequestURL">true</attribute>
  114. <attribute name="OutputRequestURI">false</attribute>
  115. <attribute name="OutputServletPath">false</attribute>
  116. <attribute name="OutputContextPath">false</attribute>
  117. <attribute name="OutputPathInfo">false</attribute>
  118. <attribute name="OutputPathTranslated">false</attribute>
  119. <attribute name="OutputQueryString">false</attribute>
  120. <attribute name="OutputSessionID">true</attribute>
  121. <attribute name="OutputIsRequestedSessionIdFromCookie">false</attribute>
  122. <attribute name="OutputIsRequestedSessionIdFromURL">false</attribute>
  123. <attribute name="OutputMethod">false</attribute>
  124. <attribute name="OutputAuthType">false</attribute>
  125. <attribute name="OutputRemoteUser">false</attribute>
  126. <attribute name="OutputUserPrincipal">false</attribute>
  127. <attribute name="OutputHeaders">true</attribute>
  128. <attribute name="SecretHeaders"></attribute>
  129. <attribute name="EnabledHeaders"></attribute>
  130. <attribute name="OutputCookies">false</attribute>
  131. <attribute name="SecretCookies"></attribute>
  132. <attribute name="EnabledCookies"></attribute>
  133. </service>
  134. <service name="HttpServletResponseJournalEditor"
  135. code="jp.ossc.nimbus.service.journal.editor.HttpServletResponseWrapperMapJournalEditorService">
  136. <attribute name="OutputBufferSize">false</attribute>
  137. <attribute name="OutputCharacterEncoding">false</attribute>
  138. <attribute name="OutputContentType">false</attribute>
  139. <attribute name="OutputLocale">false</attribute>
  140. <attribute name="OutputIsCommitted">false</attribute>
  141. <attribute name="OutputContent">true</attribute>
  142. <attribute name="OutputContentLength">false</attribute>
  143. <attribute name="OutputCookies">false</attribute>
  144. <attribute name="EnabledCookies"></attribute>
  145. <attribute name="SecretCookies"></attribute>
  146. <attribute name="OutputHeaders">false</attribute>
  147. <attribute name="EnabledHeaders"></attribute>
  148. <attribute name="SecretHeaders"></attribute>
  149. <attribute name="OutputIsSentError">false</attribute>
  150. <attribute name="OutputRedirectLocation">false</attribute>
  151. <attribute name="OutputStatus">true</attribute>
  152. <attribute name="OutputStatusMessage">false</attribute>
  153. <attribute name="OutputStatusMessage">false</attribute>
  154. </service>
  155. </manager>
  156. </server>


アスペクト指向/Interceptor