ScheduleMaker実装サービス jp.ossc.nimbus.service.scheduler2.DatabaseConditionScheduleMakerService

jp.ossc.nimbus.service.scheduler2.DatabaseConditionScheduleMakerServiceは、スケジュールを作成する条件判断をSQLで行うScheduleMaker実装サービスです。

SQLの戻り値が、BOOL型trueまたはNUMBER型0以外またはCHAR型0以外の場合は、スケジュールを作成します。

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

下位サービスインタフェース用途
jp.ossc.nimbus.service.connection.ConnectionFactoryJDBCコネクションを取得する。

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

  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. <!-- ScheduleMakerサービス -->
  8. <service name="BusinessDayScheduleMaker"
  9. code="jp.ossc.nimbus.service.scheduler2.DatabaseConditionScheduleMakerService">
  10. <!-- スケジュール作成日をSQLに文字列として埋め込む場合のフォーマットを設定する -->
  11. <attribute name="DateFormat">yyyyMMdd</attribute>
  12. <!-- SQLを設定する -->
  13. <attribute name="Query">
  14. SELECT COUNT(1) FROM BUSINESSDAY WHERE DAY = ?
  15. </attribute>
  16. <!-- ConnectionFactoryサービスのサービス名を設定する -->
  17. <attribute name="ConnectionFactoryServiceName">#ConnectionFactory</attribute>
  18. <depends>ConnectionFactory</depends>
  19. </service>
  20. <!-- JDBCドライバ経由でConnectionを取得するConnectionFactoryサービス -->
  21. <service name="ConnectionFactory"
  22. code="jp.ossc.nimbus.service.connection.JDBCConnectionFactoryService">
  23. <attribute name="DriverName">org.hsqldb.jdbcDriver</attribute>
  24. <attribute name="ConnectionURL">jdbc:hsqldb:./localDB</attribute>
  25. <attribute name="UserName">sa</attribute>
  26. <attribute name="Password"></attribute>
  27. </service>
  28. <!-- ScheduleManagerサービス -->
  29. <service name="ScheduleManager"
  30. code="jp.ossc.nimbus.service.scheduler2.DefaultScheduleManagerService">
  31. <attribute name="ScheduleMasterServiceNames">
  32. #ScheduleMaster1
  33. #ScheduleMaster2
  34. </attribute>
  35. <attribute name="ScheduleMakerTypeMapping">
  36. 営業日=#BusinessDayScheduleMaker
  37. </attribute>
  38. <attribute name="PersistDir">./schedule</attribute>
  39. <depends>BusinessDayScheduleMaker</depends>
  40. <depends>
  41. <!-- スケジュールマスタ1
  42. 08:00:00にFlow1を実行するスケジュール
  43. -->
  44. <service name="ScheduleMaster1"
  45. code="jp.ossc.nimbus.service.scheduler2.DefaultScheduleMaster">
  46. <attribute name="Id">Schedule1</attribute>
  47. <attribute name="TaskName">Flow1</attribute>
  48. <attribute name="StartTime">// 08:00:00 000</attribute>
  49. <attribute name="ScheduleType">営業日</attribute>
  50. </service>
  51. </depends>
  52. <depends>
  53. <!-- スケジュールマスタ2
  54. スケジュールマスタ1の終了を待って、08:00:00にFlow2を実行するスケジュール
  55. -->
  56. <service name="ScheduleMaster2"
  57. code="jp.ossc.nimbus.service.scheduler2.DefaultScheduleMaster">
  58. <attribute name="Id">Schedule2</attribute>
  59. <attribute name="TaskName">Flow2</attribute>
  60. <attribute name="StartTime">// 08:00:00 000</attribute>
  61. <attribute name="Input">100</attribute>
  62. <attribute name="Depends">Schedule1</attribute>
  63. <attribute name="ScheduleType">毎日</attribute>
  64. </service>
  65. </depends>
  66. </service>
  67. </manager>
  68. </server>


スケジューラ/高機能スケジューラ/ScheduleMaker