public abstract class BaseJob extends Object implements Job
JobSchedulerContext
からパラメータを取得するためのユーティリティメソッドが用意されています。コンストラクタと説明 |
---|
BaseJob() |
修飾子とタイプ | メソッドと説明 |
---|---|
protected boolean |
canParseToBoolean(String value)
与えられた文字列がbooleanに変換可能か判別します。
|
abstract JobResult |
execute()
ジョブの実行処理を行います。
|
protected JobSchedulerContext |
getJobContext()
ジョブコンテキストを取得します。
|
protected String |
getParameter(String key)
与えられたキーで
JobSchedulerContext から取得したパラメータを返します。 |
protected String |
getParameter(String key,
String defaultValue)
与えられたキーで
JobSchedulerContext から取得したパラメータをintに変換して返します。 |
protected boolean |
getParameterAsBoolean(String key)
与えられたキーで
JobSchedulerContext から取得したパラメータをbooleanに変換して返します。 |
protected boolean |
getParameterAsBoolean(String key,
boolean defaultValue)
与えられたキーで
JobSchedulerContext から取得したパラメータをbooleanに変換して返します。 |
protected int |
getParameterAsInteger(String key)
与えられたキーで
JobSchedulerContext から取得したパラメータをintに変換して返します。 |
protected int |
getParameterAsInteger(String key,
int defaultValue)
与えられたキーで
JobSchedulerContext から取得したパラメータをintに変換して返します。 |
public abstract JobResult execute() throws JobExecuteException
execute
インタフェース内 Job
JobExecuteException
- ジョブ実行中に例外がスローされた場合、 実行処理の結果がエラーとして扱います。メッセージにはスローされた例外のローカライズメッセージが使用されます。Job.execute()
protected JobSchedulerContext getJobContext()
protected String getParameter(String key) throws InvalidParameterException
JobSchedulerContext
から取得したパラメータを返します。key
- キーInvalidParameterException
- 取得したパラメータがnullだった場合protected String getParameter(String key, String defaultValue)
JobSchedulerContext
から取得したパラメータをintに変換して返します。key
- キーdefaultValue
- デフォルト値protected int getParameterAsInteger(String key) throws InvalidParameterException
JobSchedulerContext
から取得したパラメータをintに変換して返します。key
- キーInvalidParameterException
- 取得したパラメータがnullもしくはintとして不正な値だった場合protected int getParameterAsInteger(String key, int defaultValue)
JobSchedulerContext
から取得したパラメータをintに変換して返します。key
- キーdefaultValue
- デフォルト値protected boolean getParameterAsBoolean(String key) throws InvalidParameterException
key
- キーInvalidParameterException
- 取得したパラメータがnullもしくはbooleanとして不正な値だった場合protected boolean getParameterAsBoolean(String key, boolean defaultValue)
JobSchedulerContext
から取得したパラメータをbooleanに変換して返します。true
として変換されます。tRue
, TRUE
, TruE
, tRuE
key
- キーdefaultValue
- デフォルト値protected boolean canParseToBoolean(String value)
value
- チェックする文字列Copyright © 2012 NTT DATA INTRAMART CORPORATION