ByteWriterPattern

ByteWriterPattern パターンは、バイト・データをファイルに書き込むために使用されます。

サポートされるクラス

FileByteWriter クラスは、指定されたファイルを開いてバイトを書き込むための論理を提供します。 指定されたプロパティーに応じて、既存の内容に対して付加または上書きを行うことができます。 再始動時には、ファイルは常に付加モードで開かれます。

必須プロパティー

以下は、このパターンの必須のプロパティーです。
表 1. 必須プロパティー. 次の表に、パターンの各必須プロパティーの名前と値を示します。
プロパティー名
PATTERN_IMPL_CLASS ByteWriterPattern インターフェースを実装するクラス
FILENAME 入力ファイルへの完全パス

オプション・プロパティー

以下は、このパターンのオプションのプロパティーです。
表 2. オプション・プロパティー. 次の表に、パターンの各オプション・プロパティーの名前、値、および説明を示します。
プロパティー名 説明
debug true または false (デフォルトは false) このバッチ・データ・ストリームに対する詳細トレースを使用可能にします。
EnablePerformanceMeasurement true または false (デフォルトは false) GenericXDBatchStep を使用している場合に、バッチ・データ・ストリームおよび processRecord メソッドに費やされた合計時間を計算します。
EnableDetailedPerformanceMeasurement true または false (デフォルトは false) バッチ・データ・ストリームの各メソッドで費やされた時間のより詳細な明細を提供します。
file.encoding ファイルのエンコード 例えば、8859_1 です。
AppendJobldToFileName true または false (デフォルトは false) ファイルをロードする前にファイル名にジョブ ID を付加します。
append true または false (デフォルトは true) ファイルを付加モードで開くかどうかを決定します。
重要: 再始動時には、ファイルは常に付加モードで開かれます。

インターフェース定義

public interface ByteWriterPattern { 
  
	/**  
	 	 * Invoked during the step setup phase  
	 * @param props  
	 */  
		public void initialize(Properties props);
	  
	/**  
	 	 * Writes the given object onto the given outputstream. Any processing  
	 	 * that needs to be done before writing can be added here   
	 * @param out  
	 * @param record
	 	 * @throws IOException
	 */  
		public void writeRecord(BufferedOutputStream out, Object record) throws IOException;  
	  
	/**  
	 	 * Write header information if any  
	 * @param out  
	 	 * @throws IOException
	 */  
		public void writeHeader(BufferedOutputStream out) throws IOException;  

         /**
	 	 * This method can be optionally called during process step to explicity 
	 	 * initialize and write the header. 
	 * @param header
	 */
		public void writeHeader(BufferedOutputStream out, Object header) throws IOException;
}  

xJCL の例

<batch-data-streams>		    
<bds> 	
	<logical-name>outputStream</logical-name>
<props>
     <prop name="PATTERN_IMPL_CLASS" value="com.ibm.websphere.batch.samples.tests.bds.EchoWriter"/>
     <prop name="file.encoding" value="8859_1"/>
     <prop name="FILENAME" value="/opt/txlist.txt" />
     <prop name="debug" value="true"/>
</props>
<impl-class>com.ibm.websphere.batch.devframework.datastreams.patterns.FileByteWriter</impl-class>
</bds>  
</batch-data-streams>

トピックのタイプを示すアイコン 参照トピック



タイム・スタンプ・アイコン 最終更新: last_date
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=rgrid_btchpttrn4
ファイル名:rgrid_btchpttrn4.html