= Interceptor実装サービス jp.ossc.nimbus.service.aop.interceptor.!BeanFlowMetricsInterceptorService [http://nimbus.sourceforge.jp/reports/apidocs/jp/ossc/nimbus/service/aop/interceptor/BeanFlowMetricsInterceptorService.html jp.ossc.nimbus.service.aop.interceptor.BeanFlowMetricsInterceptorService]は、[wiki:Function/service/beancontrol 業務フロー]の処理メトリクスを取得する[http://nimbus.sourceforge.jp/reports/apidocs/jp/ossc/nimbus/service/aop/Interceptor.html Interceptor]実装サービスです。[[BR]] 取得した処理時間統計は、JMX経由で取得するか、[wiki:Function/service/writer#header_Category 出力/Category]サービスで出力する事ができます。 このサービスは、複合的なサービスで、以下のサービスを下位サービスとして使用します。 ||下位サービスインタフェース||用途|| ||[wiki:Function/service/writer#header_Category jp.ossc.nimbus.service.writer.Category]||処理時間統計を出力するサービス。|| ||[wiki:Function/service/performance#header_PerformanceRecorder jp.ossc.nimbus.service.performance.PerformanceRecorder]||処理時間を記録するサービス。|| 以下に簡単なサービス定義を示します。 {{{ code xml <?xml version="1.0" encoding="Shift_JIS"?> <!DOCTYPE server PUBLIC "-//Nimbus//DTD Nimbus 1.0//JA" "http://nimbus.sourceforge.jp/dtd/nimbus-service_1_0.dtd"> <server> <manager> <!-- 業務フローの処理メトリクスを取得するInterceptorサービス --> <service name="BeanFlowMetricsInterceptor" code="jp.ossc.nimbus.service.aop.interceptor.BeanFlowMetricsInterceptorService"/> </manager> </server> }}} 上記の定義の場合、取得した性能統計は、JMXで取得、及び、標準出力への出力を行えます。[[BR]] [[BR]] 以下に定期的に標準出力に処理時間統計を出力するサービス定義を示します。 {{{ code xml <?xml version="1.0" encoding="Shift_JIS"?> <!DOCTYPE server PUBLIC "-//Nimbus//DTD Nimbus 1.0//JA" "http://nimbus.sourceforge.jp/dtd/nimbus-service_1_0.dtd"> <server> <manager> <!-- 業務フローの処理メトリクスを取得するInterceptorサービス --> <service name="BeanFlowMetricsInterceptor" code="jp.ossc.nimbus.service.aop.interceptor.BeanFlowMetricsInterceptorService"> <!-- 出力する間隔[ms]を設定する --> <attribute name="OutputInterval">10000</attribute> <!-- 出力先のCategoryサービスのサービス名を設定する --> <attribute name="CategoryServiceName">#Category</attribute> <depends>Category</depends> </service> <!-- 任意のオブジェクトをフォーマットして出力するCategoryサービス --> <service name="Category" code="jp.ossc.nimbus.service.writer.SimpleCategoryService"> <attribute name="WritableRecordFactoryServiceName">#WritableRecordFactory</attribute> <attribute name="MessageWriterServiceName">#Writer</attribute> <depends>WritableRecordFactory</depends> <depends>Writer</depends> </service> <!-- 出力情報をフォーマットするWritableRecordFactoryサービス --> <service name="WritableRecordFactory" code="jp.ossc.nimbus.service.writer.WritableRecordFactoryService"> <attribute name="Format">""%Order%","%Flow%","%Count%","%BestPerformance%","%WorstPerformance%","%AveragePerformance%""</attribute> </service> <!-- コンソールに出力するMessageWriterサービス --> <service name="Writer" code="jp.ossc.nimbus.service.writer.ConsoleWriterService"/> </manager> </server> }}} ---- [wiki:Function/service/aop#header_Interceptor アスペクト指向/Interceptor]